For loops don't work in this template engine

This commit is contained in:
Midgard 2022-05-02 22:04:45 +02:00
parent a568103a60
commit cf27a7de8a
Signed by: midgard
GPG key ID: 511C112F1331BBB4

View file

@ -277,14 +277,8 @@
<tr> <tr>
<td> <td>
{% set paid = order_items | map(attribute="paid") | all %} {% set paid = order_items | map(attribute="paid") | all %}
{% set can_modify_payment = True %}
{% for order_item in order_items %}
{% if not order_item.can_modify_payment(order.id, current_user.id) %}
{% set can_modify_payment = False %}
{% endif %}
{% endfor %}
<input type="checkbox" name="user_names" value="{{ user_name }}" <input type="checkbox" name="user_names" value="{{ user_name }}"
{{ "disabled" if not can_modify_payment }}> {{ "disabled" if not order.can_modify_payment(current_user.id) }}>
<span class="price" style="{{ 'opacity: 0.5' if paid }}"> <span class="price" style="{{ 'opacity: 0.5' if paid }}">
{{ order_items | map(attribute="price") | sum | euro }} {{ order_items | map(attribute="price") | sum | euro }}