From 04a7b06d613dd3ab90cde4eb268087e28d92017c Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Mon, 29 Aug 2011 10:43:11 -0500 Subject: [PATCH] Giving schendje some auth registration descriptions so he can style them! --- mediagoblin/auth/forms.py | 16 ++++++++++++---- .../templates/mediagoblin/utils/wtforms.html | 6 +++--- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/mediagoblin/auth/forms.py b/mediagoblin/auth/forms.py index 917909c5..d1f3c5dc 100644 --- a/mediagoblin/auth/forms.py +++ b/mediagoblin/auth/forms.py @@ -24,21 +24,29 @@ class RegistrationForm(wtforms.Form): _('Username'), [wtforms.validators.Required(), wtforms.validators.Length(min=3, max=30), - wtforms.validators.Regexp(r'^\w+$')]) + wtforms.validators.Regexp(r'^\w+$')], + description=_( + u"This is the name other users will identify you with.")) password = wtforms.PasswordField( _('Password'), [wtforms.validators.Required(), wtforms.validators.Length(min=6, max=30), wtforms.validators.EqualTo( 'confirm_password', - _('Passwords must match.'))]) + _('Passwords must match.'))], + description=_( + u"Try to use a strong password!")) confirm_password = wtforms.PasswordField( _('Confirm password'), - [wtforms.validators.Required()]) + [wtforms.validators.Required()], + description=_( + u"Type it again here to make sure there are no spelling mistakes.")) email = wtforms.TextField( _('Email address'), [wtforms.validators.Required(), - wtforms.validators.Email()]) + wtforms.validators.Email()], + description=_( + u"Your email will never be published.")) class LoginForm(wtforms.Form): diff --git a/mediagoblin/templates/mediagoblin/utils/wtforms.html b/mediagoblin/templates/mediagoblin/utils/wtforms.html index 2639522a..4038de98 100644 --- a/mediagoblin/templates/mediagoblin/utils/wtforms.html +++ b/mediagoblin/templates/mediagoblin/utils/wtforms.html @@ -20,9 +20,6 @@ {% macro render_field_div(field) %}
{{ _(field.label.text) }}
- {% if field.description -%} -
{{ _(field.description) }}
- {%- endif %}
{{ field }}
{%- if field.errors -%} {% for error in field.errors %} @@ -31,6 +28,9 @@
{% endfor %} {%- endif %} + {% if field.description -%} +
{{ _(field.description) }}
+ {%- endif %} {%- endmacro %} -- 2.25.1