added feature to render_divs where if field.label == '' then it will render form...
authorRodney Ewing <ewing.rj@gmail.com>
Tue, 25 Jun 2013 22:50:31 +0000 (15:50 -0700)
committerRodney Ewing <ewing.rj@gmail.com>
Tue, 25 Jun 2013 23:28:45 +0000 (16:28 -0700)
mediagoblin/edit/forms.py
mediagoblin/templates/mediagoblin/edit/edit_account.html
mediagoblin/templates/mediagoblin/utils/wtforms.html

index 24b31a767df3b073fd332da842403f6fd9077eb1..e0147a0c0ad1ad27acd3788bb8d8a3e74f865466 100644 (file)
@@ -65,6 +65,9 @@ class EditAccountForm(wtforms.Form):
         _('New email address'),
         [wtforms.validators.Optional(),
          normalize_user_or_email_field(allow_user=False)])
+    wants_comment_notification = wtforms.BooleanField(
+        label='',
+        description=_("Email me when others comment on my media"))
     license_preference = wtforms.SelectField(
         _('License preference'),
         [
@@ -73,8 +76,6 @@ class EditAccountForm(wtforms.Form):
         ],
         choices=licenses_as_choices(),
         description=_('This will be your default license on upload forms.'))
-    wants_comment_notification = wtforms.BooleanField(
-        label=_("Email me when others comment on my media"))
 
 
 class EditAttachmentsForm(wtforms.Form):
index 461dd6df1b577c737909a246f055f26f63b0fbb9..fa7a9c4895ec3287ebde2bab5015246b305cfd1f 100644 (file)
           {% trans %}Change your password.{% endtrans %}
         </a>
       </p>
-      {{ wtforms_util.render_field_div(form.new_email) }}
-      <div class="form_field_input">
-        <p>{{ form.wants_comment_notification }}
-           {{ wtforms_util.render_label(form.wants_comment_notification) }}</p>
-      </div>
-      {{- wtforms_util.render_field_div(form.license_preference) }}
+      {{ wtforms_util.render_divs(form) }}
       <div class="form_submit_buttons">
         <input type="submit" value="{% trans %}Save changes{% endtrans %}" class="button_form" />
   {{ csrf_token }}
index 90b237ee9c3a74c5e1e437d53114ed53fbb51802..f522172f607fb126031c05342a0537e837d8c5ae 100644 (file)
       {% endfor %}
     {%- endif %}
     {%- if field.description %}
-      <p class="form_field_description">{{ field.description|safe }}</p>
+      {% if field.label.text == '' %}
+        <label for="{{ field.label.field_id }}">{{ field.description|safe }}</label>
+      {% else %}
+        <p class="form_field_description">{{ field.description|safe }}</p>
+      {% endif %}
     {%- endif %}
   </div>
 {%- endmacro %}