mirror of
https://github.com/sstent/foodplanner.git
synced 2026-01-25 11:11:36 +00:00
sync - added week menus
This commit is contained in:
@@ -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');
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;">
|
||||
|
||||
@@ -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;">
|
||||
|
||||
Reference in New Issue
Block a user