handle types and categories in a single select input

This commit is contained in:
2021-10-12 15:52:06 +02:00
parent 9eec15873e
commit 88d073b9a9
10 changed files with 323 additions and 78 deletions

View File

@@ -14,8 +14,7 @@
{{ form_row(form.profession) }}
{% endif %}
{{ form_row(form.types) }}
{{ form_row(form.categories) }}
{{ form_row(form.typesAndCategories) }}
{{ form_row(form.telephone) }}
{{ form_row(form.email) }}

View File

@@ -48,13 +48,20 @@
</dd>
{% endif %}
<dt>{{ 'Type'|trans }}</dt>
<dt>{{ 'thirdparty.Categories'|trans }}</dt>
{% set types = [] %}
{% for t in thirdParty.types %}
{% set types = types|merge( [ ('chill_3party.key_label.'~t)|trans ] ) %}
{% endfor %}
{% for c in thirdParty.categories %}
{% set types = types|merge([ c.name|localize_translatable_string ]) %}
{% endfor %}
<dd>
{{ types|join(', ') }}
{% if types|length > 0 %}
{{ types|join(', ') }}
{% else %}
<p class="chill-no-data-statement">{{ 'thirdParty.Any categories' }}</p>
{% endif %}
</dd>
<dt>{{ 'Phonenumber'|trans }}</dt>