expressCart/views/user_edit.hbs

50 lines
2.2 KiB
Handlebars
Raw Normal View History

2018-02-12 05:47:26 +10:00
{{> partials/menu}}
<div class="col-sm-9">
2018-01-07 04:55:48 +10:00
<div class="row">
<div class="col-md-8">
<h2>User edit</h2>
<form id="userEditForm" data-toggle="validator">
<input type="hidden" id="userId" value="{{user._id}}" />
<div class="form-group">
<label>{{ @root.__ "Users name" }}</label>
<input type="text" class="form-control" id="usersName" value="{{user.usersName}}" required>
</div>
<div class="form-group">
<label>{{ @root.__ "User email" }}</label>
<input type="text" class="form-control" id="userEmail" value="{{user.userEmail}}" readonly>
</div>
<div class="form-group">
<label>{{ @root.__ "User password" }} {{#ifCond session.user '==' user.userEmail}}*{{/ifCond}}</label>
<input autocomplete="off" type="password" class="form-control" id="userPassword" {{#ifCond session.user '==' user.userEmail}}required{{/ifCond}}>
</div>
<div class="form-group">
<label>{{ @root.__ "Password confirm" }} {{#ifCond session.user '==' user.userEmail}}*{{/ifCond}}</label>
<input autocomplete="off" type="password" data-validation-match-match="userPassword" data-validation-match-message="Password values to not match" class="form-control" {{#ifCond session.user '==' user.userEmail}}required{{/ifCond}}>
</div>
{{#isAnAdmin @root.session.isAdmin}}
{{#ifCond @root.session.user '!=' user.userEmail}}
<div class="checkbox">
<label>
<input id="userAdmin" {{#checkedState @root.user.isAdmin}}{{/checkedState}} type="checkbox"> {{ @root.__ "User is admin?" }}
</label>
</div>
{{/ifCond}}
{{/isAnAdmin}}
<div class="form-group">
<label>API Key</label>
<div class="input-group">
<input type="text" class="form-control" id="apiKey" value="{{user.apiKey}}" aria-label="..." readonly>
<div class="input-group-append">
<button id="btnGenerateAPIkey" class="btn btn-outline-success">{{ @root.__ "Generate" }}</button>
</div>
</div>
</div><br/>
<div class="form-group">
<div class="pull-right">
<button type="submit" class="btn btn-outline-success">{{ @root.__ "Update" }}</button>
2019-06-15 10:54:41 +10:00
</div>
</div>
</form>
2018-01-07 04:55:48 +10:00
</div>
</div>
</div>