mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-15 03:12:54 +03:00
33 lines
1.0 KiB
JavaScript
33 lines
1.0 KiB
JavaScript
import Ember from 'ember';
|
|
var ApplicationController = Ember.Controller.extend({
|
|
// jscs: disable
|
|
signedOut: Ember.computed.match('currentPath', /(signin|signup|setup|forgotten|reset)/),
|
|
// jscs: enable
|
|
|
|
topNotificationCount: 0,
|
|
showGlobalMobileNav: false,
|
|
showSettingsMenu: false,
|
|
|
|
userImage: Ember.computed('session.user.image', function () {
|
|
return this.get('session.user.image') || this.get('ghostPaths.url').asset('/shared/img/user-image.png');
|
|
}),
|
|
|
|
userImageBackground: Ember.computed('userImage', function () {
|
|
return `background-image: url(${this.get('userImage')})`.htmlSafe();
|
|
}),
|
|
|
|
userImageAlt: Ember.computed('session.user.name', function () {
|
|
var name = this.get('session.user.name');
|
|
|
|
return (name) ? name + '\'s profile picture' : 'Profile picture';
|
|
}),
|
|
|
|
actions: {
|
|
topNotificationChange: function (count) {
|
|
this.set('topNotificationCount', count);
|
|
}
|
|
}
|
|
});
|
|
|
|
export default ApplicationController;
|