added feature to render_divs where if field.label == '' then it will render form.description the same a render_label
This commit is contained in:
parent
15db183151
commit
1e21471a8a
@ -65,6 +65,9 @@ class EditAccountForm(wtforms.Form):
|
|||||||
_('New email address'),
|
_('New email address'),
|
||||||
[wtforms.validators.Optional(),
|
[wtforms.validators.Optional(),
|
||||||
normalize_user_or_email_field(allow_user=False)])
|
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 = wtforms.SelectField(
|
||||||
_('License preference'),
|
_('License preference'),
|
||||||
[
|
[
|
||||||
@ -73,8 +76,6 @@ class EditAccountForm(wtforms.Form):
|
|||||||
],
|
],
|
||||||
choices=licenses_as_choices(),
|
choices=licenses_as_choices(),
|
||||||
description=_('This will be your default license on upload forms.'))
|
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):
|
class EditAttachmentsForm(wtforms.Form):
|
||||||
|
@ -46,12 +46,7 @@
|
|||||||
{% trans %}Change your password.{% endtrans %}
|
{% trans %}Change your password.{% endtrans %}
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
{{ wtforms_util.render_field_div(form.new_email) }}
|
{{ wtforms_util.render_divs(form) }}
|
||||||
<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) }}
|
|
||||||
<div class="form_submit_buttons">
|
<div class="form_submit_buttons">
|
||||||
<input type="submit" value="{% trans %}Save changes{% endtrans %}" class="button_form" />
|
<input type="submit" value="{% trans %}Save changes{% endtrans %}" class="button_form" />
|
||||||
{{ csrf_token }}
|
{{ csrf_token }}
|
||||||
|
@ -47,7 +47,11 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- if field.description %}
|
{%- if field.description %}
|
||||||
|
{% if field.label.text == '' %}
|
||||||
|
<label for="{{ field.label.field_id }}">{{ field.description|safe }}</label>
|
||||||
|
{% else %}
|
||||||
<p class="form_field_description">{{ field.description|safe }}</p>
|
<p class="form_field_description">{{ field.description|safe }}</p>
|
||||||
|
{% endif %}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
</div>
|
</div>
|
||||||
{%- endmacro %}
|
{%- endmacro %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user