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) {
var desc;
if(post.get('admin')) {
desc = I18n.t('user.admin_tooltip');
return '<i class="fa fa-shield" title="' + desc + '" alt="' + desc + '"></i>';
} else if(post.get('moderator')) {
if(post.get('moderator')) {
desc = I18n.t('user.moderator_tooltip');
return '<i class="fa fa-shield" title="' + desc + '" alt="' + desc + '"></i>';
}

View File

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