Fix take ownership of organizations

Take ownership code got moved into its own directive in Oct, but we forgot we have a call in superuser panel for orgs as well. Fix this, and simplify the call sites
This commit is contained in:
Joseph Schorr 2017-03-22 12:25:20 -04:00
parent 789e35668c
commit 1d3af2b0bd
4 changed files with 32 additions and 12 deletions

View file

@ -86,7 +86,7 @@
<i class="fa" ng-class="current_user.enabled ? 'fa-circle-o' : 'fa-check-circle-o'"></i> <span
ng-if="current_user.enabled">Disable</span> <span ng-if="!current_user.enabled">Enable</span> User
</span>
<span class="cor-option" option-click="askTakeOwnership(current_user, false)"
<span class="cor-option" option-click="askTakeOwnership(current_user)"
ng-if="user.username != current_user.username && !current_user.super_user">
<i class="fa fa-bolt"></i> Take Ownership
</span>
@ -102,13 +102,9 @@
dialog-action="takeOwnership(info, callback)"
dialog-title="Take Ownership"
dialog-action-title="Take Ownership">
Are you sure you want to take ownership of
<span ng-if="takeOwnershipInfo.is_org">organization <span class="avatar" data="takeOwnershipInfo.entity.avatar"
size="16"></span> {{ takeOwnershipInfo.entity.name }}?</span>
<span ng-if="!takeOwnershipInfo.is_org">user namespace <span class="avatar" data="takeOwnershipInfo.entity.avatar"
Are you sure you want to take ownership of user namespace <span class="avatar" data="takeOwnershipInfo.entity.avatar"
size="16"></span> {{ takeOwnershipInfo .entity.username }}?</span>
<div class="co-alert co-alert-warning" ng-if="!takeOwnershipInfo.is_org">
<div class="co-alert co-alert-warning">
Note: This will convert the user namespace into an organization. <strong>The user will no longer be able to login
to
this account.</strong>