Don't put checkbox text on separate line (#475)

Manually render the "notify me" checkbox line in the account settings
to not put the form label as a heading but in the same line as the
checkbox.

Edit forms.py to use the label attribute for the caption.

Original patch modified by Sebastian Spaeth to 1) not translate the
checkbox label in the template, it is translated in forms.py already.
2) Simplify the HTML, manually constructing the <label> tag is not
necessary, WTforms does it automatically.

Author:    LotusEcho <Emma.C.Echo@gmail.com>
Modified-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This commit is contained in:
LotusEcho 2012-09-24 16:15:34 -04:00 committed by Sebastian Spaeth
parent d4c066abf0
commit 5e5b8acfec
2 changed files with 9 additions and 6 deletions

View File

@ -68,8 +68,7 @@ class EditAccountForm(wtforms.Form):
[wtforms.validators.Length(min=6, max=30)],
id="password")
wants_comment_notification = wtforms.BooleanField(
_(''),
description=_("Email me when others comment on my media"))
label=_("Email me when others comment on my media"))
class EditAttachmentsForm(wtforms.Form):

View File

@ -32,7 +32,6 @@
{% block mediagoblin_content %}
<form action="{{ request.urlgen('mediagoblin.edit.account') }}?username={{
user.username }}"
method="POST" enctype="multipart/form-data">
@ -42,7 +41,12 @@
Changing {{ username }}'s account settings
{%- endtrans %}
</h1>
{{ wtforms_util.render_divs(form) }}
{{ wtforms_util.render_field_div(form.old_password) }}
{{ wtforms_util.render_field_div(form.new_password) }}
<div class="form_field_input">
<p>{{ form.wants_comment_notification }}
{{ form.wants_comment_notification.label }}</p>
</div>
<div class="form_submit_buttons">
<input type="submit" value="{% trans %}Save changes{% endtrans %}" class="button_form" />
{{ csrf_token }}