{% 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>
        <span class="price">
            € {{ '{0:.02f}'.format(product.price / 100.0) }}
        </span>
    </button>
{% endfor %}
</div>
<div id="summary">
    <div id="basket"></div>
    <form id="sell" action="/sell"  method="POST">
{% for product in products %}
        <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">
{% endfor %}
        <p>Total: € <span id="total">0.00</span></p>
        <button type="submit">Print</input>
</form>

</div>
<script type="text/javascript" src="{{ url_for('static', filename='js/sell.js') }}">
<script type="text/javascript">
{%- for product in products %}
document.getElementById('prod_{{ product.uid }}').value = 0
{%- endfor %}
</script>
{% endblock %}