Ghost/core/client/app/views/team/user.js
cobbspur f67147a685 Move users routes out of settings & change to team
issue #5434

- move users routes/views/controllers out of settings
- rename users team
- update nav-menu.hbs
- remove legacy routes
- fix up tests
2015-06-18 19:46:46 +01:00

33 lines
1.2 KiB
JavaScript

import Ember from 'ember';
var TeamUserView = Ember.View.extend({
tagName: 'section',
classNames: ['gh-view'],
currentUser: Ember.computed.alias('controller.session.user'),
isNotOwnProfile: Ember.computed('controller.user.id', 'currentUser.id', function () {
return this.get('controller.user.id') !== this.get('currentUser.id');
}),
isNotOwnersProfile: Ember.computed.not('controller.user.isOwner'),
canAssignRoles: Ember.computed.or('currentUser.isAdmin', 'currentUser.isOwner'),
canMakeOwner: Ember.computed.and('currentUser.isOwner', 'isNotOwnProfile', 'controller.user.isAdmin'),
rolesDropdownIsVisible: Ember.computed.and('isNotOwnProfile', 'canAssignRoles', 'isNotOwnersProfile'),
deleteUserActionIsVisible: Ember.computed('currentUser', 'canAssignRoles', 'controller.user', function () {
if ((this.get('canAssignRoles') && this.get('isNotOwnProfile') && !this.get('controller.user.isOwner')) ||
(this.get('currentUser.isEditor') && (this.get('isNotOwnProfile') ||
this.get('controller.user.isAuthor')))) {
return true;
}
}),
userActionsAreVisible: Ember.computed.or('deleteUserActionIsVisible', 'canMakeOwner')
});
export default TeamUserView;