- Skip payload in tracing::instrument to avoid logging base64 image data - Add blob: to CSP img-src for image preview support - Add deferred_upload_with_preview macro for edit form image previews with Replace/Remove buttons and proper DOM cleanup on replacement - Fix datastar-fetch finished handler (evt.detail.response is undefined for redirect scripts) - Display brew time in M:SS format on edit form - Add full-width Save Changes button with check icon and Cancel button to all edit forms - Fix country flag emoji spacing on cafe and cup detail pages - Add "View on Map" Google Maps link to cafe and cup detail pages
84 lines
2.8 KiB
HTML
84 lines
2.8 KiB
HTML
{% extends "base.html" %}
|
|
{% import "partials/detail_cards.html" as detail %}
|
|
{% import "partials/icons.html" as icons %}
|
|
{% import "partials/image_section.html" as img %}
|
|
{% block title %}Brewlog · {{ cafe.name }}{% endblock %}
|
|
{% block og_title %}{{ cafe.name }} — Brewlog{% endblock %}
|
|
{% block og_description %}
|
|
{{ cafe.name }}
|
|
— {{ cafe.city }}, {{ cafe.country_flag }} {{ cafe.country }}
|
|
{% 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 items-center gap-4 min-w-0">
|
|
{{ img::image_thumbnail("cafe", cafe.id, image_url, is_authenticated) }}
|
|
<div class="flex flex-col gap-1 min-w-0">
|
|
<h1 class="text-2xl font-semibold truncate">{{ cafe.name }}</h1>
|
|
<p class="text-sm text-text-secondary">
|
|
<a
|
|
href="/data?type=cafes"
|
|
class="text-accent hover:text-accent-hover transition"
|
|
>Cafes</a
|
|
>
|
|
· {{ cafe.created_date }}
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
{{ img::lightbox_script() }}
|
|
|
|
<div class="grid gap-6 md:grid-cols-2">
|
|
<div class="rounded-lg border bg-surface p-5">
|
|
<h2 class="text-lg font-semibold text-text mb-4">Details</h2>
|
|
<dl class="grid grid-cols-2 gap-x-4 gap-y-3 text-sm">
|
|
<div>
|
|
<dt class="text-text-muted">City</dt>
|
|
<dd class="font-medium text-text">{{ cafe.city }}</dd>
|
|
</div>
|
|
<div>
|
|
<dt class="text-text-muted">Country</dt>
|
|
<dd class="font-medium text-text">
|
|
{% if !cafe.country_flag.is_empty() %}
|
|
<span class="mr-1">{{ cafe.country_flag }}</span>
|
|
{% endif %}{{ cafe.country }}
|
|
</dd>
|
|
</div>
|
|
<div>
|
|
<dt class="text-text-muted">Location</dt>
|
|
<dd class="font-medium">
|
|
<a
|
|
href="{{ cafe.map_url }}"
|
|
target="_blank"
|
|
rel="noreferrer noopener"
|
|
class="text-accent hover:text-accent-hover transition"
|
|
>View on Map</a
|
|
>
|
|
</dd>
|
|
</div>
|
|
{% if let Some(url) = 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>
|
|
|
|
{{ detail::map_with_legend(cafe.map_countries, cafe.map_max, cafe.legend_entries) }}
|
|
</div>
|
|
|
|
{% if is_authenticated %}
|
|
{{ detail::edit_delete_buttons(edit_url, "cafe", "/api/v1/cafes", cafe.id) }}
|
|
{% endif %}
|
|
{% endblock %}
|