Compare commits
11 Commits
5256d4cbbf
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 89700afbfa | |||
| 087f854247 | |||
| 75c2d0b323 | |||
| 18d5bec9e3 | |||
| b13a7ab724 | |||
| a79806038d | |||
| a02377a1d4 | |||
| f04df44d93 | |||
| 6c2a13e578 | |||
| 7b1f143cec | |||
| 19d457bde6 |
@@ -34,7 +34,7 @@ def get_upcoming_events(days_to_show=None, limit=None):
|
||||
|
||||
# Typografie: Bindestrich durch En-Dash (–) ersetzen
|
||||
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']
|
||||
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
|
||||
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():
|
||||
if _is_cache_valid() and _cache["remarks"] is not None:
|
||||
|
||||
@@ -34,7 +34,8 @@ async def admin_page(request: Request):
|
||||
"config_days": config['processing']['days_to_show']
|
||||
})
|
||||
|
||||
@router.get("/cache-clear")
|
||||
async def clear_cache():
|
||||
@router.get("/cache-clear", name="clear_cache")
|
||||
async def clear_cache(request: Request):
|
||||
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"))
|
||||
@@ -16,16 +16,14 @@
|
||||
}
|
||||
.card { border: 1px solid #ddd; padding: 20px; margin-bottom: 20px; border-radius: 8px; }
|
||||
|
||||
/* Flex-Container für die Linksbündigkeit (Standard) */
|
||||
.input-row {
|
||||
margin-top: 15px;
|
||||
display: flex;
|
||||
justify-content: flex-start; /* Alles nach links */
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
gap: 25px; /* Abstand zwischen den Paaren (Tage / Zeilen) */
|
||||
gap: 25px;
|
||||
}
|
||||
|
||||
/* Gruppiert Label und Input eng zusammen */
|
||||
.input-group {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -61,17 +59,17 @@
|
||||
</p>
|
||||
|
||||
<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 class="card">
|
||||
<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>
|
||||
<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>
|
||||
|
||||
<p><a href="/zeiten">← Zurück zur Ansicht</a></p>
|
||||
<p><a href="{{ url_for('public_table') }}">← Zurück zur Ansicht</a></p>
|
||||
|
||||
<script>
|
||||
const daysInput = document.getElementById('days_input');
|
||||
@@ -81,18 +79,24 @@
|
||||
function updateUrl() {
|
||||
const days = parseInt(daysInput.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) {
|
||||
url += `&lines=${lines}`;
|
||||
// Zeilen-Limitierung hat Priorität
|
||||
params += `&lines=${lines}`;
|
||||
} 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);
|
||||
linesInput.addEventListener('input', updateUrl);
|
||||
</script>
|
||||
|
||||
@@ -3,18 +3,18 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<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-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-style: normal;
|
||||
font-display: swap; /* Verhindert unsichtbaren Text beim Laden */
|
||||
}
|
||||
|
||||
.monat {
|
||||
font-size: 25px;
|
||||
font-size: 130%;
|
||||
font-weight: bold;
|
||||
padding: 1.5ex 0.5em 0.5ex 0.5em;
|
||||
color: rgba(255, 255, 255, 0.9);
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
td {
|
||||
padding: 0.5ex 0.5em;
|
||||
font-size: 15px;
|
||||
font-size: 100%;
|
||||
vertical-align: top;
|
||||
white-space: nowrap;
|
||||
/* 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 { 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; }
|
||||
|
||||
/* Feste Prozentwerte für identische Spalten in allen Tabellen */
|
||||
@@ -53,7 +53,7 @@
|
||||
</head>
|
||||
<body>
|
||||
{% 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 %}
|
||||
{% set monate = ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'] %}
|
||||
{% set ns = namespace(last_month=none, last_week=none) %}
|
||||
|
||||
Reference in New Issue
Block a user