Fix appending values to lists in templates

This commit is contained in:
Théophile Diot 2024-02-22 10:17:05 +01:00
parent 065d6a5025
commit 0ec7c6c5f8
No known key found for this signature in database
GPG key ID: 248FEA4BAE400D06
3 changed files with 7 additions and 7 deletions

View file

@ -5,10 +5,10 @@
{% set terms = [] %}
{% for ban in bans %}
{% if ban["reason"] not in reasons %}
{% set reasons = reasons.append(ban["reason"]) %}
{% if reasons.append(ban["reason"]) %}{% endif %}
{% endif %}
{% if ban["term"] not in terms %}
{% set terms = terms.append(ban["term"]) %}
{% if terms.append(ban["term"]) %}{% endif %}
{% endif %}
{% endfor %}
<!-- actions -->

View file

@ -6,16 +6,16 @@
{% set countries = [] %}
{% for report in reports %}
{% if report["method"] not in methods %}
{% set methods = methods.append(report["method"]) %}
{% if methods.append(report["method"]) %}{% endif %}
{% endif %}
{% if report["status"] not in codes %}
{% set codes = codes.append(report["status"]) %}
{% if codes.append(report["status"]) %}{% endif %}
{% endif %}
{% if report["reason"] not in reasons %}
{% set reasons = reasons.append(report["reason"]) %}
{% if reasons.append(report["reason"]) %}{% endif %}
{% endif %}
{% if report["country"] not in countries %}
{% set countries = countries.append(report["country"]) %}
{% if countries.append(report["country"]) %}{% endif %}
{% endif %}
{% endfor %}
<div class="{% if reports|length == 0 %}w-full overflow-hidden grid grid-cols-12 max-h-100 sm:max-h-125 col-span-12 p-4 relative break-words {% else %}hidden{% endif %} ">

View file

@ -226,7 +226,7 @@
{% if current_endpoint
== "global-config" and value['context'] == "global" and value['multiple'] and not value['multiple'] in multList or current_endpoint ==
"services" and value['context'] == "multisite" and value['multiple'] and not value['multiple'] in multList %}
{% set multList = multList.append(value['multiple']) %}
{% if multList.append(value['multiple']) %}{% endif %}
{% endif %}
{% endfor %}
{% for multiple in multList %}