Files
cal_counter/application/templates/base.html
Stef b282f333fd Remove manual food item addition and barcode scanning
Deleted routes and templates related to manual food item entry and barcode scanning, including add_food_item, add_food_item_manual, food_item, log_food, and related session-based selection routes. Updated navigation in base.html to remove links to these features and added links to overview, daily log, and dashboard. Simplified daily_log.html to format log amounts, and removed unused imports and forms from routes.py.
2025-08-07 17:09:47 +02:00

83 lines
3.1 KiB
HTML

<!doctype html>
<html lang="en" data-bs-theme="dark">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{% block title %}My Flask App{% endblock %}</title>
<!-- Bootstrap 5 CDN -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.7/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body class="bg-body-secondary">
<nav class="navbar navbar-expand-lg navbar-dark bg-dark mb-4">
<div class="container-fluid">
<a class="navbar-brand" href="{{ url_for('index') }}">CalCounter</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav"
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="{{ url_for('user.overview') }}">Overview</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ url_for('user.daily_log') }}">Daily Log</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ url_for('user.dashboard') }}">Dashboard</a>
</li>
</ul>
<ul class="navbar-nav ms-auto">
{% if current_user.is_authenticated %}
<li class="nav-item">
<a class="nav-link" href="{{ url_for('logout') }}">Logout</a>
</li>
{% else %}
<li class="nav-item">
<a class="nav-link" href="{{ url_for('login') }}">Login</a>
</li>
{% endif %}
</ul>
</div>
<button id="toggleTheme" class="btn btn-outline-light ms-3">Toggle Theme</button>
</div>
</nav>
<div class="container">
{% with messages = get_flashed_messages() %}
{% if messages %}
<div class="alert alert-info">
{% for message in messages %}
<p>{{ message }}</p>
{% endfor %}
</div>
{% endif %}
{% endwith %}
{% block content %}
{% endblock %}
</div>
<script>
const html = document.documentElement;
const savedTheme = localStorage.getItem("theme");
if (savedTheme) {
html.setAttribute("data-bs-theme", savedTheme);
}
document.getElementById("toggleTheme").addEventListener("click", () => {
const current = html.getAttribute("data-bs-theme");
const next = current === "dark" ? "light" : "dark";
html.setAttribute("data-bs-theme", next);
localStorage.setItem("theme", next);
});
</script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>