mirror of
https://github.com/flarum/framework.git
synced 2025-05-23 15:19:56 +08:00

- Extract shared Ember components into a “flarum-common” ember-cli addon. This can be used by both the forum + admin Ember apps, keeping things DRY - Move LESS styles into their own top-level directory and do a similar thing (extract common styles) - Add LESS/JS compilation and versioning to PHP (AssetManager) - Set up admin entry point (Theoretical) upgrade instructions: - Delete everything in [app_root]/public - Set up tooling in forum/admin Ember apps (npm install/update, bower install/update) and then build them (ember build) - php artisan vendor:publish - Upgrade flarum/flarum repo (slight change in a config file) - If you need to trigger a LESS/JS recompile, delete the .css/.js files in [app_root]/public/flarum. I set up LiveReload to do this for me when I change files in less/ or ember/ Todo: - Start writing admin app! - Remove bootstrap/font-awesome from repo and instead depend on their composer packages? Maybe? (Bower is not an option here)
37 lines
978 B
JavaScript
37 lines
978 B
JavaScript
import DS from 'ember-data';
|
|
|
|
import HasItemLists from '../mixins/has-item-lists';
|
|
import stringToColor from '../utils/string-to-color';
|
|
|
|
export default DS.Model.extend(HasItemLists, {
|
|
itemLists: ['badges'],
|
|
|
|
username: DS.attr('string'),
|
|
email: DS.attr('string'),
|
|
password: DS.attr('string'),
|
|
avatarUrl: DS.attr('string'),
|
|
bio: DS.attr('string'),
|
|
bioHtml: DS.attr('string'),
|
|
preferences: DS.attr(),
|
|
|
|
groups: DS.hasMany('group'),
|
|
|
|
joinTime: DS.attr('date'),
|
|
lastSeenTime: DS.attr('date'),
|
|
online: Ember.computed('lastSeenTime', function() {
|
|
return this.get('lastSeenTime') > moment().subtract(5, 'minutes').toDate();
|
|
}),
|
|
readTime: DS.attr('date'),
|
|
unreadNotificationsCount: DS.attr('number'),
|
|
|
|
discussionsCount: DS.attr('number'),
|
|
commentsCount: DS.attr('number'),
|
|
|
|
canEdit: DS.attr('boolean'),
|
|
canDelete: DS.attr('boolean'),
|
|
|
|
color: Ember.computed('username', function() {
|
|
return '#'+stringToColor(this.get('username'));
|
|
})
|
|
});
|