code postaux en code de départements (5 chiffres à 2) + changement du get le nid dans la liste étape à droite

This commit is contained in:
Valentin
2024-10-11 16:33:41 +02:00
parent 5106413b4d
commit 8b922fe40a
6 changed files with 38 additions and 20 deletions

View File

@@ -20,4 +20,12 @@
* @ingroup themeable
*/
#}
<p>{{- output -}}</p>
{% if output|length == 5
and output|replace(
{'0':'', '1':'', '2':'', '3':'', '4':'', '5':'', '6':'', '7':'', '8':'', '9':''}
) == ''
%}
<p>{{- output|slice(0, 2) -}}</p>
{% else %}
<p>{{- output -}}</p>
{% endif %}

View File

@@ -24,9 +24,20 @@
{% if output %}
{% set separated_contents = output|split('\n') %}
{% for content in separated_contents %}
{% if content != '' %}
<div class="separated-content">{{ content|trim }}</div>
{% if (content|trim ends with ')') %}
{% if content != '' %}
<div class="separated-content">
{{ content|trim|slice(0, -12) }}
<span>{{ content|trim|slice(-7, content|trim|length - 1)|slice(0, -4) }})</span></a>
</div>
{% endif %}
{% else %}
{% if content != '' %}
<div class="separated-content">{{ content|trim }}</div>
{% endif %}
{% endif %}
{% endfor %}
{% endif %}
</div