expressCart/views/users.hbs

30 lines
1.3 KiB
Handlebars

{{> partials/menu}}
<div class="col-lg-9">
<div class="row">
<div class="col-md-8">
<h2>Users <span class="pull-right"><a href="/admin/user/new" class="btn btn-success btn-sm">{{ @root.__ "New user" }}</a></span></h2>
<ul class="list-group">
{{#each users}}
<li class="list-group-item">
<strong>{{ @root.__ "User" }}:</strong> {{this.usersName}} - ({{this.userEmail}})
<span class="pull-right">
<strong>{{ @root.__ "Role" }}: </strong>
{{#isAnAdmin this.isAdmin}}
<span>Admin</span>
{{#if ../this.isOwner}}
(Owner)
{{/if}}
{{else}}
<span>{{ @root.__ "User" }}</span>
{{/isAnAdmin}}
{{#isAnAdmin ../session.isAdmin}}
<a href="/admin/user/edit/{{../this._id}}"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></a>
<a href="/admin/user/delete/{{../this._id}}" onclick="return confirm('Are you sure you want to delete?')"><span class="glyphicon glyphicon-trash" aria-hidden="true"></a>
{{/isAnAdmin}}
</span>
</li>
{{/each}}
</ul>
</div>
</div>
</div>