From 10a51d96890dc3185e4347d7ad7b19aced0b65e2 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Tue, 4 Jan 2022 12:53:48 -0800 Subject: [PATCH] Changes how progress input fields are id'ed --- bookwyrm/templates/snippets/progress_field.html | 2 +- .../snippets/reading_modals/progress_update_modal.html | 6 ++++-- .../snippets/reading_modals/start_reading_modal.html | 2 +- bookwyrm/templates/snippets/readthrough_form.html | 7 +++++-- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/bookwyrm/templates/snippets/progress_field.html b/bookwyrm/templates/snippets/progress_field.html index d61956ba7..4ceed04cf 100644 --- a/bookwyrm/templates/snippets/progress_field.html +++ b/bookwyrm/templates/snippets/progress_field.html @@ -5,7 +5,7 @@ type="number" name="progress" class="input" - id="id_progress_{{ readthrough.id }}{{ controls_uid }}" + id="{{ field_id }}" value="{{ readthrough.progress }}" {% if progress_required %}required{% endif %} > diff --git a/bookwyrm/templates/snippets/reading_modals/progress_update_modal.html b/bookwyrm/templates/snippets/reading_modals/progress_update_modal.html index 3e0fd45e4..919d21002 100644 --- a/bookwyrm/templates/snippets/reading_modals/progress_update_modal.html +++ b/bookwyrm/templates/snippets/reading_modals/progress_update_modal.html @@ -1,5 +1,6 @@ {% extends 'snippets/reading_modals/layout.html' %} {% load i18n %} +{% load utilities %} {% block modal-title %} {% trans "Update progress" %} @@ -12,8 +13,9 @@ {% endblock %} {% block reading-dates %} - -{% include "snippets/progress_field.html" with progress_required=True %} +{% join "id_progress" uuid as field_id %} + +{% include "snippets/progress_field.html" with progress_required=True id=field_id %} {% endblock %} {% block form %} diff --git a/bookwyrm/templates/snippets/reading_modals/start_reading_modal.html b/bookwyrm/templates/snippets/reading_modals/start_reading_modal.html index 60c7a89e7..861f118f9 100644 --- a/bookwyrm/templates/snippets/reading_modals/start_reading_modal.html +++ b/bookwyrm/templates/snippets/reading_modals/start_reading_modal.html @@ -11,7 +11,7 @@ Start "{{ book_title }}" {% block modal-form-open %}
- + {% csrf_token %} {% endblock %} diff --git a/bookwyrm/templates/snippets/readthrough_form.html b/bookwyrm/templates/snippets/readthrough_form.html index a68306a33..295ad7c6e 100644 --- a/bookwyrm/templates/snippets/readthrough_form.html +++ b/bookwyrm/templates/snippets/readthrough_form.html @@ -1,4 +1,6 @@ {% load i18n %} +{% load utilities %} + {% csrf_token %} @@ -10,10 +12,11 @@ {# Only show progress for editing existing readthroughs #} {% if readthrough.id and not readthrough.finish_date %} -