diff --git a/app/assets/javascripts/discourse/templates/components/latest-topic-list-item.hbs b/app/assets/javascripts/discourse/templates/components/latest-topic-list-item.hbs index 8a64a53e8..a4d228365 100644 --- a/app/assets/javascripts/discourse/templates/components/latest-topic-list-item.hbs +++ b/app/assets/javascripts/discourse/templates/components/latest-topic-list-item.hbs @@ -2,9 +2,9 @@ - {{#with topic.creator as |op|}} - {{#user-link user=op}} - {{avatar op imageSize="large"}} + {{#with topic.lastPoster as |lastPoster|}} + {{#user-link user=lastPoster}} + {{avatar lastPoster imageSize="large"}} {{/user-link}} {{/with}} diff --git a/app/serializers/category_and_topic_lists_serializer.rb b/app/serializers/category_and_topic_lists_serializer.rb index 1e81bad84..239bc0798 100644 --- a/app/serializers/category_and_topic_lists_serializer.rb +++ b/app/serializers/category_and_topic_lists_serializer.rb @@ -1,4 +1,16 @@ class CategoryAndTopicListsSerializer < ApplicationSerializer has_one :category_list, serializer: CategoryListSerializer, embed: :objects has_one :topic_list, serializer: TopicListSerializer, embed: :objects + has_many :users, serializer: BasicUserSerializer, embed: :objects + + def users + users = object.topic_list.topics.map do |t| + t.posters.map{|poster| poster.try(:user)} + end + users.flatten! + users.compact! + users.uniq!(&:id) + users + end + end