From 8e92385c5616e03b0e6fb450edb015c2d598c654 Mon Sep 17 00:00:00 2001 From: Jon Seager Date: Tue, 3 Feb 2026 12:17:03 +0000 Subject: [PATCH] feat(search): add search input and reposition pagination in templates Add search_header macro with Datastar-driven live search and debounced input. Move pagination controls from above to below tables. Add pagination-controls class for mobile hiding. Add infinite scroll sentinel divs and data attributes to all list partials. --- templates/partials/bag_list.html | 10 ++++++++-- templates/partials/brew_list.html | 12 ++++++++++-- templates/partials/gear_list.html | 10 ++++++++-- templates/partials/roast_list.html | 10 ++++++++-- templates/partials/roaster_list.html | 10 ++++++++-- templates/partials/table.html | 20 +++++++++++++++++--- 6 files changed, 59 insertions(+), 13 deletions(-) diff --git a/templates/partials/bag_list.html b/templates/partials/bag_list.html index e55a3b4..cb853eb 100644 --- a/templates/partials/bag_list.html +++ b/templates/partials/bag_list.html @@ -93,8 +93,10 @@

History

-
- {% call table::pagination_header(bags, navigator, "#bag-list") %} +
+ {% call table::search_header(navigator, "#bag-list") %}
@@ -122,6 +124,10 @@
+ {% call table::pagination_header(bags, navigator, "#bag-list") %} + {% if bags.has_next() %} + + {% endif %}
diff --git a/templates/partials/brew_list.html b/templates/partials/brew_list.html index 83f30d3..358ca8b 100644 --- a/templates/partials/brew_list.html +++ b/templates/partials/brew_list.html @@ -1,8 +1,10 @@ {% import "partials/table.html" as table %}
-
- {% call table::pagination_header(brews, navigator, "#brew-list") %} +
+ {% call table::search_header(navigator, "#brew-list") %}
@@ -106,5 +108,11 @@ No brews logged yet. Start by logging your first cup! {% endif %} + + {% call table::pagination_header(brews, navigator, "#brew-list") %} + + {% if brews.has_next() %} + + {% endif %} diff --git a/templates/partials/gear_list.html b/templates/partials/gear_list.html index ec740a7..c4d4cf2 100644 --- a/templates/partials/gear_list.html +++ b/templates/partials/gear_list.html @@ -9,8 +9,10 @@ {% endif %} {% else %} -
- {% call table::pagination_header(gear, navigator, "#gear-list") %} +
+ {% call table::search_header(navigator, "#gear-list") %}
@@ -62,6 +64,10 @@
+ {% call table::pagination_header(gear, navigator, "#gear-list") %} + {% if gear.has_next() %} + + {% endif %}
{% endif %}
diff --git a/templates/partials/roast_list.html b/templates/partials/roast_list.html index bbe9a38..9a390c3 100644 --- a/templates/partials/roast_list.html +++ b/templates/partials/roast_list.html @@ -8,8 +8,10 @@

No roasts recorded yet. Use the form above to add your first roast.

{% else %} -
- {% call table::pagination_header(roasts, navigator, "#roast-list") %} +
+ {% call table::search_header(navigator, "#roast-list") %}
@@ -91,6 +93,10 @@
+ {% call table::pagination_header(roasts, navigator, "#roast-list") %} + {% if roasts.has_next() %} + + {% endif %}
{% endif %} diff --git a/templates/partials/roaster_list.html b/templates/partials/roaster_list.html index 5a67c72..418d645 100644 --- a/templates/partials/roaster_list.html +++ b/templates/partials/roaster_list.html @@ -10,8 +10,10 @@

{% else %} -
- {% call table::pagination_header(roasters, navigator, "#roaster-list") %} +
+ {% call table::search_header(navigator, "#roaster-list") %}
@@ -98,6 +100,10 @@
+ {% call table::pagination_header(roasters, navigator, "#roaster-list") %} + {% if roasters.has_next() %} + + {% endif %}
{% endif %} diff --git a/templates/partials/table.html b/templates/partials/table.html index 86abe4b..de0b1ff 100644 --- a/templates/partials/table.html +++ b/templates/partials/table.html @@ -1,11 +1,25 @@ +{% macro search_header(navigator, target_selector) %} +
+ +
+{% endmacro %} + {% macro pagination_header(items, navigator, target_selector) %}
-

+ Showing {{ items.start_index() }}–{{ items.end_index() }} of {{ items.total }} results -

+