- - {% for category, message in get_flashed_messages(with_categories=true) %} - - {% endfor %} - {% block header %}{% endblock %} diff --git a/src/hxbooks/templates/book/create.html.j2 b/src/hxbooks/templates/book/create.html.j2 index db12209..42a8e5c 100644 --- a/src/hxbooks/templates/book/create.html.j2 +++ b/src/hxbooks/templates/book/create.html.j2 @@ -18,7 +18,7 @@
{% include 'components/book_form.html.j2' %} - +
diff --git a/src/hxbooks/templates/book/detail.html.j2 b/src/hxbooks/templates/book/detail.html.j2 index a6587ea..064215f 100644 --- a/src/hxbooks/templates/book/detail.html.j2 +++ b/src/hxbooks/templates/book/detail.html.j2 @@ -59,7 +59,8 @@ {% endif %}
- + {% include 'components/book_form.html.j2' %}
@@ -71,8 +72,8 @@
- -
+ +
{% if session.get('viewing_as_user') %}
@@ -93,25 +94,4 @@
- {% endblock %} \ No newline at end of file diff --git a/src/hxbooks/templates/book/list.html.j2 b/src/hxbooks/templates/book/list.html.j2 index 6dd54b2..816279e 100644 --- a/src/hxbooks/templates/book/list.html.j2 +++ b/src/hxbooks/templates/book/list.html.j2 @@ -8,14 +8,9 @@
-
-
- - -
+ +
@@ -129,4 +124,76 @@

{% endif %} + + + {% endblock %} \ No newline at end of file diff --git a/src/hxbooks/templates/components/book_form.html.j2 b/src/hxbooks/templates/components/book_form.html.j2 index 1fd923f..68d07d3 100644 --- a/src/hxbooks/templates/components/book_form.html.j2 +++ b/src/hxbooks/templates/components/book_form.html.j2 @@ -9,7 +9,6 @@ -
Leave empty for no owner
@@ -23,13 +22,11 @@ -
Enter one author per line
-
Enter one genre per line
@@ -63,12 +60,25 @@
+ value="{{ book.location_place if book else '' }}" placeholder="Home, Office, etc." list="places-list"> + + {% for place in locations.keys() if place %} + + {% endfor %} +
+ value="{{ book.location_bookshelf if book else '' }}" placeholder="Living room, Bedroom, etc." + list="bookshelf-list"> + + {% if book and book.location_place and locations.get(book.location_place) %} + {% for bookshelf in locations[book.location_place] if bookshelf %} + + {% endfor %} + {% endif %} +
@@ -81,8 +91,8 @@
- +
@@ -96,4 +106,25 @@ -
\ No newline at end of file +
+ + \ No newline at end of file diff --git a/src/hxbooks/templates/components/reading_status.html.j2 b/src/hxbooks/templates/components/reading_status.html.j2 index 1d81b58..35c09e2 100644 --- a/src/hxbooks/templates/components/reading_status.html.j2 +++ b/src/hxbooks/templates/components/reading_status.html.j2 @@ -28,7 +28,8 @@ {% if vars.completed_readings %}
+ class="row align-items-center g-2" hx-trigger="change,submit" hx-swap="none show:none" + hx-select-oob="#flash-messages-container:outerHTML" hx-target="this"> {% for reading in vars.user_readings | sort(attribute='start_date', reverse=true) %}
- +
diff --git a/tests/test_cli.py b/tests/test_cli.py index c466721..f27f587 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -334,6 +334,7 @@ class TestBookSearchCommand: ("owner:alice", "", ["Dune", "The Fellowship", "The Hobbit"]), ("place:home", "", ["Programming Book", "The Hobbit"]), ("bookshelf:fantasy", "", ["The Fellowship", "The Hobbit"]), + ('author:"Frank Herbert"', "", ["Dune"]), # Numeric field filters ("rating>=4", "", ["Programming Book", "The Hobbit"]), ("rating=3", "", ["Dune"]),