diff --git a/bookwyrm/templates/preferences/delete_user.html b/bookwyrm/templates/preferences/delete_user.html index a72cc97d..b009230c 100644 --- a/bookwyrm/templates/preferences/delete_user.html +++ b/bookwyrm/templates/preferences/delete_user.html @@ -19,9 +19,8 @@
- {% for error in form.password.errors %} -

{{ error | escape }}

- {% endfor %} + + {% include 'snippets/form_errors.html' with errors_list=form.password.errors id="desc_password" %}
diff --git a/bookwyrm/templates/preferences/edit_user.html b/bookwyrm/templates/preferences/edit_user.html index a3f8962c..b18eb4e9 100644 --- a/bookwyrm/templates/preferences/edit_user.html +++ b/bookwyrm/templates/preferences/edit_user.html @@ -33,31 +33,27 @@ {% endif %}
{{ form.avatar }} - {% for error in form.avatar.errors %} -

{{ error | escape }}

- {% endfor %} + + {% include 'snippets/form_errors.html' with errors_list=form.avatar.errors id="desc_avatar" %}
{{ form.name }} - {% for error in form.name.errors %} -

{{ error | escape }}

- {% endfor %} + + {% include 'snippets/form_errors.html' with errors_list=form.name.errors id="desc_name" %}
{{ form.summary }} - {% for error in form.summary.errors %} -

{{ error | escape }}

- {% endfor %} + + {% include 'snippets/form_errors.html' with errors_list=form.summary.errors id="desc_summary" %}
{{ form.email }} - {% for error in form.email.errors %} -

{{ error | escape }}

- {% endfor %} + + {% include 'snippets/form_errors.html' with errors_list=form.email.errors id="desc_email" %}
diff --git a/bookwyrm/templates/settings/site.html b/bookwyrm/templates/settings/site.html index 01b25036..3c05e147 100644 --- a/bookwyrm/templates/settings/site.html +++ b/bookwyrm/templates/settings/site.html @@ -123,9 +123,8 @@
{{ site_form.invite_request_text }} - {% for error in site_form.invite_request_text.errors %} -

{{ error|escape }}

- {% endfor %} + + {% include 'snippets/form_errors.html' with errors_list=site_form.invite_request_text.errors id="desc_invite_request_text" %}
diff --git a/bookwyrm/templates/snippets/form_errors.html b/bookwyrm/templates/snippets/form_errors.html new file mode 100644 index 00000000..ecbf7ff8 --- /dev/null +++ b/bookwyrm/templates/snippets/form_errors.html @@ -0,0 +1,9 @@ +{% if errors_list %} +
+ {% for error in errors_list %} +

+ {{ error | escape }} +

+ {% endfor %} +
+{% endif %}