From 79d8a93267360466e5e507345ca1bec56b1425ba Mon Sep 17 00:00:00 2001 From: Feliciaan De Palmenaer Date: Fri, 5 Jun 2015 14:27:55 +0200 Subject: [PATCH] After closing, payment status can still be changed --- app/templates/order.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/templates/order.html b/app/templates/order.html index 3c98cfe..2effb54 100644 --- a/app/templates/order.html +++ b/app/templates/order.html @@ -1,7 +1,7 @@ {% extends "layout.html" %} {% set active_page = "orders" -%} {% set order_items = order.group_by_user() -%} -{% set courier_or_admin = order.can_close(current_user.id) -%} +{% set courier_or_admin = not current_user.is_anonymous() and (current_user.is_admin() or current_user.id == order.courrier_id) -%} {% import "utils.html" as util %} @@ -9,8 +9,9 @@

Order {{ order.id }} - {% if courier_or_admin -%} + {% if order.can_close(current_user.id) -%} Close
+ {% endif %}{% if courier_or_admin %} Edit {%- endif %}

courier: {{ order.courrier.username }} @@ -63,7 +64,7 @@ {{ item.product.name }} {{ item.product.price|euro }} {% if courier_or_admin %}{% if not item.paid %} Pay {% else %} {% endif %}{% endif %} - {% if item.can_delete(order.id, current_user.id, session.get('anon_name', '')) or courier_or_admin -%}{%- endif %}
+ {% if item.can_delete(order.id, current_user.id, session.get('anon_name', '')) -%}{%- endif %}
{%- endfor %}