Files
ProjectIOT/application/dashboard/templates/base.html
2025-06-17 18:42:20 +02:00

152 lines
5.4 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.5/dist/css/bootstrap.min.css" rel="stylesheet">
<title>Admin Dashboard</title>
<script defer src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.5/dist/js/bootstrap.bundle.min.js"></script>
<style>
body.dark-mode {
background-color: #181a1b !important;
color: #e0e0e0 !important;
}
.dark-mode .card,
.dark-mode .table {
background-color: #23272b !important;
color: #e0e0e0 !important;
}
.dark-mode .table thead,
.dark-mode .table tbody,
.dark-mode .table th,
.dark-mode .table td,
.dark-mode .table tr {
background-color: #23272b !important;
color: #e0e0e0 !important;
border-color: #444 !important;
}
.dark-mode .card-title,
.dark-mode .display-4,
.dark-mode h5 {
color: #e0e0e0 !important;
}
.dark-mode input {
background-color: #23272b !important;
color: #e0e0e0 !important;
border: 1px solid #444 !important;
}
.dark-mode .btn {
background-color: #444 !important;
color: #e0e0e0 !important;
border-color: #333 !important;
}
.dark-mode .btn:hover {
background-color: #222 !important;
color: #fff !important;
}
.dark-mode .badge.bg-secondary {
background-color: #444 !important;
color: #e0e0e0 !important;
}
.dark-mode .logout-btn {
background-color: #212529 !important;
color: #fff !important;
border-color: #212529 !important;
}
.dark-mode .logout-btn:hover {
background-color: #353738 !important;
color: #fff !important;
}
.dark-mode .modal-content {
background-color: #23272b !important;
color: #e0e0e0 !important;
}
</style>
</head>
<body>
<div class="container-fluid">
<div class="row">
<div class="col-md-3 col-lg-2 d-md-block sidebar" style="height: 100vh; background-color: #313A4D;">
<div class="position-sticky pt-3">
<ul class="nav flex-column">
<li class="nav-item">
<img src="{{ url_for('static', filename='images/warpnet-logo.png') }}" alt="Logo"
class="img-fluid mt-3 mb-3">
<hr style="border: 1px solid white; margin-top: 0;">
</li>
<li class="nav-item">
<a class="nav-link active text-white" href="/dash/dashboard">
Dashboard
</a>
<a class="nav-link active text-white" href="/dash/add">
Add numberplate
</a>
</li>
</ul>
<div class="d-flex justify-content-center mt-3">
<a href="{{ url_for('auth.logout') }}" class=" btn btn-sm btn-dark logout-btn"
style="width: 200px;">Logout</a>
<button id="darkModeToggle" class="btn btn-secondary btn-sm"
style="position: fixed; top: 10px; right: 10px; z-index: 9999;">
Toggle Theme
</button>
</div>
</div>
</div>
<svg xmlns="http://www.w3.org/2000/svg" class="d-none">
<symbol id="check-circle-fill" viewBox="0 0 16 16">
<path
d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zm-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z" />
</symbol>
</svg>
<div class="position-fixed w-25 bottom-0" style="z-index: 1050;">
{% for message in get_flashed_messages() %}
<div class="alert alert-success alert-dismissible fade show" role="alert">
<svg class="bi flex-shrink-0 me-2" width="15" height="15" role="img" aria-label="Success:">
<use xlink:href="#check-circle-fill" />
</svg>
{{message}}
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
{% endfor %}
</div>
{%block content%}
{% endblock %}
</div>
</div>
</div>
<script>
document.getElementById('darkModeToggle').onclick = function () {
document.body.classList.toggle('dark-mode');
if (document.body.classList.contains('dark-mode')) {
localStorage.setItem('darkMode', 'enabled');
} else {
localStorage.setItem('darkMode', 'disabled');
}
};
if (localStorage.getItem('darkMode') === 'enabled') {
document.body.classList.add('dark-mode');
}
</script>
</body>
</html>