mirror of
https://github.com/flarum/core.git
synced 2025-07-12 20:36:28 +02:00
Webpack (#1367)
* Replace gulp with webpack and npm scripts for JS compilation * Set up Travis CI to commit compiled JS * Restructure `js` directory; only one instance of npm, forum/admin are "submodules" * Refactor JS initializers into Application subclasses * Maintain partial compatibility API (importing from absolute paths) for extensions * Remove minification responsibility from PHP asset compiler * Restructure `less` directory
This commit is contained in:
19
js/src/common/models/Notification.js
Normal file
19
js/src/common/models/Notification.js
Normal file
@ -0,0 +1,19 @@
|
||||
import Model from '../Model';
|
||||
import computed from '../utils/computed';
|
||||
|
||||
export default class Notification extends Model {}
|
||||
|
||||
Object.assign(Notification.prototype, {
|
||||
contentType: Model.attribute('contentType'),
|
||||
subjectId: Model.attribute('subjectId'),
|
||||
content: Model.attribute('content'),
|
||||
time: Model.attribute('time', Model.date),
|
||||
|
||||
isRead: Model.attribute('isRead'),
|
||||
unreadCount: Model.attribute('unreadCount'),
|
||||
additionalUnreadCount: computed('unreadCount', unreadCount => Math.max(0, unreadCount - 1)),
|
||||
|
||||
user: Model.hasOne('user'),
|
||||
sender: Model.hasOne('sender'),
|
||||
subject: Model.hasOne('subject')
|
||||
});
|
Reference in New Issue
Block a user