mirror of
https://github.com/StefBuwalda/cal_counter.git
synced 2025-10-30 11:19:59 +00:00
Change password + New base (#10)
* created a new Base template to test with * Changed out the base and added a new password page * Password change works, UI needs redisgn
This commit is contained in:
@@ -10,74 +10,16 @@
|
||||
<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>
|
||||
<body class="bg-body-secondary" style="max-width: calc(100vh*9/16); margin: 0 auto;">
|
||||
{% include "new_navbar.html" %}
|
||||
|
||||
<div class="collapse navbar-collapse" id="navbarNav">
|
||||
<div class="d-flex w-100">
|
||||
<ul class="navbar-nav flex-grow-1">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{ url_for('user.daily_log') }}">Daily Log (new)</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{ url_for('user.dashboard') }}">Dashboard</a>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="navbar-nav">
|
||||
{% if current_user.is_authenticated %}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{ url_for('auth.logout') }}">Logout</a>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{ url_for('auth.login') }}">Login</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
<li class="nav-item">
|
||||
<button id="toggleTheme" class="btn btn-outline-light">Toggle Theme</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
{% include "flash.html" %}
|
||||
|
||||
{% block content %}
|
||||
{% endblock %}
|
||||
|
||||
<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>
|
||||
{% block footer %}
|
||||
{% endblock %}
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
|
||||
|
||||
9
application/templates/flash.html
Normal file
9
application/templates/flash.html
Normal file
@@ -0,0 +1,9 @@
|
||||
{% with messages = get_flashed_messages() %}
|
||||
{% if messages %}
|
||||
<div class="alert alert-info">
|
||||
{% for message in messages %}
|
||||
<p>{{ message }}</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
51
application/templates/navbar.html
Normal file
51
application/templates/navbar.html
Normal file
@@ -0,0 +1,51 @@
|
||||
<nav class="navbar 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">
|
||||
<div class="d-flex w-100">
|
||||
<ul class="navbar-nav flex-grow-1">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{ url_for('user.daily_log') }}">Daily Log (new)</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{ url_for('user.dashboard') }}">Dashboard</a>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="navbar-nav">
|
||||
{% if current_user.is_authenticated %}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{ url_for('auth.logout') }}">Logout</a>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{ url_for('auth.login') }}">Login</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
<li class="nav-item">
|
||||
<button id="toggleTheme" class="btn btn-outline-light">Toggle Theme</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<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>
|
||||
60
application/templates/new_navbar.html
Normal file
60
application/templates/new_navbar.html
Normal file
@@ -0,0 +1,60 @@
|
||||
<!-- Navbar -->
|
||||
<nav class="navbar bg-body shadow-sm mb-2">
|
||||
<div class="container">
|
||||
<a class="navbar-brand" href="#">TaskManager</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 me-auto">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{ url_for('user.daily_log') }}">Daily Overview</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 dropdown">
|
||||
<a class="nav-link dropdown-toggle" href="#" id="accountDropdown" role="button"
|
||||
data-bs-toggle="dropdown" aria-expanded="false">
|
||||
Account
|
||||
</a>
|
||||
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="accountDropdown">
|
||||
<li><a class="dropdown-item" href='{{ url_for("auth.change_pass") }}'>Change Password</a></li>
|
||||
<li><a class="dropdown-item" href="#">Profile</a></li>
|
||||
<li>
|
||||
<hr class="dropdown-divider">
|
||||
</li>
|
||||
<li><a class="dropdown-item" href='{{ url_for("auth.logout") }}'>Logout</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Login</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
<li class="nav-item">
|
||||
<button id="toggleTheme" class="btn btn-body-secondary bg-dark-subtle">Toggle Theme</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<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>
|
||||
Reference in New Issue
Block a user