2017-03-21 11:26:25 +01:00
|
|
|
{% extends 'base.html' %}
|
|
|
|
{% block main %}
|
|
|
|
<div id="products">
|
|
|
|
{% for product in products %}
|
|
|
|
<button type="button"
|
|
|
|
onclick="addProduct({{ product.uid }})">
|
|
|
|
<span class="name">{{ product.name }}</span>
|
2017-03-25 21:47:42 +01:00
|
|
|
<span class="price">
|
|
|
|
€ {{ '{0:.02f}'.format(product.price / 100.0) }}
|
|
|
|
</span>
|
2017-03-21 11:26:25 +01:00
|
|
|
</button>
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
2017-03-25 21:47:42 +01:00
|
|
|
<div id="summary">
|
|
|
|
<div id="basket"></div>
|
|
|
|
<form id="sell" action="/sell" method="POST">
|
2017-03-21 11:26:25 +01:00
|
|
|
{% for product in products %}
|
2017-03-25 21:47:42 +01:00
|
|
|
<input type="hidden"
|
|
|
|
id="prod_{{ product.uid }}"
|
|
|
|
name="{{ product.uid }}"
|
|
|
|
data-name="{{ product.name }}"
|
|
|
|
data-price="{{ '{0:.02f}'.format(product.price / 100.0) }}"
|
|
|
|
value="0">
|
2017-03-21 11:26:25 +01:00
|
|
|
{% endfor %}
|
2017-03-25 21:47:42 +01:00
|
|
|
<p>Total: € <span id="total">0.00</span></p>
|
|
|
|
<button type="submit">Print</input>
|
2017-03-21 11:26:25 +01:00
|
|
|
</form>
|
|
|
|
|
2017-03-25 21:47:42 +01:00
|
|
|
</div>
|
2017-03-26 21:17:07 +02:00
|
|
|
<script type="text/javascript" src="{{ url_for('static', filename='js/sell.js') }}">
|
2017-03-21 11:26:25 +01:00
|
|
|
<script type="text/javascript">
|
2017-03-25 21:47:42 +01:00
|
|
|
{%- for product in products %}
|
2017-03-26 21:17:07 +02:00
|
|
|
document.getElementById('prod_{{ product.uid }}').value = 0
|
2017-03-25 21:47:42 +01:00
|
|
|
{%- endfor %}
|
2017-03-21 11:26:25 +01:00
|
|
|
</script>
|
|
|
|
{% endblock %}
|