Choice widget expanded use the .inline_choice class & choice_with_other_widget display the label and the input on the same line

This commit is contained in:
Marc Ducobu
2015-12-08 11:40:16 +01:00
parent 4674369ce9
commit 0f632be80b
3 changed files with 52 additions and 31 deletions

View File

@@ -52,25 +52,42 @@
{% spaceless %}
<div {{ block('widget_container_attributes') }}>
{% for child in form %}
{{ form_widget(child) }}
{{ form_label(child, '', {'label_attr': { 'class' : 'inline'} }) }}
<span class="inline-choice">
{{ form_widget(child) }}
{{ form_label(child, '', {'label_attr': { 'class' : 'inline'} }) }}
</span>
{% endfor %}
</div>
{% endspaceless %}
{% endblock choice_widget_expanded %}
{% block choice_with_other_widget %}
{% spaceless %}
{% for child in form._choices %}
<div class="blop">
{{ form_widget(child) }}
{{ form_label(child, '', {'label_attr': { 'class' : 'inline'} }) }}
</div>
{%- if child.vars.value != '_other' -%}
<div class="inline-choice">
{{ form_widget(child) }}
{{ form_label(child, '', {'label_attr': { 'class' : 'inline'} }) }}
</div>
{%- else -%}
<div class="container">
<div class="grid-6 grid-tablet-12 gid-mobile-12 no-gutter">
<span class="inline-choice">
{{ form_widget(child) }}
{{ form_label(child, '', {'label_attr': { 'class' : 'inline'} }) }}
</span>
</div>
<div class="grid-6 grid-tablet-12 gid-mobile-12 no-gutter">
{{ form_widget(form._other, {'attr': {'class': 'input-text-other-value'} }) }}
</div>
</div>
{%- endif -%}
{% endfor %}
{{ form_widget(form._other, {'attr': {'class': 'input-text-other-value'} }) }}
{% endspaceless %}
{% endblock choice_with_other_widget %}
{% block date_widget %}
{% spaceless %}
{% if widget == 'single_text' %}