Compare commits

..

11 Commits

Author SHA1 Message Date
89700afbfa Template sync 2026-02-21 21:28:30 +01:00
087f854247 Template sync 2026-02-21 21:16:14 +01:00
75c2d0b323 Template sync 2026-02-21 20:47:39 +01:00
18d5bec9e3 Template sync 2026-02-21 20:44:40 +01:00
b13a7ab724 Template sync 2026-02-21 20:22:52 +01:00
a79806038d Fixed cache return page 2026-02-21 20:10:50 +01:00
a02377a1d4 Fixed size 2026-02-21 16:37:56 +01:00
f04df44d93 Fixed size 2026-02-21 16:34:00 +01:00
6c2a13e578 Fixed typo in template 2026-02-21 16:16:38 +01:00
7b1f143cec Fixed day span 2026-02-21 15:55:31 +01:00
19d457bde6 Fixed link 2026-02-21 15:48:00 +01:00
4 changed files with 28 additions and 23 deletions

View File

@@ -34,7 +34,7 @@ def get_upcoming_events(days_to_show=None, limit=None):
# Typografie: Bindestrich durch En-Dash () ersetzen # Typografie: Bindestrich durch En-Dash () ersetzen
for col in ['Morgen', 'Nachmittag']: for col in ['Morgen', 'Nachmittag']:
df[col] = df[col].fillna('').astype(str).str.replace('-', '', regex=False) df[col] = df[col].fillna('').astype(str).str.replace('-', ' ', regex=False)
date_col = config['google_sheet']['date_column'] date_col = config['google_sheet']['date_column']
df = df.dropna(subset=[date_col]) df = df.dropna(subset=[date_col])
@@ -55,7 +55,7 @@ def get_upcoming_events(days_to_show=None, limit=None):
# PRIORITÄT 2: Tage-Logik # PRIORITÄT 2: Tage-Logik
ende = heute + timedelta(days=int(days_to_show)) ende = heute + timedelta(days=int(days_to_show))
return [e for e in _cache["events"] if heute <= e[date_col] <= ende] return [e for e in _cache["events"] if heute <= e[date_col] < ende]
def get_remarks(): def get_remarks():
if _is_cache_valid() and _cache["remarks"] is not None: if _is_cache_valid() and _cache["remarks"] is not None:

View File

@@ -34,7 +34,8 @@ async def admin_page(request: Request):
"config_days": config['processing']['days_to_show'] "config_days": config['processing']['days_to_show']
}) })
@router.get("/cache-clear") @router.get("/cache-clear", name="clear_cache")
async def clear_cache(): async def clear_cache(request: Request):
invalidate_cache() invalidate_cache()
return RedirectResponse(url="/") # Nutzt url_for, um den Redirect-Pfad inkl. root_path zu generieren
return RedirectResponse(url=request.url_for("admin_page"))

View File

@@ -16,16 +16,14 @@
} }
.card { border: 1px solid #ddd; padding: 20px; margin-bottom: 20px; border-radius: 8px; } .card { border: 1px solid #ddd; padding: 20px; margin-bottom: 20px; border-radius: 8px; }
/* Flex-Container für die Linksbündigkeit (Standard) */
.input-row { .input-row {
margin-top: 15px; margin-top: 15px;
display: flex; display: flex;
justify-content: flex-start; /* Alles nach links */ justify-content: flex-start;
align-items: center; align-items: center;
gap: 25px; /* Abstand zwischen den Paaren (Tage / Zeilen) */ gap: 25px;
} }
/* Gruppiert Label und Input eng zusammen */
.input-group { .input-group {
display: flex; display: flex;
align-items: center; align-items: center;
@@ -61,17 +59,17 @@
</p> </p>
<div class="action-row"> <div class="action-row">
<a id="preview_link" href="/zeiten?test=1" target="_blank" class="btn" style="background: #2ed573;">➔ Vorschau mit Test-Hintergrund</a> <a id="preview_link" href="{{ url_for('public_table') }}?test=1" target="_blank" class="btn" style="background: #2ed573;">➔ Vorschau mit Test-Hintergrund</a>
</div> </div>
</div> </div>
<div class="card"> <div class="card">
<h3>Cache Management</h3> <h3>Cache Management</h3>
<p>Der Cache wird automatisch alle 60 Minuten aktualisiert. Nach manuellen Änderungen in Google Sheets können Sie ihn hier sofort leeren.</p> <p>Der Cache wird automatisch alle 60 Minuten aktualisiert. Nach manuellen Änderungen in Google Sheets können Sie ihn hier sofort leeren.</p>
<a href="/cache-clear" class="btn">Cache jetzt löschen</a> <a href="{{ url_for('clear_cache') }}" class="btn">Cache jetzt löschen</a>
</div> </div>
<p><a href="/zeiten">← Zurück zur Ansicht</a></p> <p><a href="{{ url_for('public_table') }}">← Zurück zur Ansicht</a></p>
<script> <script>
const daysInput = document.getElementById('days_input'); const daysInput = document.getElementById('days_input');
@@ -81,18 +79,24 @@
function updateUrl() { function updateUrl() {
const days = parseInt(daysInput.value) || 0; const days = parseInt(daysInput.value) || 0;
const lines = parseInt(linesInput.value) || 0; const lines = parseInt(linesInput.value) || 0;
const baseUrl = "{{ url_for('public_table') }}"; // Holt den korrekten Pfad inkl. root_path
let url = "/zeiten?test=1"; // Wir bauen die Parameter-Kette sauber auf
let params = "?test=1";
if (lines > 0) { if (lines > 0) {
url += `&lines=${lines}`; // Zeilen-Limitierung hat Priorität
params += `&lines=${lines}`;
} else if (days > 0) { } else if (days > 0) {
url += `&days=${days}`; // Tage-Filterung als Fallback
params += `&days=${days}`;
} }
previewLink.href = url; // Den Link final zusammensetzen
previewLink.href = baseUrl + params;
} }
// Event-Listener für Änderungen an den Eingabefeldern
daysInput.addEventListener('input', updateUrl); daysInput.addEventListener('input', updateUrl);
linesInput.addEventListener('input', updateUrl); linesInput.addEventListener('input', updateUrl);
</script> </script>

View File

@@ -3,18 +3,18 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<style> <style>
body { font-family: sans-serif; color: white; background: transparent; margin: 0; padding: 0; } body { font-family: sans-serif; color: white; background: transparent; margin: 0; padding: 0; font-size: 14px; }
@font-face { @font-face {
font-family: 'BrittanySignature'; font-family: 'BrittanySignature';
src: url("{{ url_for('static', path='/BrittanySignature.woff2') }}") format('woff2'); src: url("{{ url_for('static', path='BrittanySignature.woff2') }}") format('woff2');
font-weight: normal; font-weight: normal;
font-style: normal; font-style: normal;
font-display: swap; /* Verhindert unsichtbaren Text beim Laden */ font-display: swap; /* Verhindert unsichtbaren Text beim Laden */
} }
.monat { .monat {
font-size: 25px; font-size: 130%;
font-weight: bold; font-weight: bold;
padding: 1.5ex 0.5em 0.5ex 0.5em; padding: 1.5ex 0.5em 0.5ex 0.5em;
color: rgba(255, 255, 255, 0.9); color: rgba(255, 255, 255, 0.9);
@@ -30,7 +30,7 @@
td { td {
padding: 0.5ex 0.5em; padding: 0.5ex 0.5em;
font-size: 15px; font-size: 100%;
vertical-align: top; vertical-align: top;
white-space: nowrap; white-space: nowrap;
/* border-top: 1px solid rgba(255, 255, 255, 0.2); /* border-top: 1px solid rgba(255, 255, 255, 0.2);
@@ -38,7 +38,7 @@
} }
/* tr:nth-of-type(odd) { background-color: rgba(255, 255, 255, 0.1); } */ /* tr:nth-of-type(odd) { background-color: rgba(255, 255, 255, 0.1); } */
tr { background-color: rgba(255, 255, 255, 0.1); } tr { background-color: rgba(0, 0, 0, 0.2); }
tr.week-spacer { border: none !important; background: transparent !important; height: 15px; } tr.week-spacer { border: none !important; background: transparent !important; height: 15px; }
/* Feste Prozentwerte für identische Spalten in allen Tabellen */ /* Feste Prozentwerte für identische Spalten in allen Tabellen */
@@ -53,7 +53,7 @@
</head> </head>
<body> <body>
{% if test %} {% if test %}
<div style="width: 300px ; margin: 20px auto; padding: 10px; background: rgb(55, 55, 55); border-radius: 8px;"> <div style="width: 310px ; margin: 20px auto; padding: 10px; background: rgb(100, 100, 100); border-radius: 8px;">
{% endif %} {% endif %}
{% set monate = ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'] %} {% set monate = ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'] %}
{% set ns = namespace(last_month=none, last_week=none) %} {% set ns = namespace(last_month=none, last_week=none) %}