sync - added week menus

This commit is contained in:
2025-09-22 09:56:30 -07:00
parent 45779f1739
commit 3344d88691
6 changed files with 25 additions and 14 deletions

View File

@@ -47,8 +47,8 @@
<div class="container-fluid">
<div class="person-toggle">
<select id="personSelect" class="form-select" onchange="switchPerson()">
<option value="Person A" {% if person == "Person A" %}selected{% endif %}>Person A</option>
<option value="Person B" {% if person == "Person B" %}selected{% endif %}>Person B</option>
<option value="Sarah" {% if person == "Sarah" %}selected{% endif %}>Sarah</option>
<option value="Stuart" {% if person == "Stuart" %}selected{% endif %}>Stuart</option>
</select>
</div>
@@ -104,6 +104,7 @@
<script>
function switchPerson() {
const person = document.getElementById('personSelect').value;
localStorage.setItem('selectedPerson', person);
const currentUrl = new URL(window.location);
currentUrl.searchParams.set('person', person);
window.location.href = currentUrl.toString();
@@ -111,6 +112,15 @@
// Set active tab based on current URL
document.addEventListener('DOMContentLoaded', function() {
// Set person selection from localStorage if available
const savedPerson = localStorage.getItem('selectedPerson');
if (savedPerson) {
const personSelect = document.getElementById('personSelect');
if (personSelect) {
personSelect.value = savedPerson;
}
}
const currentPath = window.location.pathname;
const tabs = document.querySelectorAll('.nav-link');