1
0
mirror of https://github.com/flarum/core.git synced 2025-08-06 16:36:47 +02:00

Implement notifications

This commit is contained in:
Toby Zerner
2015-03-24 15:07:38 +10:30
parent 1d1025dcd2
commit 4a1550215c
34 changed files with 808 additions and 38 deletions

View File

@@ -0,0 +1,21 @@
import DS from 'ember-data';
export default DS.Model.extend({
contentType: DS.attr('string'),
subjectId: DS.attr('number'),
content: DS.attr(),
time: DS.attr('date'),
isRead: DS.attr('boolean'),
unreadCount: DS.attr('number'),
additionalUnreadCount: Ember.computed('unreadCount', function() {
return Math.max(0, this.get('unreadCount') - 1);
}),
decodedContent: Ember.computed('content', function() {
return JSON.parse(this.get('content'));
}),
user: DS.belongsTo('user'),
sender: DS.belongsTo('user'),
subject: DS.belongsTo('subject', {polymorphic: true})
});