Automate diary entries and add photo galleries

This commit is contained in:
kai
2026-08-29 11:58:56 +02:00
parent 0b0b19b53a
commit b2af6c6857
7 changed files with 238 additions and 62 deletions
+2 -20
View File
@@ -391,27 +391,9 @@
<section class="diary-section" id="diary">
<h2>📓 Mein Konzerttagebuch</h2>
{% if can_write_diary %}
<p>Dieser Eintrag ist privat und nur für dich sichtbar.</p>
<form class="diary-form" method="post" action="/concerts/{{ concert.id }}/diary" enctype="multipart/form-data">
<label for="diary-rating">Bewertung</label>
<select id="diary-rating" name="rating" required>
{% for value in range(1, 6) %}<option value="{{ value }}" {% if diary_entry and diary_entry.rating == value %}selected{% endif %}>{{ value }} von 5 Sternen</option>{% endfor %}
</select>
<label for="favorite-song">Lieblingssong <small>(optional)</small></label>
<input id="favorite-song" name="favorite_song" maxlength="255" value="{{ diary_entry.favorite_song if diary_entry else '' }}">
<label for="diary-notes">Erinnerungen <small>(optional)</small></label>
<textarea id="diary-notes" name="notes" maxlength="5000" placeholder="Was ist dir von diesem Abend geblieben?">{{ diary_entry.notes if diary_entry else '' }}</textarea>
<label for="diary-photo">Erinnerungsfoto <small>(optional, JPG, PNG oder WEBP, max. 10 MB)</small></label>
{% if diary_entry and diary_entry.photo_path %}
<img src="{{ diary_entry.photo_path }}" alt="Erinnerungsfoto zu {{ concert.artist }}" style="display:block;max-width:min(100%,520px);max-height:420px;object-fit:cover;border-radius:10px;margin-bottom:8px">
<label><input type="checkbox" name="remove_photo" value="1" style="width:auto"> Vorhandenes Foto entfernen</label>
{% endif %}
<input id="diary-photo" name="photo" type="file" accept="image/jpeg,image/png,image/webp">
<button class="attendance-option" type="submit">{% if diary_entry %}Eintrag aktualisieren{% else %}Im Tagebuch speichern{% endif %}</button>
</form>
{% if diary_entry %}<form method="post" action="/concerts/{{ concert.id }}/diary/delete" onsubmit="return confirm('Tagebucheintrag wirklich löschen?');"><button class="button button-secondary" type="submit">Tagebucheintrag löschen</button></form>{% endif %}
<p>Der private Eintrag wurde automatisch angelegt. <a class="button" href="/diary#concert-{{ concert.id }}">Im Konzerttagebuch bearbeiten</a></p>
{% else %}
<p>Das private Tagebuch ist verfügbar, wenn du dieses vergangene Konzert als „Zugesagt“ markiert hattest.</p>
<p>Ein Tagebucheintrag wird automatisch angelegt, sobald du das vergangene Konzert als „Zugesagt“ markierst.</p>
{% endif %}
</section>
{% endif %}