salix/modules/client/front/web-access/index.html

88 lines
2.7 KiB
HTML

<vn-watcher
vn-id="watcher"
url="VnUsers"
id-field="id"
data="$ctrl.account"
form="form">
</vn-watcher>
<vn-crud-model
auto-load="true"
url="UserPasswords"
data="$ctrl.passRequirements">
</vn-crud-model>
<form name="form" ng-submit="$ctrl.onSubmit()" class="vn-w-md">
<vn-card class="vn-pa-lg">
<vn-horizontal>
<vn-check
vn-id="active"
disabled="watcher.orgData.name != $ctrl.account.name"
vn-one
label="Enable web access"
ng-model="$ctrl.account.active"
vn-acl="employee">
</vn-check>
</vn-horizontal>
<vn-horizontal>
<vn-textfield
vn-id="name"
disabled="watcher.orgData.active != $ctrl.account.active"
vn-focus
vn-one
label="User"
ng-model="$ctrl.account.name"
rule="VnUser.name">
</vn-textfield>
</vn-horizontal>
<vn-horizontal>
<vn-textfield
vn-id="email"
disabled="watcher.orgData.active != $ctrl.account.active"
vn-one
label="Recovery email"
ng-model="$ctrl.account.email"
info="This email is used for user to regain access their account."
rule="VnUser.name">
</vn-textfield>
</vn-horizontal>
</vn-card>
<vn-button-bar>
<vn-submit
disabled="!watcher.dataChanged()"
label="Save">
</vn-submit>
<vn-button
ng-if="$ctrl.canChangePassword"
label="Change password"
vn-dialog="change-pass">
</vn-button>
<vn-button
class="cancel"
label="Undo changes"
disabled="!watcher.dataChanged()"
ng-click="watcher.loadOriginalData()">
</vn-button>
</vn-button-bar>
</form>
<vn-dialog
vn-id="change-pass"
on-open="$ctrl.onPassOpen()"
on-accept="$ctrl.onPassChange()">
<tpl-body>
<vn-textfield
type="password"
label="New password"
info="{{'Password requirements' | translate:$ctrl.passRequirements[0]}}"
ng-model="$ctrl.newPassword">
</vn-textfield>
<vn-textfield
type="password"
label="Repeat password"
ng-model="$ctrl.repeatPassword">
</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>