bornhack-website/shop/templates/shop_index.html
2016-05-13 09:01:52 +02:00

74 lines
2 KiB
HTML

{% extends 'base.html' %}
{% load bootstrap3 %}
{% block content %}
<h2>Shop</h2>
<p class="lead">
Here you can see your orders and available products in the shop.
</p>
<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 %}
<tr {% if order.finalized and order.paid %}style="color: lightgreen"{% endif %}>
<td>{{ order.id }}</td>
<td>{{ order.finalized }}</td>
<td>{{ order.paid }}</td>
<td>?</td>
<td>
{% if order.finalized and not order.paid %}
{% 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" %}
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
<h3>Products</h3>
<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 %}
{% url 'shop:product_detail' pk=product.id as product_detail_url %}
{% bootstrap_button "Add to order" href=product_detail_url button_class="btn-primary" %}
{% else %}
N/A
{% endif %}
</td>
</tr>
</tbody>
{% endfor %}
</table>
{% endblock %}