- Create /bags/:id detail page with coffee, roaster, map, and bag info cards - Extract shared template macros into detail_cards.html (coffee_card, roaster_card, map_with_legend, share_button) - Extract build_coffee_info() and build_roaster_info() view model helpers - Refactor brew.html and cup.html to use shared macros - Make bag cards on homepage clickable, linking to detail page - Add Close Bag and Delete actions on bag detail page - Unify homepage card styling (bg-surface, hover:border-accent/40) - Update CLAUDE.md with detail page patterns
59 lines
2.6 KiB
HTML
59 lines
2.6 KiB
HTML
{% extends "base.html" %}
|
|
{% import "partials/detail_cards.html" as detail %}
|
|
{% block title %}Brewlog · {{ cup.roast_name }} at {{ cup.cafe_name }}{% endblock %}
|
|
{% block description %}{{ cup.roast_name }} by {{ cup.roaster_name }} at {{ cup.cafe_name }}, {{ cup.cafe_city }}.{% endblock %}
|
|
{% block og_title %}{{ cup.roast_name }} at {{ cup.cafe_name }} — Brewlog{% endblock %}
|
|
{% block og_description %}{{ cup.roast_name }} by {{ cup.roaster_name }} at {{ cup.cafe_name }}, {{ cup.cafe_city }}.{% endblock %}
|
|
{% block head %}<meta property="og:image" content="{{ base_url }}/og-image.png" />{% endblock %}
|
|
{% block content %}
|
|
<header class="flex items-start justify-between gap-4">
|
|
<div class="flex flex-col gap-2">
|
|
<h1 class="text-3xl font-semibold">{{ cup.roast_name }}</h1>
|
|
<p class="text-sm text-text-secondary">
|
|
{{ cup.roaster_name }} · {{ cup.cafe_name }}, {{ cup.cafe_city }} · {{ cup.created_date }}
|
|
</p>
|
|
</div>
|
|
{{ detail::share_button() }}
|
|
</header>
|
|
|
|
{{ detail::share_script() }}
|
|
|
|
{# ── Coffee + map ── #}
|
|
<div class="grid gap-6 md:grid-cols-2">
|
|
{{ detail::coffee_card(cup.roast_name, cup.roaster_name, cup.origin, cup.origin_flag, cup.region, cup.producer, cup.process, cup.tasting_notes) }}
|
|
{{ detail::map_with_legend_3(cup.map_countries, cup.map_max, "Cafe", "", "Origin", "opacity-65", "Roaster", "opacity-35") }}
|
|
</div>
|
|
|
|
{# ── Roaster & cafe ── #}
|
|
<div class="grid gap-6 md:grid-cols-2">
|
|
{{ detail::roaster_card(cup.roaster_name, cup.roaster_country, cup.roaster_country_flag, cup.roaster_city, cup.roaster_homepage) }}
|
|
|
|
<div class="rounded-lg border bg-surface p-5">
|
|
<h2 class="text-lg font-semibold text-text mb-4">Cafe</h2>
|
|
<dl class="grid grid-cols-2 gap-x-4 gap-y-3 text-sm">
|
|
<div>
|
|
<dt class="text-text-muted">Name</dt>
|
|
<dd class="font-medium text-text">{{ cup.cafe_name }}</dd>
|
|
</div>
|
|
<div>
|
|
<dt class="text-text-muted">Country</dt>
|
|
<dd class="font-medium text-text">
|
|
{% if !cup.cafe_country_flag.is_empty() %}{{ cup.cafe_country_flag }} {% endif %}{{ cup.cafe_country }}
|
|
</dd>
|
|
</div>
|
|
<div>
|
|
<dt class="text-text-muted">City</dt>
|
|
<dd class="font-medium text-text">{{ cup.cafe_city }}</dd>
|
|
</div>
|
|
{% if let Some(url) = cup.cafe_website %}
|
|
<div>
|
|
<dt class="text-text-muted">Website</dt>
|
|
<dd class="font-medium">
|
|
<a href="{{ url }}" target="_blank" rel="noreferrer noopener" class="text-accent hover:text-accent-hover transition">Visit Website</a>
|
|
</dd>
|
|
</div>
|
|
{% endif %}
|
|
</dl>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|