Merge pull request #2442 from techAPJ/add-tooltip-to-glyph
Add tooltip to Admin & Moderator glyph
This commit is contained in:
commit
929a195c5d
|
@ -23,7 +23,7 @@ var PosterNameComponent = Em.Component.extend({
|
||||||
// Add a glyph if we have one
|
// Add a glyph if we have one
|
||||||
var glyph = this.posterGlyph(post);
|
var glyph = this.posterGlyph(post);
|
||||||
if (!Em.isEmpty(glyph)) {
|
if (!Em.isEmpty(glyph)) {
|
||||||
buffer.push("<i class='fa fa-" + glyph + "'></i>");
|
buffer.push(glyph);
|
||||||
}
|
}
|
||||||
buffer.push("</span>");
|
buffer.push("</span>");
|
||||||
|
|
||||||
|
@ -69,10 +69,14 @@ var PosterNameComponent = Em.Component.extend({
|
||||||
@return {String} the glyph to render (or null for none)
|
@return {String} the glyph to render (or null for none)
|
||||||
**/
|
**/
|
||||||
posterGlyph: function(post) {
|
posterGlyph: function(post) {
|
||||||
if (post.get('admin')) {
|
var desc;
|
||||||
return 'trophy';
|
|
||||||
} else if (post.get('moderator')) {
|
if(post.get('admin')) {
|
||||||
return 'magic';
|
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>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -261,6 +261,8 @@ en:
|
||||||
change: "change"
|
change: "change"
|
||||||
moderator: "{{user}} is a moderator"
|
moderator: "{{user}} is a moderator"
|
||||||
admin: "{{user}} is an admin"
|
admin: "{{user}} is an admin"
|
||||||
|
moderator_tooltip: "This user is a moderator"
|
||||||
|
admin_tooltip: "This user is an admin"
|
||||||
deleted: "(deleted)"
|
deleted: "(deleted)"
|
||||||
suspended_notice: "This user is suspended until {{date}}."
|
suspended_notice: "This user is suspended until {{date}}."
|
||||||
suspended_reason: "Reason: "
|
suspended_reason: "Reason: "
|
||||||
|
|
Loading…
Reference in New Issue