From 325e4b611fc71ee2c789a2d7b3105ff9eca3b6f3 Mon Sep 17 00:00:00 2001 From: Jon Seager Date: Thu, 5 Feb 2026 21:58:43 +0000 Subject: [PATCH] refactor(brews): deduplicate brew actions between desktop and mobile views Extract brew-again form and delete button into a local Askama macro, eliminating ~50 lines of duplicated markup. --- templates/partials/lists/brew_list.html | 77 ++++++++++--------------- 1 file changed, 29 insertions(+), 48 deletions(-) diff --git a/templates/partials/lists/brew_list.html b/templates/partials/lists/brew_list.html index c3ff7b5..73e8608 100644 --- a/templates/partials/lists/brew_list.html +++ b/templates/partials/lists/brew_list.html @@ -1,6 +1,33 @@ {% import "partials/lists/table.html" as table %} {% import "partials/icons.html" as icons %} +{% macro brew_actions(brew, navigator) %} +
+
+ + + + + + {% if let Some(fp_id) = brew.filter_paper_id %} + + {% endif %} + + + + +
+ +
+{% endmacro %} +
{% if brews.items.is_empty() && !navigator.has_search() %}
{% if is_authenticated %} -
-
- - - - - - {% if let Some(fp_id) = brew.filter_paper_id %} - - {% endif %} - - - - -
- -
+ {% call brew_actions(brew, navigator) %} - - -
+ {% call brew_actions(brew, navigator) %} {% endif %}