Skip to content

Commit

Permalink
Merge pull request #149 from mennowame/master
Browse files Browse the repository at this point in the history
Fix layout of labels in form by adding default classes
  • Loading branch information
Roderik van der Veer committed Feb 26, 2015
2 parents 9cf1856 + 81915a8 commit c130c70
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@
{% if not compound %}
{% set label_attr = label_attr|merge({'for': id}) %}
{% endif %}
{% set class = 'col-md-2 control-label' %}
{% if required %}
{% set label_attr = label_attr|merge({'class': (label_attr.class|default('') ~ ' col-md-2 control-label required')|trim}) %}
{% endif %}
{% set class = class ~ ' required' %}
{% endif %}
{% set label_attr = label_attr|merge({'class': (label_attr.class|default('') ~ ' ' ~ class)|trim}) %}
{% if label is empty %}
{% set label = name|humanize %}
{% endif %}
Expand Down

0 comments on commit c130c70

Please sign in to comment.