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,
disposedBy: postAction.disposed_by_id ? self.userLookup[postAction.disposed_by_id] : null,
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
});
});
@ -35,6 +35,17 @@ Discourse.FlaggedPost = Discourse.Post.extend({
return flaggers;
}.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 () {
var self = this;
var conversations = [];

View File

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

View File

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