FEATURE: use fancy title in notifications
This commit is contained in:
parent
31f27006e1
commit
be8dd403df
|
@ -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);
|
||||
},
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue