diff options
-rw-r--r-- | mediagoblin/edit/forms.py | 1 | ||||
-rw-r--r-- | mediagoblin/static/css/base.css | 4 | ||||
-rw-r--r-- | mediagoblin/templates/mediagoblin/utils/wtforms.html | 47 |
3 files changed, 33 insertions, 19 deletions
diff --git a/mediagoblin/edit/forms.py b/mediagoblin/edit/forms.py index e0147a0c..85c243a0 100644 --- a/mediagoblin/edit/forms.py +++ b/mediagoblin/edit/forms.py @@ -66,7 +66,6 @@ class EditAccountForm(wtforms.Form): [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'), diff --git a/mediagoblin/static/css/base.css b/mediagoblin/static/css/base.css index 8b57584d..995bfc7e 100644 --- a/mediagoblin/static/css/base.css +++ b/mediagoblin/static/css/base.css @@ -334,6 +334,10 @@ text-align: center; width: 20px; } +#boolean { + margin-bottom: 4px; + } + textarea#description, textarea#bio { resize: vertical; height: 100px; diff --git a/mediagoblin/templates/mediagoblin/utils/wtforms.html b/mediagoblin/templates/mediagoblin/utils/wtforms.html index a4c33f1a..2b2cc30a 100644 --- a/mediagoblin/templates/mediagoblin/utils/wtforms.html +++ b/mediagoblin/templates/mediagoblin/utils/wtforms.html @@ -34,26 +34,26 @@ {# Generically render a field #} {% macro render_field_div(field, autofocus_first=False) %} - {{- render_label_p(field) }} - <div class="form_field_input"> - {% if autofocus_first %} - {{ field(autofocus=True) }} - {% else %} - {{ field }} - {% endif %} - {%- if field.errors -%} - {% for error in field.errors %} - <p class="form_field_error">{{ error }}</p> - {% endfor %} - {%- endif %} - {%- if field.description %} - {% if field.type == 'BooleanField' %} - <label for="{{ field.label.field_id }}">{{ field.description|safe }}</label> + {% if field.type == 'BooleanField' %} + {{ render_bool(field) }} + {% else %} + {{- render_label_p(field) }} + <div class="form_field_input"> + {% if autofocus_first %} + {{ field(autofocus=True) }} {% else %} - <p class="form_field_description">{{ field.description|safe }}</p> + {{ field }} {% endif %} - {%- endif %} - </div> + {%- if field.errors -%} + {% for error in field.errors %} + <p class="form_field_error">{{ error }}</p> + {% endfor %} + {%- endif %} + {%- if field.description %} + <p class="form_field_description">{{ field.description|safe }}</p> + {%- endif %} + </div> + {% endif %} {%- endmacro %} {# Auto-render a form as a series of divs #} @@ -86,3 +86,14 @@ </tr> {% endfor %} {%- endmacro %} + +{# Render a boolean field #} +{% macro render_bool(field) %} + <div id="boolean"> + <label for="{{ field.label.field_id }}"> + {{ field }}</input> + {{ field.description|safe }} + </label> +</div> +{% endmacro %} + |