Holger Frey
7 years ago
4 changed files with 162 additions and 2 deletions
@ -0,0 +1,90 @@ |
|||||||
|
{% extends "ordr2:templates/layout.jinja2" %} |
||||||
|
{% import 'ordr2:templates/macros.jinja2' as macros with context %} |
||||||
|
|
||||||
|
{% block subtitle %} Admin | Users {% endblock subtitle %} |
||||||
|
|
||||||
|
{% block content %} |
||||||
|
<div class="content controls"> |
||||||
|
<div class="container-fluid controls"> |
||||||
|
|
||||||
|
<div class="row-fluid"> |
||||||
|
<div class="span2"> |
||||||
|
<div class="page-controls"> |
||||||
|
<h1> |
||||||
|
Users |
||||||
|
</h1> |
||||||
|
</div> |
||||||
|
{{ macros.filter_box('Role', 'role', roles) }} |
||||||
|
</div> |
||||||
|
|
||||||
|
<div class="span10"> |
||||||
|
<form action="{{ request.resource_url(context, 'actions') }}" method="POST"> |
||||||
|
<input type="hidden" name="csrf_token" value="{{get_csrf_token()}}"> |
||||||
|
<div class="page-controls"> |
||||||
|
<div class="input-append search"> |
||||||
|
<input type="search" name="search" size="30" placeholder="Search"> |
||||||
|
<label class="add-on"> |
||||||
|
<button type="submit" class="search" name="action" value="search">Search</button> |
||||||
|
</label> |
||||||
|
</div> |
||||||
|
<div class="actions"> |
||||||
|
<div class="btn-group marking-needed"> |
||||||
|
<button rel="tooltip" data-original-title="Change Role" class="btn-flat group" name="action" type="submit" value="role"><i class="group"></i></button> |
||||||
|
<button rel="tooltip" data-original-title="Delete" class="btn-flat delete" name="action" type="submit" value="delete"><i class="trash"></i></button> |
||||||
|
</div> |
||||||
|
<a href="#modal-display" rel="tooltip" data-original-title="Display Options" class="btn-flat single" data-toggle="modal"><i class="eye"></i></a> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
|
||||||
|
{{ macros.flash_messages() }} |
||||||
|
|
||||||
|
{% if users %} |
||||||
|
|
||||||
|
<table class="table"> |
||||||
|
<thead> |
||||||
|
<th class="center"> |
||||||
|
<input type="checkbox" value="all" name="mark_all" id="mark_all"> |
||||||
|
</th> |
||||||
|
{{ macros.sortable_table_header('Username', 'user') }} |
||||||
|
{{ macros.sortable_table_header('First Name', 'first') }} |
||||||
|
{{ macros.sortable_table_header('Last Name', 'last') }} |
||||||
|
{{ macros.sortable_table_header('Email', 'email') }} |
||||||
|
{{ macros.sortable_table_header('Role', 'role') }} |
||||||
|
<th>Actions</th> |
||||||
|
</thead> |
||||||
|
|
||||||
|
<tbody> |
||||||
|
{% for user in users %} |
||||||
|
<tr> |
||||||
|
<td class="center"> |
||||||
|
<input type="checkbox" name="marked" value="{{ user.model.user_name }}"> |
||||||
|
</td> |
||||||
|
<td> |
||||||
|
<a href="{{ request.resource_url(request.root, 'orders', query={'user': user.model.user_name}) }}" title="click to view all orders from user">{{ user.model.user_name }}</a> |
||||||
|
</td> |
||||||
|
<td>{{ user.model.first_name }} </td> |
||||||
|
<td>{{ user.model.last_name }} </td> |
||||||
|
<td>{{ user.model.email }} </td> |
||||||
|
<td>{{ user.model.role.value.capitalize() }} </td> |
||||||
|
<td> |
||||||
|
<a href="{{ request.resource_url(user, 'edit') }}" class="action edit" title="Edit User">edit</a> |
||||||
|
<a href="{{ request.resource_url(user, 'delete') }}" class="action delete" title="Delete User">delete</a> |
||||||
|
</td> |
||||||
|
</tr> |
||||||
|
{% endfor %} |
||||||
|
</tbody> |
||||||
|
</table> |
||||||
|
|
||||||
|
{{ macros.pagination() }} |
||||||
|
{% else %} |
||||||
|
<div class="alert alert-block alert-error"> |
||||||
|
<h4 class="alert-heading">Oh snap! Nothing to display!</h4> |
||||||
|
<p>Your query didn't return any data.</p> |
||||||
|
</div> |
||||||
|
{% endif %} |
||||||
|
</form> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
{% endblock content %} |
Reference in new issue