expressCart/views/user_edit.hbs

49 lines
2.4 KiB
Handlebars
Raw Normal View History

2018-02-12 05:47:26 +10:00
{{> partials/menu}}
2018-01-07 04:55:48 +10:00
<div class="col-lg-9">
<div class="row">
<div class="col-md-8">
<h2>User edit</h2>
<form method="post" id="edit_form" action="/admin/user/update" data-toggle="validator">
<input type="hidden" name="userId" value="{{user._id}}" />
<div class="form-group">
<label>{{ @root.__ "Users name" }}</label>
2018-01-07 04:55:48 +10:00
<input type="text" class="form-control" name="usersName" value="{{user.usersName}}" required>
</div>
<div class="form-group">
<label>{{ @root.__ "User email" }}</label>
2018-01-07 04:55:48 +10:00
<input type="text" class="form-control" name="userEmail" value="{{user.userEmail}}" readonly>
</div>
<div class="form-group">
<label>{{ @root.__ "User password" }} {{#ifCond session.user '==' user.userEmail}}*{{/ifCond}}</label>
2019-11-07 16:36:20 +10:00
<input autocomplete="off" type="password" class="form-control" name="userPassword" {{#ifCond session.user '==' user.userEmail}}required{{/ifCond}}>
2018-01-07 04:55:48 +10:00
</div>
<div class="form-group">
<label>{{ @root.__ "Password confirm" }} {{#ifCond session.user '==' user.userEmail}}*{{/ifCond}}</label>
2019-11-07 16:36:20 +10:00
<input autocomplete="off" type="password" data-validation-match-match="userPassword" data-validation-match-message="Password values to not match" class="form-control" name="frm_userPassword_confirm" {{#ifCond session.user '==' user.userEmail}}required{{/ifCond}}>
2018-01-07 04:55:48 +10:00
</div>
2019-11-07 16:36:20 +10:00
{{#isAnAdmin @root.session.isAdmin}}
{{#ifCond @root.session.user '!=' user.userEmail}}
2018-01-07 04:55:48 +10:00
<div class="checkbox">
<label>
2019-11-07 16:36:20 +10:00
<input name="user_admin" {{#checkedState @root.user.isAdmin}}{{/checkedState}} type="checkbox"> {{ @root.__ "User is admin?" }}
2018-01-07 04:55:48 +10:00
</label>
</div>
{{/ifCond}}
{{/isAnAdmin}}
2019-06-15 10:54:41 +10:00
<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-btn">
<button id="btnGenerateAPIkey" class="btn btn-success">{{ @root.__ "Generate" }}</button>
2019-06-15 10:54:41 +10:00
</div>
</div>
</div><br/>
2018-01-07 04:55:48 +10:00
<div class="form-group">
<div class="pull-right">
<button type="submit" class="btn btn-success">{{ @root.__ "Update" }}</button>
2018-01-07 04:55:48 +10:00
</div>
</div>
</div>
</div>
</div>