Skip to content

Commit

Permalink
Fix not aligned checkbox and radio on horizontal form (#3962)
Browse files Browse the repository at this point in the history
With Twitter Bootstrap, checkbox and radio inputs need a col-sm-offset-* class to get aligned with the other inputs.
  • Loading branch information
soullivaneuh committed Jun 17, 2016
1 parent be82d59 commit 80db991
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Resources/views/Form/form_admin_fields.html.twig
Expand Up @@ -324,7 +324,8 @@ file that was distributed with this source code.
{% endif %}

{% if sonata_admin is defined and sonata_admin.options['form_type'] == 'horizontal' %}
{% if label is same as(false) %}
{# Add an offset if no label or is a checkbox/radio #}
{% if label is same as(false) or form.vars.checked is defined %}
{% if 'collection' in form.parent.vars.block_prefixes %}
{% set div_class = div_class ~ ' col-sm-12' %}
{% else %}
Expand Down

0 comments on commit 80db991

Please sign in to comment.