Skip to content

Commit

Permalink
[Form] Option for not displaying a label by setting label to false.
Browse files Browse the repository at this point in the history
[Form] Fixed formatting & translation ..
  • Loading branch information
BenjaminBeck authored and stloyd committed Dec 11, 2012
1 parent 1ec59f1 commit 36e4556
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,12 @@
{% if required %}
{% set label_attr = label_attr|merge({'class': (label_attr.class|default('') ~ ' required')|trim}) %}
{% endif %}
{% if label is empty %}
{% set label = name|humanize %}
{% if label is not sameas(false) %}
{% if label is empty %}
{% set label = name|humanize %}
{% endif %}
<label{% for attrname, attrvalue in label_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}>{{ label|trans({}, translation_domain) }}</label>
{% endif %}
<label{% for attrname, attrvalue in label_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}>{{ label|trans({}, translation_domain) }}</label>
{% endspaceless %}
{% endblock form_label %}

Expand Down

0 comments on commit 36e4556

Please sign in to comment.