Skip to content

Commit

Permalink
FEATURE: suppress admin glyph for admins
Browse files Browse the repository at this point in the history
If you want to a shield you must grant moderation to the admin.
  • Loading branch information
SamSaffron committed Sep 11, 2014
1 parent 70eb7b8 commit 5cb7c8e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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>';
}
Expand Down
8 changes: 5 additions & 3 deletions app/assets/javascripts/discourse/models/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,11 @@ Discourse.User = Discourse.Model.extend({
var name = Handlebars.Utils.escapeExpression(this.get('name')),
desc;

if(this.get('admin')) {
desc = I18n.t('user.admin', {user: name});
return '<i class="fa fa-shield" title="' + desc + '" alt="' + desc + '"></i>';
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});
Expand Down

0 comments on commit 5cb7c8e

Please sign in to comment.