mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: support for custom notification types
used by solved plugin
This commit is contained in:
parent
1459aab0a2
commit
37dfb1b4b5
@ -5,7 +5,15 @@ export default Ember.Component.extend({
|
|||||||
classNameBindings: ['notification.read', 'notification.is_warning'],
|
classNameBindings: ['notification.read', 'notification.is_warning'],
|
||||||
|
|
||||||
scope: function() {
|
scope: function() {
|
||||||
return "notifications." + this.site.get("notificationLookup")[this.get("notification.notification_type")];
|
var notificationType = this.get("notification.notification_type");
|
||||||
|
var lookup = this.site.get("notificationLookup");
|
||||||
|
var name = lookup[notificationType];
|
||||||
|
|
||||||
|
if (name === "custom") {
|
||||||
|
return this.get("notification.data.message");
|
||||||
|
} else {
|
||||||
|
return "notifications." + name;
|
||||||
|
}
|
||||||
}.property("notification.notification_type"),
|
}.property("notification.notification_type"),
|
||||||
|
|
||||||
url: function() {
|
url: function() {
|
||||||
|
@ -31,7 +31,7 @@ class Notification < ActiveRecord::Base
|
|||||||
@types ||= Enum.new(
|
@types ||= Enum.new(
|
||||||
:mentioned, :replied, :quoted, :edited, :liked, :private_message,
|
:mentioned, :replied, :quoted, :edited, :liked, :private_message,
|
||||||
:invited_to_private_message, :invitee_accepted, :posted, :moved_post,
|
:invited_to_private_message, :invitee_accepted, :posted, :moved_post,
|
||||||
:linked, :granted_badge, :invited_to_topic
|
:linked, :granted_badge, :invited_to_topic, :custom
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user