haldis/app/templates/order.html

38 lines
1.7 KiB
HTML
Raw Normal View History

{% extends "layout.html" %}
{% set active_page = "orders" -%}
2015-03-28 00:44:58 +01:00
{% import "bootstrap/wtf.html" as wtf %}
{% block container %}
<div class="row">
2015-03-28 00:44:58 +01:00
<div class="col-md-7"><!-- Shitty html-->
2015-03-28 10:49:28 +01:00
<h3>Order {{ order.id }}
2015-03-28 21:12:02 +01:00
{% if order.can_close(current_user.id) -%}
2015-03-28 02:01:30 +01:00
<a class="btn btn-danger" href="{{ url_for('.close_order', id=order.id) }}">Close</a><br/>
2015-03-28 10:49:28 +01:00
{%- endif %}</h3>
2015-03-28 01:09:59 +01:00
Courrier: {{ order.courrier.username }}
2015-03-28 20:38:15 +01:00
{% if order.courrier == None and not current_user.is_anonymous() %}
2015-03-28 01:09:59 +01:00
<a href="{{ url_for('.volunteer', id=order.id) }}" class="btn btn-primary">Volunteer</a>
{% endif %}
<br/>
Location: <a href="{{ order.location.website }}">{{ order.location.name }}</a><br/>
Starttime: {{ order.starttime }}<br/>
Stoptime: {{ order.stoptime }}<br/>
2015-03-28 00:44:58 +01:00
Total price: {{ total_price|euro }}
<h3>Orders</h3>
{% for item in order.items %}
2015-03-28 20:38:15 +01:00
{{ item.get_name() }} - {{ item.product.name }} - {{ item.product.price|euro }}
{% if item.can_delete(order.id, current_user.id, session.get('anon_name', '')) -%}<a href="{{ url_for('.delete_item', order_id=order.id, item_id=item.id) }}"><span class="glyphicon glyphicon-remove"></span></a>{%- endif %}<br/>
{% endfor %}
2015-03-28 01:31:04 +01:00
<h3>Debts</h3>
{% for key, value in total_payments.items() %}
2015-03-28 20:38:15 +01:00
{{ key }} - {{ value|euro }}<br/>
2015-03-28 01:31:04 +01:00
{% endfor %}
</div>
2015-03-28 21:12:02 +01:00
{% if form -%}
2015-03-28 00:44:58 +01:00
<div class="col-md-push-1 col-md-4">
<h4>Order:</h4>
2015-03-28 01:09:59 +01:00
{{ wtf.quick_form(form, action=url_for('.order_item_create', id=order.id), button_map={'submit_button': 'primary'}, form_type='horizontal') }}
2015-03-28 00:44:58 +01:00
</div>
2015-03-28 21:12:02 +01:00
{%- endif %}
</div>
{% endblock %}