FEATURE: add count of previous flags on the post
This commit is contained in:
parent
7d6f3a5089
commit
00bd665c96
|
@ -32,6 +32,11 @@
|
|||
{{#if flaggedPost.wasEdited}}<i class="fa fa-pencil" title="{{i18n admin.flags.was_edited}}"></i>{{/if}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{#if adminActiveFlagsView}}
|
||||
{{#if flaggedPost.previous_flags_count}}
|
||||
<span title="{{i18n admin.flags.previous_flags_count count=flaggedPost.previous_flags_count}}" class="badge-notification flagged-posts">{{flaggedPost.previous_flags_count}}</span>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</td>
|
||||
|
||||
<td class='excerpt'>
|
||||
|
|
|
@ -584,6 +584,7 @@ section.details {
|
|||
font-size: 13px;
|
||||
margin: 0 0 5px 0;
|
||||
}
|
||||
.flagged-posts { background: $danger; }
|
||||
}
|
||||
|
||||
/* Dashboard */
|
||||
|
|
|
@ -131,7 +131,6 @@
|
|||
.flagged-posts {
|
||||
background: $danger;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.d-dropdown {
|
||||
|
|
|
@ -1533,6 +1533,7 @@ en:
|
|||
topic_flagged: "This <strong>topic</strong> has been flagged."
|
||||
visit_topic: "Visit the topic to take action"
|
||||
was_edited: "Post was edited after the first flag"
|
||||
previous_flags_count: "This post has already been flagged {{count}} times."
|
||||
|
||||
summary:
|
||||
action_type_3:
|
||||
|
|
|
@ -26,11 +26,8 @@ module FlagQuery
|
|||
p.post_number,
|
||||
p.hidden,
|
||||
p.deleted_at,
|
||||
(SELECT pr.created_at
|
||||
FROM post_revisions pr
|
||||
WHERE pr.post_id = p.id AND pr.user_id = p.user_id
|
||||
ORDER BY created_at DESC
|
||||
LIMIT 1) AS last_revised_at
|
||||
(SELECT created_at FROM post_revisions WHERE post_id = p.id AND user_id = p.user_id ORDER BY created_at DESC LIMIT 1) AS last_revised_at,
|
||||
(SELECT COUNT(*) FROM post_actions WHERE (disagreed_at IS NOT NULL OR agreed_at IS NOT NULL OR deferred_at IS NOT NULL) AND post_id = p.id)::int AS previous_flags_count
|
||||
FROM posts p
|
||||
WHERE p.id in (:post_ids)").map_exec(OpenStruct, post_ids: post_ids)
|
||||
|
||||
|
|
Loading…
Reference in New Issue