2019-04-13 18:24:53 +02:00
|
|
|
{% extends 'bootstrap_4_horizontal_layout.html.twig' %}
|
|
|
|
|
|
|
|
{% block file_widget -%}
|
|
|
|
{%- set type = type|default('file') -%}
|
|
|
|
{{- block('form_widget_simple') -}}
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
|
2019-04-13 18:28:41 +02:00
|
|
|
{% block form_label_class -%}
|
|
|
|
col-3
|
|
|
|
{%- endblock form_label_class %}
|
|
|
|
|
|
|
|
{% block form_group_class -%}
|
|
|
|
col-9
|
2019-08-13 23:04:06 +02:00
|
|
|
{%- endblock form_group_class %}
|
|
|
|
|
|
|
|
{%- block choice_widget_options -%}
|
|
|
|
{% for group_label, choice in options %}
|
|
|
|
{%- if choice is iterable -%}
|
|
|
|
<optgroup label="{{ choice_translation_domain is same as(false) ? group_label : group_label|trans({}, choice_translation_domain) }}">
|
|
|
|
{% set options = choice %}
|
|
|
|
{{- block('choice_widget_options') -}}
|
|
|
|
</optgroup>
|
|
|
|
{%- else -%}
|
|
|
|
{% if use_html_in_labels is defined and use_html_in_labels %}
|
|
|
|
<option value="{{ choice.value }}"{% if choice.attr %}{% with { attr: choice.attr } %}{{ block('attributes') }}{% endwith %}{% endif %}{% if choice is selectedchoice(value) %} selected="selected"{% endif %}>{{ choice_translation_domain is same as(false) ? choice.label|raw : choice.label|trans({}, choice_translation_domain)|raw }}</option>
|
|
|
|
{% else %}
|
|
|
|
<option value="{{ choice.value }}"{% if choice.attr %}{% with { attr: choice.attr } %}{{ block('attributes') }}{% endwith %}{% endif %}{% if choice is selectedchoice(value) %} selected="selected"{% endif %}>{{ choice_translation_domain is same as(false) ? choice.label : choice.label|trans({}, choice_translation_domain) }}</option>
|
|
|
|
{% endif %}
|
|
|
|
{%- endif -%}
|
|
|
|
{% endfor %}
|
2019-08-24 12:55:47 +02:00
|
|
|
{%- endblock choice_widget_options -%}
|
|
|
|
|
|
|
|
{% block si_unit_widget %}
|
2019-08-31 13:08:02 +02:00
|
|
|
<div class="input-group {% if sm %}input-group-sm{% endif %}">
|
2019-08-24 12:55:47 +02:00
|
|
|
{{ form_widget(form.value) }}
|
2019-08-31 13:08:02 +02:00
|
|
|
<div class="input-group-append {% if sm %}input-group-sm{% endif %}">
|
2019-08-24 12:55:47 +02:00
|
|
|
{% if form.prefix is defined %}
|
2019-08-31 13:08:02 +02:00
|
|
|
{{ form_widget(form.prefix, {'attr': {'class': 'custom-select'}}) }}
|
2019-08-24 12:55:47 +02:00
|
|
|
{% endif %}
|
|
|
|
{% if unit is not empty %}
|
|
|
|
<label class="input-group-text">{{ unit }}</label>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
</div>
|
2019-08-25 13:14:30 +02:00
|
|
|
{{ form_errors(form.value) }}
|
2019-08-24 12:55:47 +02:00
|
|
|
{% endblock %}
|