web_AI-5/django/didgeridoo/webshop/templates/webshop/cart.html

66 lines
2.1 KiB
HTML
Raw Normal View History

2018-02-04 18:32:54 +01:00
{% extends "webshop/base.html" %}
{% block section_title %}Cart{% endblock %}
2018-02-04 18:32:54 +01:00
{% block content %}
<h3>List of Items in your Shopping Cart:</h3>
{% if articles_list %}
<table class="table">
<tr class="table_header">
2018-02-11 18:19:21 +01:00
<th scope="col">POS.</th>
<th scope="col">ART#</th>
<th scope="col">NAME</th>
<th scope="col">STOCK</th>
2018-02-04 20:18:49 +01:00
<th scope="col">AMOUNT</th>
2018-02-11 18:19:21 +01:00
<th scope="col">PRICE p.pce.</th>
2018-02-11 22:37:27 +01:00
<th scope="col">POSITION PRICE</th>
</tr>
{% for article in articles_list %}
<tr class="table_content">
<td scope="col">{{ article.id }}</td>
2018-02-11 18:19:21 +01:00
<td scope="col">{{ article.article.id }}</td>
<td scope="col">
2018-02-11 18:19:21 +01:00
<a href="{% url 'details' article.article.id %}">
{{ article.article.name }}
2018-02-04 21:48:29 +01:00
</a>
</td>
<td scope="col">{{ article.article.stock }}</td>
2018-02-17 10:51:32 +01:00
<td scope="col">
<form id="amountfield" action="" method="POST" novalidate>
{{ CartForm }}
<input type="submit" value="change" />
{% csrf_token %}
</form>
<!-- {{ article.amount }} -->
</td>
2018-02-04 21:48:29 +01:00
<td scope="col">
{{ article.article.price_in_chf }}
{{ currency_name }}
</td>
<td scope="col">{{ article.position_price }} {{ currency_name }}</td>
</tr>
{% endfor %}
2018-02-04 21:48:29 +01:00
<tr>
2018-02-11 18:19:21 +01:00
<td scope="col" colspan="7" class="text-right">
Total: {{ total }} {{ currency_name }}
2018-02-04 21:48:29 +01:00
</td>
</tr>
</table>
2018-02-17 10:51:32 +01:00
<form id="checkout" method="post">
{% csrf_token %}
{{ checkout_form.as_p }}
<input type="submit" value="checkout ->" />
</form>
{% else %}
2018-02-17 10:51:32 +01:00
<p class="alert alert-danger">
<strong>
This cart seams to lack some Items.
Go get some in the store!
<strong>
</p>
{% endif %}
2018-02-17 10:51:32 +01:00
<p class="alert text-danger">
<strong>
{{ message }}
<strong>
</p>
2018-02-04 18:32:54 +01:00
{% endblock %}