diff --git a/bookwyrm/forms.py b/bookwyrm/forms.py index ffbb237b8..88820c8f1 100644 --- a/bookwyrm/forms.py +++ b/bookwyrm/forms.py @@ -236,7 +236,39 @@ class AuthorForm(CustomForm): "librarything_key", "goodreads_key", ] - + widgets = { + "name": forms.TextInput( + attrs={"aria-describedby": "desc_name"} + ), + "aliases": forms.TextInput( + attrs={"aria-describedby": "desc_aliases"} + ), + "bio": forms.Textarea( + attrs={"aria-describedby": "desc_bio"} + ), + "wikipedia_link": forms.TextInput( + attrs={"aria-describedby": "desc_wikipedia_link"} + ), + "born": forms.SelectDateWidget( + attrs={"aria-describedby": "desc_born"} + ), + "died": forms.SelectDateWidget( + attrs={"aria-describedby": "desc_died"} + ), + "oepnlibrary_key": forms.TextInput( + attrs={"aria-describedby": "desc_oepnlibrary_key"} + ), + "inventaire_id": forms.TextInput( + attrs={"aria-describedby": "desc_inventaire_id"} + ), + "librarything_key": forms.TextInput( + attrs={"aria-describedby": "desc_librarything_key"} + ), + "goodreads_key": forms.TextInput( + attrs={"aria-describedby": "desc_goodreads_key"} + ), + } + class ImportForm(forms.Form): csv_file = forms.FileField() diff --git a/bookwyrm/templates/author/edit_author.html b/bookwyrm/templates/author/edit_author.html index 54d7f4f1c..de1a7875e 100644 --- a/bookwyrm/templates/author/edit_author.html +++ b/bookwyrm/templates/author/edit_author.html @@ -34,47 +34,41 @@
{{ error | escape }}
- {% endfor %} + + {% include 'snippets/form_errors.html' with errors_list=form.name.errors id="desc_name" %}{{ error | escape }}
- {% endfor %} + + {% include 'snippets/form_errors.html' with errors_list=form.aliases.errors id="desc_aliases" %}{{ error | escape }}
- {% endfor %} + + {% include 'snippets/form_errors.html' with errors_list=form.bio.errors id="desc_bio" %}{{ form.wikipedia_link }}
- {% for error in form.wikipedia_link.errors %} -{{ error | escape }}
- {% endfor %} + + {% include 'snippets/form_errors.html' with errors_list=form.wikipedia_link.errors id="desc_wikipedia_link" %}{{ error | escape }}
- {% endfor %} + + {% include 'snippets/form_errors.html' with errors_list=form.born.errors id="desc_born" %}{{ error | escape }}
- {% endfor %} + + {% include 'snippets/form_errors.html' with errors_list=form.died.errors id="desc_died" %}{{ error | escape }}
- {% endfor %} + + {% include 'snippets/form_errors.html' with errors_list=form.oepnlibrary_key.errors id="desc_oepnlibrary_key" %}{{ error | escape }}
- {% endfor %} + + {% include 'snippets/form_errors.html' with errors_list=form.inventaire_id.errors id="desc_inventaire_id" %}{{ error | escape }}
- {% endfor %} + + {% include 'snippets/form_errors.html' with errors_list=form.librarything_key.errors id="desc_librarything_key" %}{{ error | escape }}
- {% endfor %} + + {% include 'snippets/form_errors.html' with errors_list=form.goodreads_key.errors id="desc_goodreads_key" %}