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;
|
const badgeName = data.badge_name;
|
||||||
if (badgeName) { return escapeExpression(badgeName); }
|
if (badgeName) { return escapeExpression(badgeName); }
|
||||||
|
|
||||||
|
if (this.attrs.fancy_title) {
|
||||||
|
return this.attrs.fancy_title;
|
||||||
|
}
|
||||||
|
|
||||||
const title = data.topic_title;
|
const title = data.topic_title;
|
||||||
return Ember.isEmpty(title) ? "" : escapeExpression(title);
|
return Ember.isEmpty(title) ? "" : escapeExpression(title);
|
||||||
},
|
},
|
||||||
|
|
|
@ -6,6 +6,7 @@ class NotificationSerializer < ApplicationSerializer
|
||||||
:created_at,
|
:created_at,
|
||||||
:post_number,
|
:post_number,
|
||||||
:topic_id,
|
:topic_id,
|
||||||
|
:fancy_title,
|
||||||
:slug,
|
:slug,
|
||||||
:data,
|
:data,
|
||||||
:is_warning
|
:is_warning
|
||||||
|
@ -18,6 +19,14 @@ class NotificationSerializer < ApplicationSerializer
|
||||||
object.topic.present? && object.topic.subtype == TopicSubtype.moderator_warning
|
object.topic.present? && object.topic.subtype == TopicSubtype.moderator_warning
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def include_fancy_title?
|
||||||
|
object.topic&.fancy_title
|
||||||
|
end
|
||||||
|
|
||||||
|
def fancy_title
|
||||||
|
object.topic.fancy_title
|
||||||
|
end
|
||||||
|
|
||||||
def include_is_warning?
|
def include_is_warning?
|
||||||
is_warning
|
is_warning
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue