- Cookie-Banner (gd, gd2) mit den Kategorien Notwendig und Externe Medien (YouTube); Auswahl im Cookie gd_consent (6 Monate), Widerruf über den Footer - YouTube: Platzhalter mit "Video laden", die API wird erst nach Einwilligung geladen; Player über youtube-nocookie.com - Bootstrap, Bootstrap Icons, Chart.js und Montserrat lokal unter assets/vendor statt jsDelivr/Google Fonts (gd, gd2, intern) - Seiten /gd/impressum/ und /gd/datenschutz/, Angaben aus .env (IMPRESSUM_*) - Befehl ip_bereinigen: löscht Melde-IPs nach 30 Tagen, Zähler bleibt - 6 neue Tests (34 insgesamt), Changelog aktualisiert Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
275 lines
14 KiB
HTML
275 lines
14 KiB
HTML
{% extends 'base.html' %}
|
|
{% load youtube_filters %} {# Wichtig: Deinen neuen Filter laden #}
|
|
|
|
{% block content %}
|
|
<style>
|
|
/* Definiert die maximale Höhe und das Scroll-Verhalten für die Fragen */
|
|
.questions-scroll-area {
|
|
max-height: 80vh; /* 80% der Bildschirmhöhe */
|
|
overflow-y: auto;
|
|
padding-right: 15px;
|
|
}
|
|
|
|
/* Schönerer Scrollbar für moderne Browser */
|
|
.questions-scroll-area::-webkit-scrollbar {
|
|
width: 6px;
|
|
}
|
|
.questions-scroll-area::-webkit-scrollbar-track {
|
|
background: #f1f1f1;
|
|
}
|
|
.questions-scroll-area::-webkit-scrollbar-thumb {
|
|
background: #ccc;
|
|
border-radius: 10px;
|
|
}
|
|
.questions-scroll-area::-webkit-scrollbar-thumb:hover {
|
|
background: #999;
|
|
}
|
|
|
|
/* Video-Container Hintergrund für Jellyfin */
|
|
.bg-black {
|
|
background-color: #000;
|
|
}
|
|
</style>
|
|
|
|
<div class="row">
|
|
<div class="col-12 mb-4 d-flex justify-content-between align-items-end">
|
|
<div>
|
|
<h2 class="mb-0">Folge {{ folge.folgen_nummer }}</h2>
|
|
<p class="text-muted mb-0">Ausstrahlung am {{ folge.datum|date:"d. F Y" }} | Moderator: {{ folge.moderator }}</p>
|
|
</div>
|
|
<a href="{% url 'gd:folgen_list' %}" class="btn btn-outline-secondary btn-sm">Zurück zur Liste</a>
|
|
</div>
|
|
|
|
<div class="col-md-4 mb-4">
|
|
<div class="card shadow-sm mb-4">
|
|
<div class="card-header bg-dark text-white fw-bold">Das Panel</div>
|
|
<div class="list-group list-group-flush">
|
|
{% for p in panel %}
|
|
<div class="list-group-item d-flex align-items-center">
|
|
<span class="badge bg-secondary me-3">{{ p.position }}</span>
|
|
<a href="{% url 'gd:team_member_detail' p.team_member.id %}" class="text-decoration-none text-dark fw-bold">
|
|
{{ p.team_member.name }}
|
|
</a>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="video-section mb-4">
|
|
{% if video_mode == 'jellyfin' %}
|
|
<div class="card border-primary shadow-sm">
|
|
<div class="card-header bg-primary text-white p-2 small fw-bold text-center">Lokalarchiv (Jellyfin)</div>
|
|
<div class="card-body p-0 bg-black">
|
|
<div class="ratio ratio-16x9">
|
|
<video id="jellyfin-player" controls preload="metadata"
|
|
poster="{{ jellyfin_url }}/Items/{{ folge.zusatzinfo.jellyfin_item_id }}/Images/Primary"
|
|
style="width: 100%; height: 100%;">
|
|
<source src="{{ jellyfin_url }}/Videos/{{ folge.zusatzinfo.jellyfin_item_id }}/stream.mp4?static=true" type="video/mp4">
|
|
Dein Browser unterstützt keine HTML5 Videos.
|
|
</video>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
var jfPlayer = document.getElementById('jellyfin-player');
|
|
if (jfPlayer) {
|
|
// 1. Gespeicherte Lautstärke laden (Standard 0.5 falls nichts vorhanden)
|
|
var savedVolume = localStorage.getItem('globalVideoVolume') || 0.5;
|
|
jfPlayer.volume = savedVolume;
|
|
|
|
// 2. Bei jeder Änderung den neuen Wert im Browser merken
|
|
jfPlayer.addEventListener('volumechange', function() {
|
|
localStorage.setItem('globalVideoVolume', jfPlayer.volume);
|
|
});
|
|
}
|
|
});
|
|
</script>
|
|
{% elif video_mode == 'youtube' %}
|
|
<div class="card border-danger shadow-sm">
|
|
<div class="card-header bg-danger text-white p-2 small fw-bold text-center">Video (YouTube)</div>
|
|
<div class="card-body p-0">
|
|
<div class="ratio ratio-16x9">
|
|
{# Platzhalter wird von YT.Player durch das iframe ersetzt (erst nach Einwilligung) #}
|
|
<div id="player">
|
|
<div class="yt-placeholder">
|
|
<i class="bi bi-youtube"></i>
|
|
<div>
|
|
Beim Abspielen werden Daten (u. a. deine IP-Adresse) an YouTube (Google) übertragen.
|
|
<a href="{% url 'gd:datenschutz' %}#youtube">Mehr erfahren</a>
|
|
</div>
|
|
<button type="button" id="yt-load" class="btn btn-danger btn-sm">
|
|
<i class="bi bi-play-fill"></i> Video laden
|
|
</button>
|
|
<label><input type="checkbox" id="yt-always" class="form-check-input me-1">YouTube-Videos immer laden</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="alert alert-light alert-dismissible fade show border-top rounded-0 rounded-bottom mb-0 py-2 ps-3 pe-5" role="alert">
|
|
<div class="d-flex flex-column flex-sm-row justify-content-between align-items-start align-items-sm-center">
|
|
<p class="text-muted mb-2 mb-sm-0" style="font-size: 0.75rem; line-height: 1.2;">
|
|
<i class="bi bi-youtube text-danger me-1"></i>
|
|
<strong>Externer Inhalt:</strong><br> Dieses Video wird von YouTube bereitgestellt. Für Inhalte und Erreichbarkeit wird keine Haftung übernommen.
|
|
</p>
|
|
|
|
<div id="report-section">
|
|
{% if zusatzinfo.video_defekt_gemeldet %}
|
|
<span class="badge bg-warning text-dark small">
|
|
<i class="bi bi-exclamation-triangle-fill me-1"></i> Defekt bereits gemeldet
|
|
</span>
|
|
{% else %}
|
|
<form action="{% url 'gd:video_melden' folge.id %}" method="post" class="d-inline">
|
|
{% csrf_token %}
|
|
<button type="submit" class="btn btn-sm btn-outline-danger py-0 px-2 shadow-none" style="font-size: 0.7rem;">
|
|
<i class="bi bi-flag-fill me-1"></i> Defekt melden
|
|
</button>
|
|
</form>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
<button type="button" class="btn-close small" data-bs-dismiss="alert" aria-label="Schließen"></button>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
// 1. IFrame Player API erst nach Einwilligung laden (Zwei-Klick-Lösung, siehe consent.js)
|
|
var ytApiGeladen = false;
|
|
function ladeYouTube() {
|
|
if (ytApiGeladen) return;
|
|
ytApiGeladen = true;
|
|
var tag = document.createElement('script');
|
|
tag.src = "https://www.youtube.com/iframe_api";
|
|
document.head.appendChild(tag);
|
|
}
|
|
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
if (window.gdConsent && gdConsent.has('youtube')) {
|
|
ladeYouTube();
|
|
}
|
|
document.getElementById('yt-load').addEventListener('click', function() {
|
|
// "Immer laden" speichert die Einwilligung dauerhaft, sonst gilt sie nur für diesen Aufruf
|
|
if (document.getElementById('yt-always').checked && window.gdConsent) {
|
|
gdConsent.save({ youtube: true });
|
|
}
|
|
ladeYouTube();
|
|
});
|
|
});
|
|
|
|
// Einwilligung über den Cookie-Banner erteilt
|
|
document.addEventListener('gd:consent', function(event) {
|
|
if (event.detail.youtube) ladeYouTube();
|
|
});
|
|
|
|
var player;
|
|
function onYouTubeIframeAPIReady() {
|
|
player = new YT.Player('player', {
|
|
host: 'https://www.youtube-nocookie.com',
|
|
height: '100%',
|
|
width: '100%',
|
|
videoId: '{{ folge.zusatzinfo.yt_adresse|get_yt_id }}',
|
|
playerVars: {
|
|
'playsinline': 1,
|
|
'rel': 0,
|
|
'modestbranding': 1,
|
|
'enablejsapi': 1,
|
|
'origin': window.location.origin
|
|
},
|
|
events: {
|
|
'onReady': onPlayerReady
|
|
}
|
|
});
|
|
}
|
|
|
|
function onPlayerReady(event) {
|
|
// <u>Gespeicherten Wert laden (0.0 - 1.0) und auf YT-Skala (0 - 100) umrechnen</u>
|
|
var savedVolume = localStorage.getItem('globalVideoVolume') || 0.5;
|
|
event.target.setVolume(savedVolume * 100);
|
|
|
|
// 2. Kontinuierliche Synchronisation der Lautstärke
|
|
// Da die API kein direktes "onVolumeChange" Event hat, prüfen wir alle 2 Sek.
|
|
setInterval(function() {
|
|
if (player && typeof player.getVolume === 'function') {
|
|
var currentVol = player.getVolume() / 100;
|
|
// Speichern für Jellyfin und zukünftige YT-Aufrufe
|
|
localStorage.setItem('globalVideoVolume', currentVol);
|
|
}
|
|
}, 2000);
|
|
}
|
|
</script>
|
|
|
|
{% else %}
|
|
<div class="alert alert-secondary text-center small">Kein Video verfügbar.</div>
|
|
{% endif %}
|
|
</div>
|
|
|
|
{% if folge.zusatzinfo.folgen_infos %}
|
|
<div class="card border-info shadow-sm">
|
|
<div class="card-header bg-info text-dark p-2 small fw-bold">Infos zur Folge</div>
|
|
<div class="card-body small">
|
|
{{ folge.zusatzinfo.folgen_infos|linebreaks }}
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<div class="col-md-8">
|
|
<div class="card shadow-sm h-100">
|
|
<div class="card-header bg-white fw-bold d-flex justify-content-between align-items-center">
|
|
<span>Gestellte Fragen</span>
|
|
<span class="badge bg-light text-muted fw-normal">{{ fragen|length }} Fragen</span>
|
|
</div>
|
|
<div class="card-body questions-scroll-area">
|
|
{% for f in fragen %}
|
|
<div class="mb-4 {% if not forloop.last %}border-bottom pb-4{% endif %}">
|
|
<div class="d-flex justify-content-between">
|
|
<h5 class="text-primary small fw-bold">FRAGE {{ forloop.counter }}</h5>
|
|
{% if f.zuschauer_frage %}
|
|
<span class="badge bg-info text-dark" style="font-size: 0.7rem;">ZUSCHAUERFRAGE</span>
|
|
{% endif %}
|
|
</div>
|
|
<p class="lead" style="font-size: 1.25rem; font-weight: bold;">{{ f.frage_text }}</p>
|
|
|
|
{% if f.einsender_display %}
|
|
<div class="small text-muted mb-2">Eingereicht von: {{ f.einsender_display }}</div>
|
|
{% endif %}
|
|
|
|
{% if f.kategorien.all or f.dauer_minuten %}
|
|
<div class="mb-2 small">
|
|
{% if f.kategorien.all %}
|
|
{% for k in f.kategorien.all %}
|
|
<span class="badge bg-secondary text-white me-1">{{ k.name }}</span>
|
|
{% endfor %}
|
|
{% endif %}
|
|
|
|
{% if f.dauer_minuten %}
|
|
<span class="text-muted ms-2">≈ {{ f.dauer_minuten|floatformat:0 }} min</span>
|
|
{% endif %}
|
|
</div>
|
|
{% endif %}
|
|
|
|
<div class="bg-light p-3 rounded border-start border-success border-4">
|
|
<strong class="text-success small d-block mb-1">ANTWORT:</strong>
|
|
<p class="mb-2">{{ f.antwort.antwort_text }}</p>
|
|
|
|
{% if f.antwort.team.all %}
|
|
<div class="pt-2 border-top">
|
|
<small class="text-muted">Gelöst durch:</small>
|
|
{% for member in f.antwort.team.all %}
|
|
<span class="badge bg-white border border-success text-success fw-normal">{{ member.name }}</span>
|
|
{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
{% empty %}
|
|
<p class="text-center text-muted py-5">Keine Fragen zu dieser Folge vorhanden.</p>
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="py-4"></div>
|
|
{% endblock %} |