Merge pull request #2442 from techAPJ/add-tooltip-to-glyph

Add tooltip to Admin & Moderator glyph
This commit is contained in:
Robin Ward 2014-06-13 15:19:24 -04:00
commit 929a195c5d
2 changed files with 11 additions and 5 deletions

View file

@ -23,7 +23,7 @@ var PosterNameComponent = Em.Component.extend({
// Add a glyph if we have one
var glyph = this.posterGlyph(post);
if (!Em.isEmpty(glyph)) {
buffer.push("<i class='fa fa-" + glyph + "'></i>");
buffer.push(glyph);
}
buffer.push("</span>");
@ -69,10 +69,14 @@ var PosterNameComponent = Em.Component.extend({
@return {String} the glyph to render (or null for none)
**/
posterGlyph: function(post) {
if (post.get('admin')) {
return 'trophy';
} else if (post.get('moderator')) {
return 'magic';
var desc;
if(post.get('admin')) {
desc = I18n.t('user.admin_tooltip');
return '<i class="fa fa-trophy" title="' + desc + '" alt="' + desc + '"></i>';
} else if(post.get('moderator')) {
desc = I18n.t('user.moderator_tooltip');
return '<i class="fa fa-magic" title="' + desc + '" alt="' + desc + '"></i>';
}
}
});

View file

@ -261,6 +261,8 @@ en:
change: "change"
moderator: "{{user}} is a moderator"
admin: "{{user}} is an admin"
moderator_tooltip: "This user is a moderator"
admin_tooltip: "This user is an admin"
deleted: "(deleted)"
suspended_notice: "This user is suspended until {{date}}."
suspended_reason: "Reason: "