2016-05-12 17:08:54 +00:00
|
|
|
{% extends 'base.html' %}
|
2016-05-13 06:52:07 +00:00
|
|
|
{% load bootstrap3 %}
|
2016-05-12 17:08:54 +00:00
|
|
|
{% block content %}
|
|
|
|
|
|
|
|
<h2>Shop</h2>
|
|
|
|
|
|
|
|
<p class="lead">
|
2016-05-13 06:36:56 +00:00
|
|
|
Here you can see your orders and available products in the shop.
|
2016-05-12 17:08:54 +00:00
|
|
|
</p>
|
2016-05-13 06:36:56 +00:00
|
|
|
<h3>Orders</h3>
|
|
|
|
<table class="table table-bordered table-hover">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>Order ID</th>
|
|
|
|
<th>Open?</th>
|
|
|
|
<th>Paid?</th>
|
|
|
|
<th>Delivered?</th>
|
|
|
|
<th>Actions</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
{% for order in orders %}
|
2016-05-13 07:01:52 +00:00
|
|
|
<tr {% if order.finalized and order.paid %}style="color: lightgreen"{% endif %}>
|
2016-05-13 06:36:56 +00:00
|
|
|
<td>{{ order.id }}</td>
|
|
|
|
<td>{{ order.finalized }}</td>
|
|
|
|
<td>{{ order.paid }}</td>
|
|
|
|
<td>?</td>
|
|
|
|
<td>
|
|
|
|
{% if order.finalized and not order.paid %}
|
2016-05-13 07:01:52 +00:00
|
|
|
{% url 'shop:order_detail' pk=order.id as order_detail_url %}
|
|
|
|
{% url 'shop:order_cancel' pk=order.id as order_cancel_url %}
|
|
|
|
{% bootstrap_button "Pay order" href=order_detail_url button_class="btn-primary" %}
|
|
|
|
{% bootstrap_button "Cancel order" href=order_cancel_url button_class="btn-primary" %}
|
2016-05-13 06:36:56 +00:00
|
|
|
{% endif %}
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
2016-05-12 17:08:54 +00:00
|
|
|
|
2016-05-13 06:36:56 +00:00
|
|
|
<h3>Products</h3>
|
2016-05-12 17:08:54 +00:00
|
|
|
<table class="table table-bordered table-hover">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>Description</th>
|
|
|
|
<th>Price</th>
|
|
|
|
<th>Availability</th>
|
|
|
|
<th>Buy</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
{% for product in product_list %}
|
|
|
|
<tr {% if not product.is_available %}style="color: lightgrey"{%endif%}>
|
|
|
|
<td>{{ product.name }}</td>
|
|
|
|
<td>{{ product.price }} DKK</td>
|
|
|
|
<td>{{ product.available_in.lower }}
|
|
|
|
{% if product.available_in.upper %}
|
|
|
|
- {{ product.available_in.upper }}
|
|
|
|
{% endif %}
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
{% if product.is_available %}
|
2016-05-14 14:24:03 +00:00
|
|
|
{% url 'shop:product_detail' pk=product.pk as product_detail_url %}
|
2016-05-13 07:01:52 +00:00
|
|
|
{% bootstrap_button "Add to order" href=product_detail_url button_class="btn-primary" %}
|
2016-05-12 17:08:54 +00:00
|
|
|
{% else %}
|
|
|
|
N/A
|
|
|
|
{% endif %}
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
{% endfor %}
|
|
|
|
</table>
|
|
|
|
{% endblock %}
|