adding sort title to edit book form

This commit is contained in:
Zach Flanders 2023-04-26 23:05:03 -05:00
parent 3f205f1b10
commit a6e5939ad2
2 changed files with 13 additions and 0 deletions

View file

@ -20,6 +20,7 @@ class EditionForm(CustomForm):
model = models.Edition model = models.Edition
fields = [ fields = [
"title", "title",
"sort_title",
"subtitle", "subtitle",
"description", "description",
"series", "series",
@ -45,6 +46,9 @@ class EditionForm(CustomForm):
] ]
widgets = { widgets = {
"title": forms.TextInput(attrs={"aria-describedby": "desc_title"}), "title": forms.TextInput(attrs={"aria-describedby": "desc_title"}),
"sort_title": forms.TextInput(
attrs={"aria-describedby": "desc_sort_title"}
),
"subtitle": forms.TextInput(attrs={"aria-describedby": "desc_subtitle"}), "subtitle": forms.TextInput(attrs={"aria-describedby": "desc_subtitle"}),
"description": forms.Textarea( "description": forms.Textarea(
attrs={"aria-describedby": "desc_description"} attrs={"aria-describedby": "desc_description"}

View file

@ -28,6 +28,15 @@
{% include 'snippets/form_errors.html' with errors_list=form.title.errors id="desc_title" %} {% include 'snippets/form_errors.html' with errors_list=form.title.errors id="desc_title" %}
</div> </div>
<div class="field">
<label class="label" for="id_sort_title">
{% trans "Sort Title:" %}
</label>
<input type="text" name="sort_title" value="{{ form.sort_title.value|default:'' }}" maxlength="255" class="input" required="" id="id_sort_title" aria-describedby="desc_sort_title">
{% include 'snippets/form_errors.html' with errors_list=form.sort_title.errors id="desc_sort_title" %}
</div>
<div class="field"> <div class="field">
<label class="label" for="id_subtitle"> <label class="label" for="id_subtitle">
{% trans "Subtitle:" %} {% trans "Subtitle:" %}