mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-30 11:54:33 +03:00
32 lines
747 B
JavaScript
32 lines
747 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.url').asset('/shared/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.last_login', function () {
|
|
let lastLogin = this.get('user.last_login');
|
|
|
|
return lastLogin ? lastLogin.fromNow() : '(Never)';
|
|
})
|
|
});
|