diff --git a/app/assets/javascripts/discourse/templates/post.js.handlebars b/app/assets/javascripts/discourse/templates/post.js.handlebars index 27ea9f941b2..0d7c9693bd5 100644 --- a/app/assets/javascripts/discourse/templates/post.js.handlebars +++ b/app/assets/javascripts/discourse/templates/post.js.handlebars @@ -36,17 +36,18 @@
-

{{{breakUp username name}}}

+ {{unbound username}}{{#if admin}}{{else}}{{#if moderator}}{{/if}}{{/if}} + {{#if showName}} -

{{breakUp name}}

+ {{unbound name}} {{/if}} {{#if user_title}} {{#if primary_group_name}} - + {{unbound user_title}} {{else}} -
{{unbound user_title}}
+ {{unbound user_title}} {{/if}} {{/if}}
diff --git a/app/assets/stylesheets/common/base/topic-post.scss b/app/assets/stylesheets/common/base/topic-post.scss new file mode 100644 index 00000000000..4498aa9d171 --- /dev/null +++ b/app/assets/stylesheets/common/base/topic-post.scss @@ -0,0 +1,21 @@ +.names { + float: left; + .username { + font-weight: bold; + } + span { + font-size: 13px; + padding-right: 4px; + a { + color: scale-color($primary, $lightness: 30%); + } + } + .fa { + font-size: 11px; + margin-left: 3px; + color: scale-color($primary, $lightness: 40%); + } + .new_user a, .user-title, .user-title a { + color: scale-color($primary, $lightness: 50%); + } +} diff --git a/app/assets/stylesheets/desktop/topic-post.scss b/app/assets/stylesheets/desktop/topic-post.scss index a0d6431d4d7..ccb5005a86c 100644 --- a/app/assets/stylesheets/desktop/topic-post.scss +++ b/app/assets/stylesheets/desktop/topic-post.scss @@ -632,19 +632,6 @@ iframe { font-size: 36px; } -.staff a { - margin: -2px 0 0 0; - background-color: scale-color($highlight, $lightness: 60%); -} - -.user-title { - margin-top: 5px; - color: $primary; - overflow: hidden; - font-size: 80%; - line-height: 13px; -} - .info-line { margin: 10px 0; color: $primary; @@ -993,17 +980,6 @@ a.attachment:before { content: "\f0e0"; } - - .names { - float: left; - .username { - a { - font-size: 13px; - color: scale-color($primary, $lightness: 20%); - } - } - } - .topic-meta-data { margin-bottom: 10px; diff --git a/app/serializers/post_serializer.rb b/app/serializers/post_serializer.rb index 452835ae048..09aade673b2 100644 --- a/app/serializers/post_serializer.rb +++ b/app/serializers/post_serializer.rb @@ -36,6 +36,7 @@ class PostSerializer < BasicPostSerializer :raw, :actions_summary, :moderator?, + :admin?, :staff?, :user_id, :draft_sequence, @@ -50,11 +51,15 @@ class PostSerializer < BasicPostSerializer def moderator? - object.user.try(:moderator?) || false + !!(object.user && object.user.moderator?) + end + + def admin? + !!(object.user && object.user.admin?) end def staff? - object.user.try(:staff?) || false + !!(object.user && object.user.staff?) end def yours