From 1262aa3c37eb42c7c236151590fe06f61071b4fb Mon Sep 17 00:00:00 2001 From: Francisco Penedo Alvarez Date: Tue, 28 Apr 2026 23:08:58 +0200 Subject: [PATCH] Fix #4: readings switch to dropped after rating The hidden input for "dropped" in the completed reading form was always setting the value to "1", which caused the reading to be marked as dropped when the rating was updated (hidden inputs do not honor the "checked" attribute). Additionally, the book rating section is now swapped OOB when any reading is updated, to ensure the changes are reflected in the hidden inputs. This was causing the latest changes to a reading to be lost when the rating was updated immediately after. --- src/hxbooks/templates/components/reading_status.html.j2 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/hxbooks/templates/components/reading_status.html.j2 b/src/hxbooks/templates/components/reading_status.html.j2 index 755c850..4872afe 100644 --- a/src/hxbooks/templates/components/reading_status.html.j2 +++ b/src/hxbooks/templates/components/reading_status.html.j2 @@ -26,7 +26,7 @@ {% if vars.completed_readings %} -
+
@@ -34,7 +34,7 @@ - +
@@ -61,7 +61,8 @@ {% for reading in vars.user_readings | sort(attribute='start_date', reverse=true) %}
+ hx-swap="none show:none" hx-select-oob="#flash-messages-container:outerHTML,#book-rating:outerHTML" + hx-target="this">