FEATURE: use fancy title in notifications

This commit is contained in:
Sam 2017-05-15 15:38:21 -04:00
parent 31f27006e1
commit be8dd403df
2 changed files with 13 additions and 0 deletions

View File

@ -59,6 +59,10 @@ createWidget('notification-item', {
const badgeName = data.badge_name;
if (badgeName) { return escapeExpression(badgeName); }
if (this.attrs.fancy_title) {
return this.attrs.fancy_title;
}
const title = data.topic_title;
return Ember.isEmpty(title) ? "" : escapeExpression(title);
},

View File

@ -6,6 +6,7 @@ class NotificationSerializer < ApplicationSerializer
:created_at,
:post_number,
:topic_id,
:fancy_title,
:slug,
:data,
:is_warning
@ -18,6 +19,14 @@ class NotificationSerializer < ApplicationSerializer
object.topic.present? && object.topic.subtype == TopicSubtype.moderator_warning
end
def include_fancy_title?
object.topic&.fancy_title
end
def fancy_title
object.topic.fancy_title
end
def include_is_warning?
is_warning
end