Ghost/ghost/admin/app/components/gh-user-active.js
Hannah Wolfe 3e61d07ac1 Merge pull request #6341 from kevinansfield/fix-mixed-content-on-team-page
Move user/cover image files used in admin team area into the client folder
2016-01-21 09:46:00 +00:00

32 lines
744 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.last_login', function () {
let lastLogin = this.get('user.last_login');
return lastLogin ? lastLogin.fromNow() : '(Never)';
})
});