FEATURE: flag resolution in admin screen
This commit is contained in:
parent
bd13fedba5
commit
c23a4fcbee
|
@ -23,8 +23,17 @@ Discourse.FlaggedPost = Discourse.Post.extend({
|
||||||
r = [];
|
r = [];
|
||||||
_.each(this.post_actions, function(action) {
|
_.each(this.post_actions, function(action) {
|
||||||
var user = _this.userLookup[action.user_id];
|
var user = _this.userLookup[action.user_id];
|
||||||
|
var deletedBy = null;
|
||||||
|
if(action.deleted_by_id){
|
||||||
|
deletedBy = _this.userLookup[action.deleted_by_id];
|
||||||
|
}
|
||||||
|
|
||||||
var flagType = I18n.t('admin.flags.summary.action_type_' + action.post_action_type_id, {count: 1});
|
var flagType = I18n.t('admin.flags.summary.action_type_' + action.post_action_type_id, {count: 1});
|
||||||
r.push({user: user, flagType: flagType, flaggedAt: action.created_at});
|
|
||||||
|
r.push({
|
||||||
|
user: user, flagType: flagType, flaggedAt: action.created_at, deletedBy: deletedBy,
|
||||||
|
tookAction: action.staff_took_action, deletedAt: action.deleted_at
|
||||||
|
});
|
||||||
});
|
});
|
||||||
return r;
|
return r;
|
||||||
}.property(),
|
}.property(),
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
<th class='user'></th>
|
<th class='user'></th>
|
||||||
<th class='excerpt'></th>
|
<th class='excerpt'></th>
|
||||||
<th class='flaggers'>{{i18n admin.flags.flagged_by}}</th>
|
<th class='flaggers'>{{i18n admin.flags.flagged_by}}</th>
|
||||||
|
<th class='flaggers'>{{#if adminOldFlagsView}}{{i18n admin.flags.resolved_by}}{{/if}}</th>
|
||||||
<th class='last-flagged'></th>
|
<th class='last-flagged'></th>
|
||||||
<th class='action'></th>
|
<th class='action'></th>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -62,6 +63,29 @@
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
|
<td class='flaggers result'>
|
||||||
|
<table>
|
||||||
|
<tbody>
|
||||||
|
{{#each flaggedPost.flaggers}}
|
||||||
|
<tr>
|
||||||
|
{{#if deletedBy}}
|
||||||
|
<td>
|
||||||
|
{{#link-to 'adminUser' this.deletedBy}}{{avatar this.deletedBy imageSize="small"}} {{/link-to}}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{#if this.tookAction}}
|
||||||
|
<i class='fa fa-gavel'></i>
|
||||||
|
{{/if}}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{date this.deletedAt}}
|
||||||
|
</td>
|
||||||
|
{{/if}}
|
||||||
|
</tr>
|
||||||
|
{{/each}}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
{{#if flaggedPost.topicFlagged}}
|
{{#if flaggedPost.topicFlagged}}
|
||||||
|
|
|
@ -1387,6 +1387,7 @@ en:
|
||||||
clear_topic_flags_title: "The topic has been investigated and issues have been resolved. Click Done to remove the flags."
|
clear_topic_flags_title: "The topic has been investigated and issues have been resolved. Click Done to remove the flags."
|
||||||
|
|
||||||
flagged_by: "Flagged by"
|
flagged_by: "Flagged by"
|
||||||
|
resolved_by: "Resolved by"
|
||||||
system: "System"
|
system: "System"
|
||||||
error: "Something went wrong"
|
error: "Something went wrong"
|
||||||
view_message: "Reply"
|
view_message: "Reply"
|
||||||
|
|
|
@ -57,6 +57,7 @@ module FlagQuery
|
||||||
end
|
end
|
||||||
post.post_actions << action
|
post.post_actions << action
|
||||||
users << pa.user_id
|
users << pa.user_id
|
||||||
|
users << pa.deleted_by_id if pa.deleted_by_id
|
||||||
end
|
end
|
||||||
|
|
||||||
# TODO add serializer so we can skip this
|
# TODO add serializer so we can skip this
|
||||||
|
|
Loading…
Reference in New Issue