Refactor meal addition flow and improve date handling

Refactored add_meal_v2 routes to simplify and clarify the meal addition process, including renaming endpoints and templates, and introducing decorators for date and item selection. Updated daily_log2 to use user's timezone and display the selected date. Adjusted templates and barcode scan logic to match new routes and improved user experience.
This commit is contained in:
2025-08-14 06:59:29 +02:00
parent d78f48710e
commit 4f1b5a5667
4 changed files with 68 additions and 78 deletions

View File

@@ -85,7 +85,7 @@
goButton.addEventListener('click', () => {
const value = searchBox.value.trim();
if (value) {
const baseURL = "{{url_for('add_meal.step3', input='!')}}";
const baseURL = "{{url_for('add_meal_v2.add_existing', input='!')}}";
window.location.href = baseURL.replace("!", encodeURIComponent(value));
}
});
@@ -121,7 +121,7 @@
if (result) {
// Result found, this should post the barcode
const codeText = result.getText();
const baseURL = "{{url_for('add_meal.step3', input='!')}}";
const baseURL = "{{url_for('add_meal_v2.add_existing', input='!')}}";
window.location.href = baseURL.replace("!", encodeURIComponent(codeText));
}
})