You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
190 lines
11 KiB
190 lines
11 KiB
{% extends "ordr2:templates/layout.jinja2" %} |
|
{% import 'ordr2:templates/macros.jinja2' as macros with context %} |
|
|
|
{% block subtitle %} Orders {% 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('All Orders', 'status', stati, {'user': None} ) }} |
|
{{ macros.filter_box('My Orders', 'status', stati, {'user': request.user.user_name} ) }} |
|
</div> |
|
|
|
<div class="span10"> |
|
<form action="{{ request.resource_url(context, 'actions', query=context.query_params()) }}" 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"> |
|
{% if request.has_permission('create', context) %} |
|
<a href="{{ request.resource_url(context, 'splash') }}" rel="tooltip" data-original-title="New" class="btn-flat single"><i class="add"></i></a> |
|
{% endif %} |
|
{% if request.has_permission('edit', context) or request.has_permission('delete', context) %} |
|
<div class="btn-group marking-needed"> |
|
{% if request.has_permission('edit', context) %} |
|
<button rel="tooltip" data-original-title="Change Status" value="status" type="submit" name="action" class="btn-flat"><i class="clip"></i></button> |
|
{% endif %} |
|
{% if request.has_permission('delete', context) %} |
|
<button rel="tooltip" data-original-title="Delete" value="delete" type="submit" name="action" class="btn-flat"><i class="trash"></i></button> |
|
{% endif %} |
|
</div> |
|
{% endif %} |
|
|
|
<a href="#modal-display" rel="tooltip" data-original-title="Display Options" class="btn-flat single" data-toggle="modal"><i class="eye"></i></a> |
|
|
|
<button rel="tooltip" data-original-title="Download View" value="export" type="submit" name="action" class="btn-flat"><i class="download"></i></button> |
|
</div> |
|
</div> |
|
|
|
{{ macros.flash_messages() }} |
|
|
|
{% if orders %} |
|
{{ macros.show_or_hide_columns('orders') }} |
|
|
|
<table class="table"> |
|
<thead> |
|
<th class="center"> |
|
<input type="checkbox" value="all" name="mark_all" id="mark_all"> |
|
</th> |
|
{{ macros.sortable_table_header('Date Created', 'created') }} |
|
{{ macros.sortable_table_header('CAS / Description', 'cas') }} |
|
{{ macros.sortable_table_header('Vendor', 'vendor') }} |
|
{{ macros.sortable_table_header('Catalog Nr.', 'catalog') }} |
|
{{ macros.sortable_table_header('Unit Price', 'price') }} |
|
{{ macros.sortable_table_header('Quantity', 'amount') }} |
|
{{ macros.sortable_table_header('Total Price', 'total') }} |
|
{{ macros.sortable_table_header('Account', 'account') }} |
|
{{ macros.sortable_table_header('Category', 'category') }} |
|
{{ macros.sortable_table_header('Status', 'status') }} |
|
{{ macros.sortable_table_header('Ordered By', 'user') }} |
|
<th>Actions</th> |
|
</thead> |
|
|
|
<tbody> |
|
{% for order in orders %} |
|
<tr> |
|
<td class="center"> |
|
<input type="checkbox" name="marked" value="{{ order.model.id }}"> |
|
</td> |
|
<td class="column-created">{{ order.model.created_date }}</td> |
|
<td class="column-cas">{{ order.model.cas_description }}</td> |
|
<td class="column-vendor">{{ order.model.vendor }}</td> |
|
<td class="column-catalog">{{ order.model.catalog_nr }}</td> |
|
<td class="column-price">{{ '%.2f'|format(order.model.unit_price) }} {{ order.model.currency }}</td> |
|
<td class="column-amount">{{ order.model.amount }}</td> |
|
<td class="column-total">{{ '%.2f'|format(order.model.total_price) }} {{ order.model.currency }}</td> |
|
<td class="column-account">{{ order.model.account }}</td> |
|
<td class="column-category">{{ order.model.category.value|capitalize }}</td> |
|
<td class="column-status">{{ macros.colored_status(order.model.status) }}</td> |
|
<td class="column-user"> |
|
<a href="{{ request.resource_url(context, query={'user': order.model.created_by}) }}" title="click to view all orders from user">{{ order.model.created_by }}</a> |
|
</td> |
|
<td> |
|
{% if request.has_permission('edit', order) %} |
|
<a href="{{ request.resource_url(order, 'edit') }}" class="action edit" title="Edit Order">edit</a> |
|
{% else %} |
|
<a href="{{ request.resource_url(order) }}" class="action eye" title="View Order">edit</a> |
|
{% endif %} |
|
{% if request.has_permission('delete', order) %} |
|
<a href="{{ request.resource_url(order, 'delete') }}" class="action delete" title="Delete Order">delete</a> |
|
{% endif %} |
|
</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 id="modal-display" class="modal hide fade"> |
|
<form action="{{ request.resource_url(context, 'changeview', query=context.query_params()) }}" method="POST" class="checkslist"> |
|
<input type="hidden" name="csrf_token" value="{{get_csrf_token()}}"> |
|
{% set display = request.session.get('display', dict()) %} |
|
{% set settings = display.get('orders', dict()) %} |
|
<div class="modal-header"> |
|
<a href="#" class="close" data-dismiss="modal">×</a> |
|
<h3>Display Options</h3> |
|
</div> |
|
<div class="modal-body"> |
|
<p class="help-block"><span class="label notice">Notice</span> If the displayed information is too cluttered, deselect some fields below. This will temporaly remove them from your view and should help you stay on top of things.</p> |
|
<div class="checklist"> |
|
<fieldset class="left"> |
|
<label class="checkbox"> |
|
<input type="checkbox" value="created" name="display" checked="checked" disabled="disabled"> |
|
Date Created |
|
</label> |
|
<label class="checkbox"> |
|
<input type="checkbox" value="cas" name="display" {{ 'checked="checked"' if settings.get('cas') }}> |
|
CAS / Description |
|
</label> |
|
<label class="checkbox"> |
|
<input type="checkbox" value="vendor" name="display" {{ 'checked="checked"' if settings.get('vendor') }}> |
|
Vendor |
|
</label> |
|
<label class="checkbox"> |
|
<input type="checkbox" value="catalog" name="display" {{ 'checked="checked"' if settings.get('catalog') }}> |
|
Catalog Number |
|
</label> |
|
<label class="checkbox"> |
|
<input type="checkbox" value="price" name="display" {{ 'checked="checked"' if settings.get('price') }}> |
|
Unit Price |
|
</label> |
|
<label class="checkbox"> |
|
<input type="checkbox" value="amount" name="display" {{ 'checked="checked"' if settings.get('amount') }}> |
|
Quantity |
|
</label> |
|
</fieldset> |
|
<fieldset class="right"> |
|
<label class="checkbox"> |
|
<input type="checkbox" value="total" name="display" {{ 'checked="checked"' if settings.get('total') }}> |
|
Total Price |
|
</label> |
|
<label class="checkbox"> |
|
<input type="checkbox" value="account" name="display" {{ 'checked="checked"' if settings.get('account') }}> |
|
Account |
|
</label> |
|
<label class="checkbox"> |
|
<input type="checkbox" value="category" name="display" checked="checked" disabled="disabled"> |
|
Category |
|
</label> |
|
<label class="checkbox"> |
|
<input type="checkbox" value="status" name="display" checked="checked" disabled="disabled"> |
|
Work Status |
|
</label> |
|
<label class="checkbox"> |
|
<input type="checkbox" value="user" name="display" checked="checked" disabled="disabled"> |
|
Ordered by |
|
</label> |
|
</fieldset> |
|
</div> |
|
</div> |
|
<div class="modal-footer"> |
|
<button class="btn btn-primary" type="submit">Apply Changes</button> |
|
<a data-dismiss="modal" class="btn" href="#">Close</a> |
|
</div> |
|
</form> |
|
</div> |
|
</div> |
|
{% endblock content %}
|
|
|