From 1e21471a8abbf3f9d0d0e16a0f2c83c22ffe9650 Mon Sep 17 00:00:00 2001 From: Rodney Ewing Date: Tue, 25 Jun 2013 15:50:31 -0700 Subject: [PATCH] added feature to render_divs where if field.label == '' then it will render form.description the same a render_label --- mediagoblin/edit/forms.py | 5 +++-- mediagoblin/templates/mediagoblin/edit/edit_account.html | 7 +------ mediagoblin/templates/mediagoblin/utils/wtforms.html | 6 +++++- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/mediagoblin/edit/forms.py b/mediagoblin/edit/forms.py index 24b31a76..e0147a0c 100644 --- a/mediagoblin/edit/forms.py +++ b/mediagoblin/edit/forms.py @@ -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): diff --git a/mediagoblin/templates/mediagoblin/edit/edit_account.html b/mediagoblin/templates/mediagoblin/edit/edit_account.html index 461dd6df..fa7a9c48 100644 --- a/mediagoblin/templates/mediagoblin/edit/edit_account.html +++ b/mediagoblin/templates/mediagoblin/edit/edit_account.html @@ -46,12 +46,7 @@ {% trans %}Change your password.{% endtrans %}

- {{ wtforms_util.render_field_div(form.new_email) }} -
-

{{ form.wants_comment_notification }} - {{ wtforms_util.render_label(form.wants_comment_notification) }}

-
- {{- wtforms_util.render_field_div(form.license_preference) }} + {{ wtforms_util.render_divs(form) }}
{{ csrf_token }} diff --git a/mediagoblin/templates/mediagoblin/utils/wtforms.html b/mediagoblin/templates/mediagoblin/utils/wtforms.html index 90b237ee..f522172f 100644 --- a/mediagoblin/templates/mediagoblin/utils/wtforms.html +++ b/mediagoblin/templates/mediagoblin/utils/wtforms.html @@ -47,7 +47,11 @@ {% endfor %} {%- endif %} {%- if field.description %} -

{{ field.description|safe }}

+ {% if field.label.text == '' %} + + {% else %} +

{{ field.description|safe }}

+ {% endif %} {%- endif %}
{%- endmacro %} -- 2.25.1