From 933afd4fb7bfe6b4f9ac8e0db8188f783d90d0ab Mon Sep 17 00:00:00 2001 From: Skia Date: Wed, 19 Oct 2016 21:30:41 +0200 Subject: [PATCH] Update eboutic main template --- eboutic/templates/eboutic/eboutic_main.jinja | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/eboutic/templates/eboutic/eboutic_main.jinja b/eboutic/templates/eboutic/eboutic_main.jinja index cce2caf3..825435ce 100644 --- a/eboutic/templates/eboutic/eboutic_main.jinja +++ b/eboutic/templates/eboutic/eboutic_main.jinja @@ -4,11 +4,11 @@ {% trans %}Eboutic{% endtrans %} {% endblock %} -{% macro add_product(id, content) %} -
+{% macro add_product(id, content, class="") %} + {% csrf_token %} - +
{% endmacro %} @@ -42,7 +42,14 @@ {% if eboutic.products.filter(product_type=t).exists() %}
{{ t }}
{% for p in eboutic.products.filter(product_type=t).all() %} - {{ add_product(p.id, p.name) }} + {% set file = None %} + {% if p.icon %} + {% set file = p.icon.url %} + {% else %} + {% set file = static('core/img/na.gif') %} + {% endif %} + {% set prod = '%s
%s €' % (p.name, file, p.selling_price) %} + {{ add_product(p.id, prod, "form_button") }} {% endfor %} {% endif %} {% endfor %}