mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:01:14 +08:00
FEATURE: add count of previous flags on the post
This commit is contained in:
@ -32,6 +32,11 @@
|
|||||||
{{#if flaggedPost.wasEdited}}<i class="fa fa-pencil" title="{{i18n admin.flags.was_edited}}"></i>{{/if}}
|
{{#if flaggedPost.wasEdited}}<i class="fa fa-pencil" title="{{i18n admin.flags.was_edited}}"></i>{{/if}}
|
||||||
{{/if}}
|
{{/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>
|
||||||
|
|
||||||
<td class='excerpt'>
|
<td class='excerpt'>
|
||||||
|
@ -584,6 +584,7 @@ section.details {
|
|||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
margin: 0 0 5px 0;
|
margin: 0 0 5px 0;
|
||||||
}
|
}
|
||||||
|
.flagged-posts { background: $danger; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Dashboard */
|
/* Dashboard */
|
||||||
|
@ -131,7 +131,6 @@
|
|||||||
.flagged-posts {
|
.flagged-posts {
|
||||||
background: $danger;
|
background: $danger;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.d-dropdown {
|
.d-dropdown {
|
||||||
|
@ -1533,6 +1533,7 @@ en:
|
|||||||
topic_flagged: "This <strong>topic</strong> has been flagged."
|
topic_flagged: "This <strong>topic</strong> has been flagged."
|
||||||
visit_topic: "Visit the topic to take action"
|
visit_topic: "Visit the topic to take action"
|
||||||
was_edited: "Post was edited after the first flag"
|
was_edited: "Post was edited after the first flag"
|
||||||
|
previous_flags_count: "This post has already been flagged {{count}} times."
|
||||||
|
|
||||||
summary:
|
summary:
|
||||||
action_type_3:
|
action_type_3:
|
||||||
|
@ -26,11 +26,8 @@ module FlagQuery
|
|||||||
p.post_number,
|
p.post_number,
|
||||||
p.hidden,
|
p.hidden,
|
||||||
p.deleted_at,
|
p.deleted_at,
|
||||||
(SELECT pr.created_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,
|
||||||
FROM post_revisions pr
|
(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
|
||||||
WHERE pr.post_id = p.id AND pr.user_id = p.user_id
|
|
||||||
ORDER BY created_at DESC
|
|
||||||
LIMIT 1) AS last_revised_at
|
|
||||||
FROM posts p
|
FROM posts p
|
||||||
WHERE p.id in (:post_ids)").map_exec(OpenStruct, post_ids: post_ids)
|
WHERE p.id in (:post_ids)").map_exec(OpenStruct, post_ids: post_ids)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user