brewlog/templates/partials/bag_card.html
Jon Seager 4bdfc661f9
refactor: consolidate entity pages into unified /data and /add views
Replace per-entity pages (/roasters, /roasts, /bags, /brews, /gear,
/cafes, /cups) and detail pages with a single tabbed /data view and
a dedicated /add page for entity creation.

- Add /data route with tab-based navigation using Datastar
- Add /add route consolidating all create forms
- Remove per-entity page handlers and standalone templates
- Remove detail page routes, handlers, and templates
- Update ListNavigator to accept String paths for query-param URLs
- Update home page and timeline links to use new /data?type=X paths
- Update nav to reference /data instead of individual entity pages
2026-02-04 20:51:30 +00:00

29 lines
1.2 KiB
HTML

{% import "partials/icons.html" as icons %}
{% macro card(bag, is_authenticated) %}
<div id="bag-card-{{ bag.id }}" class="rounded-lg border border-amber-200 bg-amber-50 p-4 shadow-sm">
<div class="min-w-0">
<span class="block truncate font-semibold text-amber-800">{{ bag.roast_name }}</span>
<p class="truncate text-sm text-stone-500">{{ bag.roaster_name }}</p>
</div>
<p class="mt-2 truncate text-sm text-stone-600">
<span class="font-medium">{{ bag.remaining }}g</span>
<span class="text-stone-400">of {{ bag.amount }}g remaining</span>
</p>
{% if is_authenticated %}
<div class="mt-3 pt-3 border-t border-amber-100 flex gap-3">
<a href="/data?type=brews" class="inline-flex items-center gap-1 text-sm font-medium text-amber-700 hover:text-amber-500">
{% call icons::plus_circle("h-4 w-4") %}
Brew
</a>
<button
type="button"
class="inline-flex items-center gap-1 text-sm font-medium text-stone-500 hover:text-stone-700"
onclick="closeBag('{{ bag.id }}', document.getElementById('bag-card-{{ bag.id }}'))"
>
{% call icons::x_circle("h-4 w-4") %}
Close
</button>
</div>
{% endif %}
</div>
{% endmacro %}