From ce78cb1ee42bcffd398640122c9760c19258ff23 Mon Sep 17 00:00:00 2001 From: cpradio Date: Fri, 14 Nov 2014 19:30:05 -0500 Subject: [PATCH] FEATURE: Add category to Group Post Listing --- app/assets/javascripts/discourse/templates/group/index.hbs | 1 + app/assets/stylesheets/desktop/user.scss | 3 ++- app/assets/stylesheets/mobile/user.scss | 3 ++- app/serializers/group_post_serializer.rb | 7 ++++++- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/discourse/templates/group/index.hbs b/app/assets/javascripts/discourse/templates/group/index.hbs index cb270552e96..aee834721e6 100644 --- a/app/assets/javascripts/discourse/templates/group/index.hbs +++ b/app/assets/javascripts/discourse/templates/group/index.hbs @@ -7,6 +7,7 @@ {{unbound title}} + {{category-link category}} {{#if byName}} {{unbound byName}} diff --git a/app/assets/stylesheets/desktop/user.scss b/app/assets/stylesheets/desktop/user.scss index e6e4c9f0f0e..dc22e2845bf 100644 --- a/app/assets/stylesheets/desktop/user.scss +++ b/app/assets/stylesheets/desktop/user.scss @@ -452,12 +452,13 @@ text-overflow: ellipsis; } .name { - display: block; + display: inline-block; font-size: 14px; max-width: 400px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; + vertical-align: middle; } .edit-reason { background-color: scale-color($highlight, $lightness: 25%); diff --git a/app/assets/stylesheets/mobile/user.scss b/app/assets/stylesheets/mobile/user.scss index b75319cbcb3..f2a47cfabe8 100644 --- a/app/assets/stylesheets/mobile/user.scss +++ b/app/assets/stylesheets/mobile/user.scss @@ -459,12 +459,13 @@ text-overflow: ellipsis; } .name { - display: block; + display: inline-block; font-size: 14px; max-width: 400px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; + vertical-align: middle; } .edit-reason { background-color: scale-color($highlight, $lightness: 25%); diff --git a/app/serializers/group_post_serializer.rb b/app/serializers/group_post_serializer.rb index cd234234013..c9e37bdc07d 100644 --- a/app/serializers/group_post_serializer.rb +++ b/app/serializers/group_post_serializer.rb @@ -5,7 +5,8 @@ class GroupPostSerializer < ApplicationSerializer :title, :url, :user_title, - :user_long_name + :user_long_name, + :category has_one :user, serializer: BasicUserSerializer, embed: :objects @@ -24,5 +25,9 @@ class GroupPostSerializer < ApplicationSerializer def include_user_long_name? SiteSetting.enable_names? end + + def category + object.topic.category + end end