Fixed day span
This commit is contained in:
@@ -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:
|
||||||
|
|||||||
@@ -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;
|
||||||
@@ -68,10 +66,10 @@
|
|||||||
<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,19 +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') }}";
|
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 = `${baseUrl}?test=1${params}`;
|
// 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>
|
||||||
|
|||||||
Reference in New Issue
Block a user