FEATURE: suppress admin glyph for admins

If you want to a shield you must grant moderation to the admin.
This commit is contained in:
Sam 2014-09-11 10:54:25 +10:00
parent 70eb7b8fdf
commit 5cb7c8ee11
2 changed files with 6 additions and 7 deletions

View File

@ -83,10 +83,7 @@ var PosterNameComponent = Em.Component.extend({
posterGlyph: function(post) { posterGlyph: function(post) {
var desc; var desc;
if(post.get('admin')) { if(post.get('moderator')) {
desc = I18n.t('user.admin_tooltip');
return '<i class="fa fa-shield" title="' + desc + '" alt="' + desc + '"></i>';
} else if(post.get('moderator')) {
desc = I18n.t('user.moderator_tooltip'); desc = I18n.t('user.moderator_tooltip');
return '<i class="fa fa-shield" title="' + desc + '" alt="' + desc + '"></i>'; return '<i class="fa fa-shield" title="' + desc + '" alt="' + desc + '"></i>';
} }

View File

@ -79,9 +79,11 @@ Discourse.User = Discourse.Model.extend({
var name = Handlebars.Utils.escapeExpression(this.get('name')), var name = Handlebars.Utils.escapeExpression(this.get('name')),
desc; desc;
if(this.get('admin')) { if(Discourse.User.currentProp("admin") || Discourse.User.currentProp("moderator")) {
desc = I18n.t('user.admin', {user: name}); if(this.get('admin')) {
return '<i class="fa fa-shield" title="' + desc + '" alt="' + desc + '"></i>'; desc = I18n.t('user.admin', {user: name});
return '<i class="fa fa-shield" title="' + desc + '" alt="' + desc + '"></i>';
}
} }
if(this.get('moderator')){ if(this.get('moderator')){
desc = I18n.t('user.moderator', {user: name}); desc = I18n.t('user.moderator', {user: name});