bootstrap styles in forms fields

This commit is contained in:
2021-03-23 09:41:11 +01:00
parent b327a3fbfa
commit 50727fc4b0
6 changed files with 74 additions and 48 deletions

View File

@@ -19,33 +19,35 @@
{% block form_row %}
{% apply spaceless %}
{% if form.vars.hideLabel is not defined or form.vars.hideLabel == false %}
<div class="container-fluid">
<div class="{% apply spaceless %}
{% if attr.class is defined and ('cf-title' in attr.class or 'cf-fields' in attr.class ) %}
grid-12
{% elseif attr.class is defined and 'multiple-cf-inline' in attr.class %}
grid-2 grid-mobile-4 grid-tablet-4 mobile-clear tablet-clear
{% else %}
grid-4 clear
<div class="container-fluid mb-2">
<div class="row">
<div class="{% apply spaceless %}
{% if attr.class is defined and ('cf-title' in attr.class or 'cf-fields' in attr.class ) %}
col-12
{% elseif attr.class is defined and 'multiple-cf-inline' in attr.class %}
col-2 col-mobile-4 col-tablet-4 mobile-clear tablet-clear
{% else %}
col-4 clear
{% endif %}
{% endapply %}">
{% if attr.class is not defined or ('cf-title' not in attr.class and 'cf-fields' not in attr.class ) %}
{{ form_label(form) }}
{% endif %}
{% endapply %}">
{% if attr.class is not defined or ('cf-title' not in attr.class and 'cf-fields' not in attr.class ) %}
{{ form_label(form) }}
{% endif %}
</div>
<div class="{% apply spaceless %}
{% if attr.class is defined and 'cf-title' in attr.class %}
grid-12
{% elseif attr.class is defined and 'cf-fields' in attr.class %}
grid-12 parent
{% elseif attr.class is defined and 'multiple-cf-inline' in attr.class %}
grid-2 grid-mobile-8 grid-tablet-8 multiple-cf-inline
{% else %}
grid-8
{% endif %}
{% endapply %}">
{{ form_widget(form) }}
{{ form_errors(form) }}
</div>
<div class="{% apply spaceless %}
{% if attr.class is defined and 'cf-title' in attr.class %}
col-12
{% elseif attr.class is defined and 'cf-fields' in attr.class %}
col-12 parent
{% elseif attr.class is defined and 'multiple-cf-inline' in attr.class %}
col-2 col-mobile-8 col-tablet-8 multiple-cf-inline
{% else %}
col-8
{% endif %}
{% endapply %}">
{{ form_widget(form) }}
{{ form_errors(form) }}
</div>
</div>
</div>
{% else %}
@@ -62,7 +64,6 @@
{{ form_widget(child) }}
{{ form_label(child, '', {'label_attr': { 'class' : 'inline'} }) }}
</span>
<br/>
{% endfor %}
</div>
<script type="text/javascript">
@@ -84,16 +85,17 @@
</div>
{%- else -%}
<div class="container-fluid">
<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 class="row">
<div class="col-6 col-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="col-6 col-tablet-12 gid-mobile-12 no-gutter">
{{ form_widget(form._other, {'attr': {'class': 'input-text-other-value'} }) }}
</div>
</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 %}