expressCart/views/user_edit.hbs

40 lines
1.8 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>Users name</label>
<input type="text" class="form-control" name="usersName" value="{{user.usersName}}" required>
</div>
<div class="form-group">
<label>User email</label>
<input type="text" class="form-control" name="userEmail" value="{{user.userEmail}}" readonly>
</div>
<div class="form-group">
<label>User password {{#ifCond session.user '==' user.userEmail}}*{{/ifCond}}</label>
<input type="password" class="form-control" name="userPassword" {{#ifCond session.user '==' user.userEmail}}required{{/ifCond}}>
</div>
<div class="form-group">
<label>Password confirm {{#ifCond session.user '==' user.userEmail}}*{{/ifCond}}</label>
<input 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}}>
</div>
{{#isAnAdmin session.isAdmin}}
{{#ifCond session.user '!=' user.userEmail}}
<div class="checkbox">
<label>
<input name="user_admin" {{#checkedState user.isAdmin}}{{/checkedState}} type="checkbox"> User is admin?
</label>
</div>
{{/ifCond}}
{{/isAnAdmin}}
<div class="form-group">
<div class="pull-right">
<button type="submit" class="btn btn-success">Update</button>
</div>
</div>
</div>
</div>
</div>