mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
Merge pull request #3474 from felixrieseberg/iss3400
User Settings: Display cog based on rights
This commit is contained in:
commit
a6c205ac53
3 changed files with 26 additions and 9 deletions
|
@ -12,13 +12,15 @@
|
|||
|
||||
<section class="page-actions">
|
||||
|
||||
{{#gh-popover-button popoverName="user-actions-menu" tagName="a" classNames="button only-has-icon user-actions-cog" title="User Actions"}}
|
||||
<i class="icon-settings"></i>
|
||||
<span class="hidden">User Settings</span>
|
||||
{{/gh-popover-button}}
|
||||
{{#gh-popover name="user-actions-menu" classNames="user-actions-menu menu-drop-right"}}
|
||||
{{render "user-actions-menu" model}}
|
||||
{{/gh-popover}}
|
||||
{{#if view.userActionsAreVisible}}
|
||||
{{#gh-popover-button popoverName="user-actions-menu" tagName="a" classNames="button only-has-icon user-actions-cog" title="User Actions"}}
|
||||
<i class="icon-settings"></i>
|
||||
<span class="hidden">User Settings</span>
|
||||
{{/gh-popover-button}}
|
||||
{{#gh-popover name="user-actions-menu" classNames="user-actions-menu menu-drop-right"}}
|
||||
{{render "user-actions-menu"}}
|
||||
{{/gh-popover}}
|
||||
{{/if}}
|
||||
|
||||
<button class="button-save" {{action "save"}}>Save</button>
|
||||
</section>
|
||||
|
|
|
@ -1,2 +1,6 @@
|
|||
{{#if view.parentView.rolesDropdownIsVisible}}
|
||||
<a href="javascript:void(0);" {{action "openModal" "transfer-owner" this}}>Make Owner</a>
|
||||
<a href="javascript:void(0);" class="delete">Delete User</a>
|
||||
{{/if}}
|
||||
{{#if view.parentView.deleteUserActionIsVisible}}
|
||||
<a href="javascript:void(0);" class="delete">Delete User</a>
|
||||
{{/if}}
|
|
@ -7,7 +7,18 @@ var SettingsUserView = Ember.View.extend({
|
|||
|
||||
canAssignRoles: Ember.computed.or('currentUser.isAdmin', 'currentUser.isOwner'),
|
||||
|
||||
rolesDropdownIsVisible: Ember.computed.and('isNotOwnProfile', 'canAssignRoles')
|
||||
rolesDropdownIsVisible: Ember.computed.and('isNotOwnProfile', 'canAssignRoles'),
|
||||
|
||||
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', 'rolesDropdownIsVisible')
|
||||
|
||||
});
|
||||
|
||||
export default SettingsUserView;
|
Loading…
Add table
Reference in a new issue