652: Don't show empty field labels.
authorElrond <elrond+mediagoblin.org@samba-tng.org>
Fri, 18 Nov 2011 22:37:25 +0000 (23:37 +0100)
committerElrond <elrond+mediagoblin.org@samba-tng.org>
Tue, 22 Nov 2011 21:00:04 +0000 (22:00 +0100)
If the label for a field is empty, don't show it at all.
And don't translate it!

mediagoblin/templates/mediagoblin/utils/wtforms.html

index 39dca7cc75796a2f101dd7b5c896a4b3f866b8cb..cc30388fc8d7e5ae54882ce34d12971e65f6f8fa 100644 (file)
@@ -18,7 +18,9 @@
 
 {# Generically render a field #}
 {% macro render_field_div(field) %}
-  <p class="form_field_label"><label for="{{ field.name }}">{{ _(field.label.text) }}</label></p>
+  {% if field.label.text -%}
+    <p class="form_field_label"><label for="{{ field.name }}">{{ _(field.label.text) }}</label></p>
+  {%- endif %}
   <div class="form_field_input">
     {{ field }}
     {%- if field.errors -%}