From e5a8c606d4d57758ed838c347b1a306b6c35bc8e Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Mon, 26 May 2014 11:14:31 -0400 Subject: [PATCH] Add primary group class to the username too --- .../javascripts/discourse/components/poster-name.js.es6 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/discourse/components/poster-name.js.es6 b/app/assets/javascripts/discourse/components/poster-name.js.es6 index 4c5344ce523..382d5cdffe2 100644 --- a/app/assets/javascripts/discourse/components/poster-name.js.es6 +++ b/app/assets/javascripts/discourse/components/poster-name.js.es6 @@ -8,11 +8,15 @@ var PosterNameComponent = Em.Component.extend({ if (post) { var name = post.get('name'), username = post.get('username'), - linkClass = 'username'; + linkClass = 'username', + primaryGroupName = post.get('primary_group_name'); if (post.get('staff')) { linkClass += ' staff'; } if (post.get('new_user')) { linkClass += ' new-user'; } + if (!Em.isEmpty(primaryGroupName)) { + linkClass += ' ' + primaryGroupName; + } // Main link buffer.push("" + username + ""); @@ -31,7 +35,6 @@ var PosterNameComponent = Em.Component.extend({ // User titles var title = post.get('user_title'); if (!Em.isEmpty(title)) { - var primaryGroupName = post.get('primary_group_name'); buffer.push(''); if (Em.isEmpty(primaryGroupName)) {