From 3bbcd33933a1b429cc3a12a51601675bcccd3a2f Mon Sep 17 00:00:00 2001 From: Jon Seager Date: Wed, 4 Feb 2026 16:32:18 +0000 Subject: [PATCH] refactor(templates): extract inline SVG icons into shared icons partial Replace duplicated inline SVGs across 16 templates with reusable Askama macros from a new icons.html partial, reducing repetition and making icon updates a single-point change. --- templates/cafe_detail.html | 17 +---- templates/cafes.html | 13 ++-- templates/checkin.html | 32 +++------ templates/home.html | 29 ++------ templates/nav.html | 17 ++--- templates/partials/bag_card.html | 9 +-- templates/partials/brew_list.html | 17 +---- templates/partials/cafe_list.html | 35 ++-------- templates/partials/cup_list.html | 9 +-- templates/partials/gear_list.html | 5 +- templates/partials/icons.html | 92 ++++++++++++++++++++++++++ templates/partials/roast_list.html | 9 +-- templates/partials/roaster_list.html | 20 +----- templates/partials/timeline_month.html | 24 ++----- templates/roaster_detail.html | 13 +--- templates/roasters.html | 11 +-- templates/roasts.html | 11 +-- 17 files changed, 152 insertions(+), 211 deletions(-) create mode 100644 templates/partials/icons.html diff --git a/templates/cafe_detail.html b/templates/cafe_detail.html index 5c7752c..a78deb6 100644 --- a/templates/cafe_detail.html +++ b/templates/cafe_detail.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} {% block title %}Brewlog · Cafe · {{ cafe.name }}{% endblock %} {% +{% extends "base.html" %} {% import "partials/icons.html" as icons %} {% block title %}Brewlog · Cafe · {{ cafe.name }}{% endblock %} {% block content %}

{{ cafe.name }}

@@ -28,9 +28,7 @@ block content %} rel="noreferrer noopener" aria-label="Open {{ cafe.name }} in Google Maps" > - + {% call icons::location("h-4 w-4") %} Open in Maps @@ -46,16 +44,7 @@ block content %} rel="noreferrer noopener" aria-label="Visit {{ cafe.name }} website" > - + {% call icons::external_link("h-4 w-4") %} Visit {% else %} diff --git a/templates/cafes.html b/templates/cafes.html index d8232b9..9737830 100644 --- a/templates/cafes.html +++ b/templates/cafes.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} {% block title %}Brewlog · Cafes{% endblock %} +{% extends "base.html" %} {% import "partials/icons.html" as icons %} {% block title %}Brewlog · Cafes{% endblock %} {% block head %} {% if is_authenticated %} @@ -211,9 +211,7 @@ onclick="locateUser(this)" class="inline-flex items-center gap-2 rounded-md border border-amber-500 px-3 py-2 text-sm font-medium text-amber-700 transition hover:bg-amber-50" > - + {% call icons::location("h-4 w-4") %} Find nearby