Our custom ordering system
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.
 
 
 
 
 
 

60 lines
2.1 KiB

{% macro icon(name) -%}
{% include 'ordr3:templates/icons/%s.svg' % name %}
{%- endmacro %}
{% macro alerts() -%}
<div class="o3-alerts fixed-bottom">
{% for channel in ("info", "warning") %}
{% for message in request.session.pop_flash(channel) %}
<div class="alert alert-{{channel}} alert-dismissible fade show" role="alert">
<p class="small">{{message[0]}}</p>
{% if message[1] %}
<p class="small">{{message[1]|safe}}</p>
{% endif %}
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
{% endfor %}
{% endfor %}
</div>
{%- endmacro %}
{% macro status_label(status) -%}
{% if status.name == "OPEN" %}
<span class="badge badge-danger">open</span>
{% elif status.name == "APPROVAL" %}
<span class="badge badge-primary">approval</span>
{% elif status.name == "ORDERED" %}
<span class="badge badge-warning">ordered</span>
{% elif status.name == "COMPLETED" %}
<span class="badge badge-success">completed</span>
{% elif status.name == "HOLD" %}
<span class="badge badge-secondary">hold</span>
{% endif %}
{%- endmacro %}
{% macro change_log(order) -%}
<p class="font-weight-bold mt-4 mb-2">Status Change Log</p>
<table class="table table-hover table-borderless o3-log-table">
<thead>
<tr>
<th scope="col">Date</th>
<th scope="col">Status</th>
<th scope="col">By</th>
</tr>
</thead>
<tbody>
{% for entry in context.model.log %}
<tr>
<td>{{ entry.date|as_datetime }}</td>
<td>{{ status_label(entry.status) }}</td>
<td>{{ entry.by }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{%- endmacro %}