• R/O
  • HTTP
  • SSH
  • HTTPS

newslash: Commit

newslash


Commit MetaInfo

Revisão564cdfcbec15f4a8cc6882a0f15247d1abe0bfa0 (tree)
Hora2019-03-19 19:34:42
Autorhylom <hylom@user...>
Commiterhylom

Mensagem de Log

make admin user to see firehose item's score

Mudança Sumário

Diff

--- a/src/newslash_web/lib/Newslash/Model/Comments.pm
+++ b/src/newslash_web/lib/Newslash/Model/Comments.pm
@@ -101,10 +101,20 @@ sub select {
101101 # `ORDER BY comments.cid ASC` is needed by comment-tree-building.
102102 # if change there, must fix other codes.
103103 my $sql = <<"EOSQL";
104-SELECT comments.*, comment_text.*, users.nickname AS author, users.sig AS signature
104+SELECT comments.*,
105+ comment_text.*,
106+ users.nickname AS author,
107+ users.sig AS signature,
108+ firehose.public,
109+ firehose.popularity,
110+ firehose.editorpop,
111+ firehose.neediness,
112+ firehose.activity
105113 FROM comments
106114 LEFT JOIN comment_text ON comments.cid = comment_text.cid
107115 LEFT JOIN users ON comments.uid = users.uid
116+ LEFT JOIN firehose
117+ ON (comments.cid = firehose.srcid AND firehose.type = "comment")
108118 $where_clause
109119 $orderby_clause
110120 $limit_clause
--- a/src/newslash_web/lib/Newslash/Model/Journals.pm
+++ b/src/newslash_web/lib/Newslash/Model/Journals.pm
@@ -168,7 +168,10 @@ SELECT
168168 users.nickname as author,
169169 firehose.toptags,
170170 firehose.public,
171- topics.*,
171+ firehose.popularity,
172+ firehose.editorpop,
173+ firehose.neediness,
174+ firehose.activity,
172175 discussions.commentcount AS comment_count,
173176 discussions.type AS discussion_type,
174177 discussions.commentstatus AS comment_status,
--- a/src/newslash_web/lib/Newslash/Model/Stories.pm
+++ b/src/newslash_web/lib/Newslash/Model/Stories.pm
@@ -166,8 +166,16 @@ sub select {
166166
167167 my $dbh = $self->connect_db;
168168 my $sql = <<"EOSQL";
169-SELECT stories.*, story_text.*, users.nickname as author, firehose.public,
170- discussions.type AS discussion_type, discussions.commentcount AS comment_count
169+SELECT stories.*,
170+ story_text.*,
171+ users.nickname as author,
172+ firehose.public,
173+ firehose.popularity,
174+ firehose.editorpop,
175+ firehose.neediness,
176+ firehose.activity,
177+ discussions.type AS discussion_type,
178+ discussions.commentcount AS comment_count
171179 FROM stories
172180 LEFT JOIN story_text
173181 ON stories.stoid = story_text.stoid
--- a/src/newslash_web/lib/Newslash/Model/Submissions.pm
+++ b/src/newslash_web/lib/Newslash/Model/Submissions.pm
@@ -117,9 +117,18 @@ sub select {
117117 push @attrs, @$where_values, @$limit_values, @$orderby_values;
118118
119119 my $sql = <<"EOSQL";
120-SELECT submissions.*, users.nickname AS author, firehose.toptags, firehose.discussion,
121- firehose.public, topics.*,
122- discussions.type AS discussion_type, discussions.commentcount AS comment_count
120+SELECT submissions.*,
121+ users.nickname AS author,
122+ firehose.toptags,
123+ firehose.discussion,
124+ firehose.public,
125+ firehose.popularity,
126+ firehose.editorpop,
127+ firehose.neediness,
128+ firehose.activity,
129+ topics.*,
130+ discussions.type AS discussion_type,
131+ discussions.commentcount AS comment_count
123132 FROM submissions
124133 LEFT JOIN users ON submissions.uid = users.uid
125134 LEFT JOIN firehose
--- a/src/newslash_web/templates/common/article/article.html.tt2
+++ b/src/newslash_web/templates/common/article/article.html.tt2
@@ -62,6 +62,15 @@ END;
6262 by <span v-text="item.author"><a href="/~[% item.author %]/">[% item.author %]</a></span>
6363 </span>
6464 <span class="create-time" v-text="item.create_time">[% dtf.mysql_to_user(item.create_time, user.config.ui.offset_sec, user.config.ui.time_format) %]</span>
65+ [%- IF x_template || user.is_admin %]
66+ <span class="score">
67+ pop: [% item.popularity %]
68+ epop: [% item.editorpop %]
69+ need: [% item.neediness %]
70+ act: [% item.activity %]
71+ </span>
72+ [%- END %]
73+
6574 [%- IF x_template || item.content_type == 'story' %]
6675 <span class="dept" v-if="item.content_type == 'story'">
6776 <span class="dept-name" v-text="item.dept" v-if="item.dept">[% item.dept %]</span> 部門より
Show on old repository browser