Ghost/ghost/admin/app/components/gh-user-active.js
Kevin P. Kucharczyk c4371a36f2 Standardise client property names to camelCase
closes #6018
- added keyForAttribute method in application serializer
- override keyForAttribute in settings serializer to not apply camelCase/underscore conversion
- rename under_scored properties to camelCased
2016-01-23 19:12:22 +01:00

32 lines
742 B
JavaScript

import Ember from 'ember';
const {
Component,
computed,
inject: {service}
} = Ember;
export default Component.extend({
tagName: '',
user: null,
ghostPaths: service(),
userDefault: computed('ghostPaths', function () {
return `${this.get('ghostPaths.subdir')}/ghost/img/user-image.png`;
}),
userImageBackground: computed('user.image', 'userDefault', function () {
let url = this.get('user.image') || this.get('userDefault');
return Ember.String.htmlSafe(`background-image: url(${url})`);
}),
lastLogin: computed('user.lastLogin', function () {
let lastLogin = this.get('user.lastLogin');
return lastLogin ? lastLogin.fromNow() : '(Never)';
})
});