UX: show emoji in topic title on groups page

This commit is contained in:
Arpit Jalan 2016-03-11 13:36:31 +05:30
parent 89b1998174
commit eb6a17f587
3 changed files with 7 additions and 2 deletions

View File

@ -130,6 +130,7 @@ const Group = Discourse.Model.extend({
return Discourse.ajax(`/groups/${this.get('name')}/${type}.json`, { data: data }).then(posts => {
return posts.map(p => {
p.user = Discourse.User.create(p.user);
p.topic = Discourse.Topic.create(p.topic);
return Em.Object.create(p);
});
});

View File

@ -3,7 +3,7 @@
<a href="{{unbound post.user.userUrl}}" data-user-card="{{unbound post.user.username}}" class='avatar-link'><div class='avatar-wrapper'>{{avatar post.user imageSize="large" extraClasses="actor" ignoreTitle="true"}}</div></a>
<span class='time'>{{format-date post.created_at leaveAgo="true"}}</span>
<span class="title">
<a href="{{unbound post.url}}">{{unbound post.title}}</a>
{{topic-link post.topic}}
</span>
<span class="category">{{category-link post.category}}</span>
<div class="group-member-info">

View File

@ -6,6 +6,7 @@ class GroupPostSerializer < ApplicationSerializer
:url,
:user_title,
:user_long_name,
:topic,
:category
has_one :user, serializer: BasicUserSerializer, embed: :objects
@ -26,8 +27,11 @@ class GroupPostSerializer < ApplicationSerializer
SiteSetting.enable_names?
end
def topic
object.topic
end
def category
object.topic.category
end
end