mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-30 11:54:33 +03:00
d90ed28940
closes TryGhost/Ghost#6985 - renames all date properties to end with `UTC`: - `publishedAt` in `post` model - `createdAt` in `post`, `role`, `subscriber`, `tag` and `user` model - `updatedAt` in `post`, `role`, `subscriber`, `tag` and `user` model - `unsubscribedAt` in `subscriber` model - `lastLogin` in `user` model - adds `attrs` transforms in matching serializers `post`, `tag` and `user` - new serializers files for `subscribers` and `role` to add `attr` transforms - adds unit tests for all serializers - use two variables in `post-settings-menu` controller to handle blog-timezone adjusted date as well as UTC date
33 lines
779 B
JavaScript
33 lines
779 B
JavaScript
import Ember from 'ember';
|
|
|
|
const {
|
|
Component,
|
|
computed,
|
|
inject: {service},
|
|
String: {htmlSafe}
|
|
} = 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 htmlSafe(`background-image: url(${url})`);
|
|
}),
|
|
|
|
lastLoginUTC: computed('user.lastLoginUTC', function () {
|
|
let lastLoginUTC = this.get('user.lastLoginUTC');
|
|
|
|
return lastLoginUTC ? moment(lastLoginUTC).fromNow() : '(Never)';
|
|
})
|
|
});
|