brewlog/templates/pages/roast.html
Jon Seager f6b51ccb38
refactor: reduce duplication in handlers, templates, and view structs
- Replace inline redirect scripts with existing render_redirect_script()
  in 6 create handlers
- Add delete_button macro to detail_cards.html, used by 6 detail pages
- Unify 3 map_with_legend macros into 1 with LegendEntry iteration
2026-02-10 09:37:49 +00:00

40 lines
1.5 KiB
HTML

{% extends "base.html" %}
{% import "partials/detail_cards.html" as detail %}
{% import "partials/icons.html" as icons %}
{% block title %}Brewlog · {{ roast.name }}{% endblock %}
{% block og_title %}{{ roast.name }} — Brewlog{% endblock %}
{% block og_description %}
{{ roast.name }}
by {{ roast.roaster_name }} — {{ roast.origin }}
{% endblock %}
{% block head %}
<meta property="og:image" content="{{ base_url }}/static/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">{{ roast.name }}</h1>
<p class="text-sm text-text-secondary">
<a
href="/data?type=roasts"
class="text-accent hover:text-accent-hover transition"
>Roasts</a
>
· {{ roast.created_date }}
</p>
</div>
</header>
<div class="grid gap-6 md:grid-cols-2">
{{ detail::coffee_card(roast.name, roast.roaster_name, roast.origin, roast.origin_flag, roast.region, roast.producer, roast.process, roast.tasting_notes, roaster_slug, "") }}
{{ detail::map_with_legend(roast.map_countries, roast.map_max, roast.legend_entries) }}
</div>
<div class="grid gap-6 md:grid-cols-2">
{{ detail::roaster_card(roast.roaster_name, roast.roaster_country, roast.roaster_country_flag, roast.roaster_city, roast.roaster_homepage, roaster_slug) }}
</div>
{% if is_authenticated %}
{{ detail::delete_button("roast", "/api/v1/roasts", roast.id) }}
{% endif %}
{% endblock %}