From 9e0cf55758ad3cfe2d440adc8a3ace70a16e7ede Mon Sep 17 00:00:00 2001 From: Arpit Jalan Date: Fri, 13 Jun 2014 02:42:26 +0530 Subject: [PATCH] Add tooltip to Admin & Moderator glyph --- .../discourse/components/poster-name.js.es6 | 14 +++++++++----- config/locales/client.en.yml | 2 ++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/discourse/components/poster-name.js.es6 b/app/assets/javascripts/discourse/components/poster-name.js.es6 index 382d5cdffe2..6e80d1cfe7b 100644 --- a/app/assets/javascripts/discourse/components/poster-name.js.es6 +++ b/app/assets/javascripts/discourse/components/poster-name.js.es6 @@ -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(""); + buffer.push(glyph); } buffer.push(""); @@ -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 ''; + } else if(post.get('moderator')) { + desc = I18n.t('user.moderator_tooltip'); + return ''; } } }); diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index 5d852205496..3a615cd1422 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -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: "