165 lines
4.8 KiB
HTML
165 lines
4.8 KiB
HTML
|
<vn-descriptor-content
|
||
|
module="account"
|
||
|
description="$ctrl.user.nickname">
|
||
|
<slot-menu>
|
||
|
<vn-item
|
||
|
ng-click="deleteUser.show()"
|
||
|
name="deleteUser"
|
||
|
vn-acl="developer"
|
||
|
translate>
|
||
|
Delete
|
||
|
</vn-item>
|
||
|
<vn-item
|
||
|
ng-click="$ctrl.onChangeRole()"
|
||
|
name="changeRole"
|
||
|
vn-acl="developer"
|
||
|
translate>
|
||
|
Change role
|
||
|
</vn-item>
|
||
|
<vn-item
|
||
|
ng-if="::$root.user.id == $ctrl.id"
|
||
|
ng-click="$ctrl.onChangePassClick(true)"
|
||
|
name="changePassword"
|
||
|
translate>
|
||
|
Change password
|
||
|
</vn-item>
|
||
|
<vn-item
|
||
|
ng-click="$ctrl.onChangePassClick(false)"
|
||
|
name="setPassword"
|
||
|
vn-acl="developer"
|
||
|
translate>
|
||
|
Set password
|
||
|
</vn-item>
|
||
|
<vn-item
|
||
|
ng-if="!$ctrl.hasAccount"
|
||
|
ng-click="enableAccount.show()"
|
||
|
name="enableAccount"
|
||
|
vn-acl="developer"
|
||
|
translate>
|
||
|
Enable account
|
||
|
</vn-item>
|
||
|
<vn-item
|
||
|
ng-if="$ctrl.hasAccount"
|
||
|
ng-click="disableAccount.show()"
|
||
|
name="disableAccount"
|
||
|
vn-acl="developer"
|
||
|
translate>
|
||
|
Disable account
|
||
|
</vn-item>
|
||
|
<vn-item
|
||
|
ng-if="!$ctrl.user.active"
|
||
|
ng-click="activateUser.show()"
|
||
|
name="activateUser"
|
||
|
vn-acl="developer"
|
||
|
translate>
|
||
|
Activate user
|
||
|
</vn-item>
|
||
|
<vn-item
|
||
|
ng-if="$ctrl.user.active"
|
||
|
ng-click="deactivateUser.show()"
|
||
|
name="deactivateUser"
|
||
|
vn-acl="developer"
|
||
|
translate>
|
||
|
Deactivate user
|
||
|
</vn-item>
|
||
|
</slot-menu>
|
||
|
<slot-body>
|
||
|
<div class="attributes">
|
||
|
<vn-label-value
|
||
|
label="User"
|
||
|
value="{{$ctrl.user.name}}">
|
||
|
</vn-label-value>
|
||
|
<vn-label-value
|
||
|
label="Role"
|
||
|
value="{{$ctrl.user.role.name}}">
|
||
|
</vn-label-value>
|
||
|
</div>
|
||
|
<div class="icons">
|
||
|
<vn-icon
|
||
|
vn-tooltip="User deactivated"
|
||
|
icon="icon-disabled"
|
||
|
ng-class="{bright: !$ctrl.user.active}">
|
||
|
</vn-icon>
|
||
|
<vn-icon
|
||
|
vn-tooltip="Account enabled"
|
||
|
icon="contact_mail"
|
||
|
ng-class="{bright: $ctrl.hasAccount}">
|
||
|
</vn-icon>
|
||
|
</div>
|
||
|
</slot-body>
|
||
|
</vn-descriptor-content>
|
||
|
<vn-confirm
|
||
|
vn-id="deleteUser"
|
||
|
on-accept="$ctrl.onDelete()"
|
||
|
question="Are you sure you want to continue?"
|
||
|
message="User will be removed">
|
||
|
</vn-confirm>
|
||
|
<vn-confirm
|
||
|
vn-id="enableAccount"
|
||
|
on-accept="$ctrl.onEnableAccount()"
|
||
|
question="Are you sure you want to continue?"
|
||
|
message="Account will be enabled">
|
||
|
</vn-confirm>
|
||
|
<vn-confirm
|
||
|
vn-id="disableAccount"
|
||
|
on-accept="$ctrl.onDisableAccount()"
|
||
|
question="Are you sure you want to continue?"
|
||
|
message="Account will be disabled">
|
||
|
</vn-confirm>
|
||
|
<vn-confirm
|
||
|
vn-id="activateUser"
|
||
|
on-accept="$ctrl.onSetActive(true)"
|
||
|
question="Are you sure you want to continue?"
|
||
|
message="User will activated">
|
||
|
</vn-confirm>
|
||
|
<vn-confirm
|
||
|
vn-id="deactivateUser"
|
||
|
on-accept="$ctrl.onSetActive(false)"
|
||
|
question="Are you sure you want to continue?"
|
||
|
message="User will be deactivated">
|
||
|
</vn-confirm>
|
||
|
<vn-dialog
|
||
|
vn-id="changeRole"
|
||
|
on-accept="$ctrl.onChangeRoleAccept()">
|
||
|
<tpl-body>
|
||
|
<vn-autocomplete
|
||
|
label="Role"
|
||
|
ng-model="$ctrl.newRole"
|
||
|
url="Roles"
|
||
|
vn-focus>
|
||
|
</vn-autocomplete>
|
||
|
</tpl-body>
|
||
|
<tpl-buttons>
|
||
|
<input type="button" response="cancel" translate-attr="{value: 'Cancel'}"/>
|
||
|
<button response="accept" translate>Accept</button>
|
||
|
</tpl-buttons>
|
||
|
</vn-dialog>
|
||
|
<vn-dialog
|
||
|
vn-id="changePass"
|
||
|
on-accept="$ctrl.onPassChange()"
|
||
|
on-close="$ctrl.onPassClose()">
|
||
|
<tpl-body>
|
||
|
<vn-textfield
|
||
|
ng-if="$ctrl.askOldPass"
|
||
|
label="Old password"
|
||
|
ng-model="$ctrl.oldPassword"
|
||
|
type="password">
|
||
|
</vn-textfield>
|
||
|
<vn-textfield
|
||
|
label="New password"
|
||
|
ng-model="$ctrl.newPassword"
|
||
|
type="password"
|
||
|
info="{{'Password requirements' | translate:$ctrl.passRequirements}}">
|
||
|
</vn-textfield>
|
||
|
<vn-textfield
|
||
|
label="Repeat password"
|
||
|
ng-model="$ctrl.repeatPassword"
|
||
|
type="password">
|
||
|
</vn-textfield>
|
||
|
</tpl-body>
|
||
|
<tpl-buttons>
|
||
|
<input type="button" response="cancel" translate-attr="{value: 'Cancel'}"/>
|
||
|
<button response="accept" translate>Change password</button>
|
||
|
</tpl-buttons>
|
||
|
</vn-dialog>
|