Files
pingu-concerts/app/templates/admin_venues.html
T

79 lines
6.0 KiB
HTML

<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Veranstaltungsorte · Pingu Concerts</title>
<link rel="stylesheet" href="/static/css/style.css">
<style>
.venue-fields { display: grid; grid-template-columns: 2fr 2fr .8fr 1.4fr 1.2fr; gap: 8px; }
.venue-fields input, .merge-form select { min-width: 0; width: 100%; }
.venue-aliases { margin-top: 8px; }
.venue-actions { margin-top: 10px; justify-content: space-between; }
.venue-actions label { display: flex; align-items: center; gap: 6px; }
.merge-form { display: grid; grid-template-columns: minmax(180px, 1fr) auto; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.delete-form { margin-top: 10px; text-align: right; }
.venue-card { padding: 0; overflow: hidden; }
.venue-summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 16px; cursor: pointer; list-style: none; }
.venue-summary::-webkit-details-marker { display: none; }
.venue-summary::after { content: "▾"; color: var(--muted); transition: transform .15s ease; }
.venue-card[open] .venue-summary::after { transform: rotate(180deg); }
.venue-card[open] .venue-summary { border-bottom: 1px solid var(--border); background: var(--surface-hover); }
.venue-summary-title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.venue-summary-meta { display: block; margin-top: 3px; color: var(--muted); font-size: .83rem; }
.venue-verified { color: #86efac; }
.venue-unverified { color: #fca5a5; }
.venue-editor { padding: 16px; }
@media (max-width: 900px) { .venue-fields { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .venue-fields, .merge-form { grid-template-columns: 1fr; } }
</style>
</head>
<body>
<header><div class="header-inner"><a href="/" class="logo">🎸 Pingu <span>Concerts</span></a>{% include '_user_menu.html' %}</div></header>
<main>
<div class="page-title"><h1>📍 Veranstaltungsorte</h1><p>Orte korrigieren, bestätigen, zusammenführen oder entfernen.</p></div>
{% set admin_section = 'venues' %}{% include '_admin_nav.html' %}
<section class="admin-section">
<div class="admin-list">
{% for venue in venues %}
<details class="admin-row venue-card" {% if not venue.is_verified %}open{% endif %}>
<summary class="venue-summary">
<span>
<strong class="venue-summary-title">{{ venue.name }}{% if venue.city %} · {{ venue.city }}{% endif %}{% if venue.country %} · {{ venue.country }}{% endif %}</strong>
<span class="venue-summary-meta"><span class="{% if venue.is_verified %}venue-verified{% else %}venue-unverified{% endif %}">{% if venue.is_verified %}✓ bestätigt{% else %}● unbestätigt{% endif %}</span> · {{ venue.concert_count }} Veranstaltung(en) · ID {{ venue.id }}</span>
</span>
</summary>
<div class="venue-editor">
<form method="post" action="/admin/venues/{{ venue.id }}">
<div class="venue-fields">
<input name="name" value="{{ venue.name }}" aria-label="Name" required>
<input name="street" value="{{ venue.street }}" placeholder="Straße" aria-label="Straße">
<input name="postal_code" value="{{ venue.postal_code }}" placeholder="PLZ" aria-label="PLZ">
<input name="city" value="{{ venue.city }}" placeholder="Ort" aria-label="Ort">
<input name="country" value="{{ venue.country }}" placeholder="Land" aria-label="Land">
</div>
<input class="venue-aliases" name="aliases" value="{{ venue.aliases }}" placeholder="Aliase, durch Komma getrennt" aria-label="Aliase">
<div class="admin-actions venue-actions">
<label><input type="checkbox" name="is_verified" {% if venue.is_verified %}checked{% endif %}> bestätigt</label>
<span class="admin-meta">Quelle: {{ venue.source }} · {{ venue.concert_count }} Konzert(e) · ID {{ venue.id }}</span>
<button class="button" type="submit">Speichern</button>
</div>
</form>
{% if venues|length > 1 %}
<form class="merge-form" method="post" action="/admin/venues/{{ venue.id }}/merge" onsubmit="return confirm('Alle Konzerte werden dem Zielort zugeordnet und dieser Eintrag wird gelöscht. Fortfahren?');">
<select name="target_venue_id" required><option value="">Mit anderem Ort zusammenführen …</option>{% for target in venues %}{% if target.id != venue.id %}<option value="{{ target.id }}">{{ target.name }}{% if target.city %}, {{ target.city }}{% endif %}</option>{% endif %}{% endfor %}</select>
<button class="admin-danger" type="submit">Zusammenführen</button>
</form>
{% endif %}
<form class="delete-form" method="post" action="/admin/venues/{{ venue.id }}/delete" onsubmit="return confirm('{% if venue.concert_count %}Der Ort ist mit {{ venue.concert_count }} Konzert(en) verknüpft. Diese Konzerte haben danach keinen Veranstaltungsort mehr. {% endif %}Ort endgültig löschen?');">
<button class="admin-danger" type="submit">Ort löschen{% if venue.concert_count %} ({{ venue.concert_count }} Verknüpfung(en)){% endif %}</button>
</form>
</div>
</details>
{% else %}<p>Noch keine Veranstaltungsorte vorhanden.</p>{% endfor %}
</div>
</section>
</main>
</body>
</html>