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');

View File

@@ -34,8 +34,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>
@@ -65,6 +65,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();

View File

@@ -162,8 +162,8 @@
<div class="mb-3">
<label for="person" class="form-label">Person</label>
<select class="form-control" id="person" name="person" required>
<option value="Person A">Person A</option>
<option value="Person B">Person B</option>
<option value="Sarah">Sarah</option>
<option value="Stuart">Stuart</option>
</select>
</div>
<div id="overwriteWarning" class="alert alert-warning" style="display: none;">

View File

@@ -162,8 +162,8 @@
<div class="mb-3">
<label for="applyPerson" class="form-label">Person</label>
<select class="form-control" id="applyPerson" name="person" required>
<option value="Person A">Person A</option>
<option value="Person B">Person B</option>
<option value="Sarah">Sarah</option>
<option value="Stuart">Stuart</option>
</select>
</div>
<div id="applyOverwriteWarning" class="alert alert-warning" style="display: none;">