diff --git a/app/assets/javascripts/discourse/templates/components/group-post.hbs b/app/assets/javascripts/discourse/templates/components/group-post.hbs index 45a16422810..09ac259ce27 100644 --- a/app/assets/javascripts/discourse/templates/components/group-post.hbs +++ b/app/assets/javascripts/discourse/templates/components/group-post.hbs @@ -7,12 +7,12 @@ {{category-link post.category}}
- {{{unbound post.cooked}}} + {{{unbound post.excerpt}}}
diff --git a/app/serializers/basic_user_serializer.rb b/app/serializers/basic_user_serializer.rb index 8880c8dbd7e..6c46413dcd4 100644 --- a/app/serializers/basic_user_serializer.rb +++ b/app/serializers/basic_user_serializer.rb @@ -1,5 +1,5 @@ class BasicUserSerializer < ApplicationSerializer - attributes :id, :username, :avatar_template + attributes :id, :username, :avatar_template, :title, :name def include_name? SiteSetting.enable_names? diff --git a/app/serializers/group_post_serializer.rb b/app/serializers/group_post_serializer.rb index 77f1eb95b38..b6f36716131 100644 --- a/app/serializers/group_post_serializer.rb +++ b/app/serializers/group_post_serializer.rb @@ -1,42 +1,22 @@ class GroupPostSerializer < ApplicationSerializer attributes :id, - :cooked, + :excerpt, :created_at, :title, :url, - :user_title, - :user_long_name, - :topic, :category - has_one :user, serializer: BasicUserSerializer, embed: :objects + has_one :user, serializer: BasicUserSerializer, embed: :object + has_one :topic, serializer: BasicTopicSerializer, embed: :object def title object.topic.title end - def user_long_name - object.user.try(:name) - end - - def user_title - object.user.try(:title) - end - def include_user_long_name? SiteSetting.enable_names? end - def topic - object.topic - end - - def cooked - fragment = Nokogiri::HTML.fragment(object.cooked) - DiscourseEvent.trigger(:reduce_cooked, fragment, object) - fragment.to_html - end - def category object.topic.category end