mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-10-12 00:09:44 +00:00
rendering of custom fields refs #277 [ci skip]
This commit is contained in:
@@ -48,6 +48,7 @@ services:
|
||||
arguments:
|
||||
- "@request_stack"
|
||||
- %locale%
|
||||
- "@templating"
|
||||
tags:
|
||||
- { name: 'chill.custom_field', type: 'choice' }
|
||||
|
||||
|
19
Resources/views/CustomFieldsRendering/choice.html.twig
Normal file
19
Resources/views/CustomFieldsRendering/choice.html.twig
Normal file
@@ -0,0 +1,19 @@
|
||||
<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 }} :</span> {{ choice['name'] }}
|
||||
{%- endif -%}
|
||||
</li>
|
||||
{# {%- endif -%} #}
|
||||
{%- endfor -%}
|
||||
</ul>
|
Reference in New Issue
Block a user