Skip to content

Commit

Permalink
Fix setting style on subform.
Browse files Browse the repository at this point in the history
Finally fix #161
  • Loading branch information
Florian Eckerstorfer committed Dec 28, 2013
1 parent 2575df0 commit 1706e42
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
7 changes: 7 additions & 0 deletions Resources/less/form.less
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@
}
}

.form-inline {
.form-group + .form-group {
margin-left: 0;
margin-right: 0;
}
}

.form-horizontal {
.col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg12 {
.col-1, .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-10, .col-11, .col-12,
Expand Down
9 changes: 8 additions & 1 deletion Resources/views/Form/bootstrap.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -825,6 +825,9 @@
{% if attr.simple_col is defined %}
{% set childAttr = childAttr|merge({ 'simple_col': attr.simple_col }) %}
{% endif %}
{% if attr.style is defined %}
{% set childAttr = childAttr|merge({ 'style': attr.style }) %}
{% endif %}
{{ form_row(child, childAttr) }}
{% endfor %}
{% endspaceless %}
Expand All @@ -839,8 +842,12 @@

{% block widget_container_attributes %}
{% spaceless %}
{% if attr.style == 'inline' or attr.style == 'horizontal' %}
{% set attr = attr|merge({ 'class': 'form-'~attr.style~attr.class|default('') }) %}
{% set attr = attr|merge({ 'style': null }) %}
{% endif %}
{% if id is not empty %}id="{{ id }}" {% endif %}
{% for attrname, attrvalue in attr %}{{ attrname }}="{{ attrvalue }}" {% endfor %}
{% for attrname, attrvalue in attr %}{% if attrvalue is not null %}{{ attrname }}="{{ attrvalue }}" {% endif %}{% endfor %}
{% endspaceless %}
{% endblock widget_container_attributes %}

Expand Down

0 comments on commit 1706e42

Please sign in to comment.