FEATURE: use glyphs instead of text in flag's dispositions

This commit is contained in:
Régis Hanol 2014-08-11 18:21:34 +02:00
parent 85570ddc77
commit ec6ba68098
3 changed files with 23 additions and 7 deletions

View File

@ -27,7 +27,7 @@ Discourse.FlaggedPost = Discourse.Post.extend({
flaggedAt: postAction.created_at, flaggedAt: postAction.created_at,
disposedBy: postAction.disposed_by_id ? self.userLookup[postAction.disposed_by_id] : null, disposedBy: postAction.disposed_by_id ? self.userLookup[postAction.disposed_by_id] : null,
disposedAt: postAction.disposed_at, disposedAt: postAction.disposed_at,
disposition: postAction.disposition ? I18n.t('admin.flags.dispositions.' + postAction.disposition) : null, dispositionIcon: self.dispositionIcon(postAction.disposition),
tookAction: postAction.staff_took_action tookAction: postAction.staff_took_action
}); });
}); });
@ -35,6 +35,17 @@ Discourse.FlaggedPost = Discourse.Post.extend({
return flaggers; return flaggers;
}.property(), }.property(),
dispositionIcon: function (disposition) {
if (!disposition) { return null; }
var icon, title = I18n.t('admin.flags.dispositions.' + disposition);
switch (disposition) {
case "deferred": { icon = "fa-external-link"; break; }
case "agreed": { icon = "fa-thumbs-o-up"; break; }
case "disagreed": { icon = "fa-thumbs-o-down"; break; }
}
return "<i class='fa " + icon + "' title='" + title + "'></i>";
},
conversations: function () { conversations: function () {
var self = this; var self = this;
var conversations = []; var conversations = [];

View File

@ -56,10 +56,14 @@
{{avatar user imageSize="small"}} {{avatar user imageSize="small"}}
{{/link-to}} {{/link-to}}
</td> </td>
<td width="30%"> <td width="40%">
{{#link-to 'adminUser' user}}
{{user.username}}
{{/link-to}}
<br />
{{date flaggedAt}} {{date flaggedAt}}
</td> </td>
<td width="50%"> <td width="40%">
{{flagType}} {{flagType}}
</td> </td>
</tr> </tr>
@ -78,13 +82,13 @@
{{avatar disposedBy imageSize="small"}} {{avatar disposedBy imageSize="small"}}
{{/link-to}} {{/link-to}}
</td> </td>
<td width="30%"> <td width="40%">
{{date disposedAt}} {{date disposedAt}}
</td> </td>
<td width="50%"> <td width="40%">
{{disposition}} {{{dispositionIcon}}}
{{#if tookAction}} {{#if tookAction}}
<i class='fa fa-gavel'></i> <i class='fa fa-gavel' title='{{i18n admin.flags.took_action}}'></i>
{{/if}} {{/if}}
</td> </td>
</tr> </tr>

View File

@ -1480,6 +1480,7 @@ en:
flagged_by: "Flagged by" flagged_by: "Flagged by"
resolved_by: "Resolved by" resolved_by: "Resolved by"
took_action: "Took action"
system: "System" system: "System"
error: "Something went wrong" error: "Something went wrong"
reply_message: "Reply" reply_message: "Reply"