19 lines
871 B
Twig

<ul class="custom_fields choice">
{%- for choice in choices -%}
{% if choice['slug'] in selected %}{%- set is_selected = true -%}{%- else -%}{%- set is_selected = false -%}{%- endif -%}
{# {%- if choice['slug'] in selected -%} #}
<li class="{% if true %} selected {% endif %}">
{%- if multiple -%}
<input type="checkbox" {% if is_selected %}checked{% endif %} />
{%- else -%}
<input type="radio" {% if is_selected %}checked{% endif %} />
{%- endif -%}
{%- if choice['slug'] is not same as('_other') -%}
{{ choice['name'][app.request.locale]|default(choice['name'][locale]|default('Not available in your language'|trans)) }}
{%- else -%}
<span class="other">{{ 'Other value'|trans }}&nbsp;:</span> {{ choice['name'] }}
{%- endif -%}
</li>
{# {%- endif -%} #}
{%- endfor -%}
</ul>