05/31 Fix template

This commit is contained in:
2026-05-31 23:11:13 -04:00
parent 6f74f38304
commit cf82f200a5
+295 -218
View File
@@ -1,270 +1,347 @@
<!DOCTYPE html> <!doctype html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>{% block title %}PFM{% endblock %} — Personal Finance</title> <title>{% block title %}PFM{% endblock %} — Personal Finance</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet"> <link
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css" rel="stylesheet"> href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css"
<link href="https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;1,400&family=DM+Mono:wght@400;500&display=swap" rel="stylesheet"> rel="stylesheet"
/>
<link
href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css"
rel="stylesheet"
/>
<link
href="https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;1,400&family=DM+Mono:wght@400;500&display=swap"
rel="stylesheet"
/>
<style> <style>
:root { :root {
--sidebar-width: 240px; --sidebar-width: 240px;
--sidebar-col-width: 64px; --sidebar-col-width: 64px;
--sidebar-bg: #0f172a; --sidebar-bg: #0f172a;
--sidebar-text: #94a3b8; --sidebar-text: #94a3b8;
--sidebar-text-active: #f1f5f9; --sidebar-text-active: #f1f5f9;
--sidebar-hover: #1e293b; --sidebar-hover: #1e293b;
--sidebar-active: #1e3a5f; --sidebar-active: #1e3a5f;
--accent: #3b82f6; --accent: #3b82f6;
--topbar-h: 56px; --topbar-h: 56px;
--body-bg: #f1f5f9; --body-bg: #f1f5f9;
--card-bg: #ffffff; --card-bg: #ffffff;
--text: #0f172a; --text: #0f172a;
--muted: #64748b; --muted: #64748b;
--border: #e2e8f0; --border: #e2e8f0;
--income: #10b981; --income: #10b981;
--expense: #ef4444; --expense: #ef4444;
--invest: #3b82f6; --invest: #3b82f6;
--trans: all 0.2s cubic-bezier(.4,0,.2,1); --trans: all 0.2s cubic-bezier(.4,0,.2,1);
} }
*, *::before, *::after { box-sizing: border-box; } *, *::before, *::after { box-sizing: border-box; }
body { font-family: 'DM Sans', sans-serif; background: var(--body-bg); color: var(--text); margin: 0; overflow-x: hidden; font-size: 14px; } body { font-family: 'DM Sans', sans-serif; background: var(--body-bg); color: var(--text); margin: 0; overflow-x: hidden; font-size: 14px; }
/* SIDEBAR */ /* SIDEBAR */
#sidebar { #sidebar {
position: fixed; top: 0; left: 0; height: 100vh; position: fixed; top: 0; left: 0; height: 100vh;
width: var(--sidebar-width); background: var(--sidebar-bg); width: var(--sidebar-width); background: var(--sidebar-bg);
display: flex; flex-direction: column; z-index: 1040; display: flex; flex-direction: column; z-index: 1040;
transition: var(--trans); overflow: hidden; transition: var(--trans); overflow: hidden;
} }
#sidebar.collapsed { width: var(--sidebar-col-width); } #sidebar.collapsed { width: var(--sidebar-col-width); }
.sb-brand { .sb-brand {
display: flex; align-items: center; gap: 10px; display: flex; align-items: center; gap: 10px;
padding: 0 16px; height: var(--topbar-h); padding: 0 16px; height: var(--topbar-h);
border-bottom: 1px solid #1e293b; flex-shrink: 0; overflow: hidden; border-bottom: 1px solid #1e293b; flex-shrink: 0; overflow: hidden;
} }
.sb-brand .b-icon { .sb-brand .b-icon {
width: 32px; height: 32px; background: var(--accent); width: 32px; height: 32px; background: var(--accent);
border-radius: 8px; display: flex; align-items: center; border-radius: 8px; display: flex; align-items: center;
justify-content: center; flex-shrink: 0; color: #fff; font-size: 16px; justify-content: center; flex-shrink: 0; color: #fff; font-size: 16px;
} }
.sb-brand .b-text { font-size: 15px; font-weight: 600; color: var(--sidebar-text-active); white-space: nowrap; transition: var(--trans); } .sb-brand .b-text { font-size: 15px; font-weight: 600; color: var(--sidebar-text-active); white-space: nowrap; transition: var(--trans); }
#sidebar.collapsed .b-text { opacity: 0; width: 0; } #sidebar.collapsed .b-text { opacity: 0; width: 0; }
.sb-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 6px 0; scrollbar-width: none; } .sb-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 6px 0; scrollbar-width: none; }
.sb-nav::-webkit-scrollbar { display: none; } .sb-nav::-webkit-scrollbar { display: none; }
.sb-section { .sb-section {
font-size: 10px; font-weight: 600; letter-spacing: .1em; font-size: 10px; font-weight: 600; letter-spacing: .1em;
text-transform: uppercase; color: #475569; text-transform: uppercase; color: #475569;
padding: 14px 20px 4px; white-space: nowrap; transition: var(--trans); padding: 14px 20px 4px; white-space: nowrap; transition: var(--trans);
} }
#sidebar.collapsed .sb-section { opacity: 0; } #sidebar.collapsed .sb-section { opacity: 0; }
.sb-link { .sb-link {
display: flex; align-items: center; gap: 12px; display: flex; align-items: center; gap: 12px;
padding: 9px 16px; color: var(--sidebar-text); padding: 9px 16px; color: var(--sidebar-text);
text-decoration: none; font-size: 13.5px; text-decoration: none; font-size: 13.5px;
border-radius: 6px; margin: 1px 8px; border-radius: 6px; margin: 1px 8px;
white-space: nowrap; overflow: hidden; transition: var(--trans); position: relative; white-space: nowrap; overflow: hidden; transition: var(--trans); position: relative;
} }
.sb-link:hover { background: var(--sidebar-hover); color: var(--sidebar-text-active); } .sb-link:hover { background: var(--sidebar-hover); color: var(--sidebar-text-active); }
.sb-link.active { background: var(--sidebar-active); color: var(--sidebar-text-active); font-weight: 500; } .sb-link.active { background: var(--sidebar-active); color: var(--sidebar-text-active); font-weight: 500; }
.sb-link.active::before { .sb-link.active::before {
content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
width: 3px; height: 60%; background: var(--accent); border-radius: 0 2px 2px 0; width: 3px; height: 60%; background: var(--accent); border-radius: 0 2px 2px 0;
} }
.sb-link i { font-size: 16px; flex-shrink: 0; width: 20px; text-align: center; } .sb-link i { font-size: 16px; flex-shrink: 0; width: 20px; text-align: center; }
.sb-link .lt { transition: var(--trans); } .sb-link .lt { transition: var(--trans); }
#sidebar.collapsed .sb-link .lt { opacity: 0; width: 0; overflow: hidden; } #sidebar.collapsed .sb-link .lt { opacity: 0; width: 0; overflow: hidden; }
.sb-footer { padding: 8px; border-top: 1px solid #1e293b; flex-shrink: 0; } .sb-footer { padding: 8px; border-top: 1px solid #1e293b; flex-shrink: 0; }
/* TOPBAR */ /* TOPBAR */
#topbar { #topbar {
position: fixed; top: 0; right: 0; position: fixed; top: 0; right: 0;
left: var(--sidebar-width); height: var(--topbar-h); left: var(--sidebar-width); height: var(--topbar-h);
background: var(--card-bg); border-bottom: 1px solid var(--border); background: var(--card-bg); border-bottom: 1px solid var(--border);
display: flex; align-items: center; padding: 0 20px; display: flex; align-items: center; padding: 0 20px;
z-index: 1030; gap: 12px; transition: var(--trans); z-index: 1030; gap: 12px; transition: var(--trans);
} }
#sidebar.collapsed ~ #topbar { left: var(--sidebar-col-width); } #sidebar.collapsed ~ #topbar { left: var(--sidebar-col-width); }
.tb-toggle { .tb-toggle {
background: none; border: none; color: var(--muted); background: none; border: none; color: var(--muted);
font-size: 18px; cursor: pointer; padding: 4px 6px; font-size: 18px; cursor: pointer; padding: 4px 6px;
border-radius: 6px; line-height: 1; transition: var(--trans); border-radius: 6px; line-height: 1; transition: var(--trans);
} }
.tb-toggle:hover { background: var(--border); color: var(--text); } .tb-toggle:hover { background: var(--border); color: var(--text); }
.tb-title { font-size: 15px; font-weight: 600; flex: 1; } .tb-title { font-size: 15px; font-weight: 600; flex: 1; }
.tb-right { display: flex; align-items: center; gap: 8px; } .tb-right { display: flex; align-items: center; gap: 8px; }
/* MAIN */ /* MAIN */
#main { #main {
margin-left: var(--sidebar-width); margin-left: var(--sidebar-width);
margin-top: var(--topbar-h); margin-top: var(--topbar-h);
padding: 24px; padding: 24px;
min-height: calc(100vh - var(--topbar-h)); min-height: calc(100vh - var(--topbar-h));
transition: var(--trans); transition: var(--trans);
} }
#sidebar.collapsed ~ #main { margin-left: var(--sidebar-col-width); } #sidebar.collapsed ~ #main { margin-left: var(--sidebar-col-width); }
/* CARDS */ /* CARDS */
.pcard { background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 20px; } .pcard { background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.pcard-sm { padding: 16px; } .pcard-sm { padding: 16px; }
.pcard-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 6px; } .pcard-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 6px; }
/* STAT CARDS */ /* STAT CARDS */
.stat-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; } .stat-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; }
.stat-card .stat-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); } .stat-card .stat-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.stat-card .stat-value { font-size: 24px; font-weight: 600; line-height: 1.2; margin-top: 4px; font-family: 'DM Mono', monospace; } .stat-card .stat-value { font-size: 24px; font-weight: 600; line-height: 1.2; margin-top: 4px; font-family: 'DM Mono', monospace; }
.stat-card .stat-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; } .stat-card .stat-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; }
/* FLASH */ /* FLASH */
.flash-wrap { .flash-wrap {
position: fixed; top: calc(var(--topbar-h) + 12px); right: 16px; position: fixed; top: calc(var(--topbar-h) + 12px); right: 16px;
z-index: 2000; display: flex; flex-direction: column; gap: 8px; max-width: 360px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; max-width: 360px;
} }
/* BADGES */ /* BADGES */
.badge-income { background: #d1fae5; color: #065f46; } .badge-income { background: #d1fae5; color: #065f46; }
.badge-expense { background: #fee2e2; color: #991b1b; } .badge-expense { background: #fee2e2; color: #991b1b; }
.badge-transfer { background: #dbeafe; color: #1e40af; } .badge-transfer { background: #dbeafe; color: #1e40af; }
/* UTILITIES */ /* UTILITIES */
.text-income { color: var(--income) !important; } .text-income { color: var(--income) !important; }
.text-expense { color: var(--expense) !important; } .text-expense { color: var(--expense) !important; }
.text-invest { color: var(--invest) !important; } .text-invest { color: var(--invest) !important; }
.mono { font-family: 'DM Mono', monospace; } .mono { font-family: 'DM Mono', monospace; }
/* TABLE */ /* TABLE */
.pfm-table { width: 100%; border-collapse: collapse; } .pfm-table { width: 100%; border-collapse: collapse; }
.pfm-table th { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; } .pfm-table th { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.pfm-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; } .pfm-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.pfm-table tbody tr:hover { background: #f8fafc; } .pfm-table tbody tr:hover { background: #f8fafc; }
.pfm-table tbody tr:last-child td { border-bottom: none; } .pfm-table tbody tr:last-child td { border-bottom: none; }
/* RESPONSIVE */ /* RESPONSIVE */
@media (max-width: 768px) { @media (max-width: 768px) {
#sidebar { transform: translateX(-100%); width: var(--sidebar-width) !important; } #sidebar { transform: translateX(-100%); width: var(--sidebar-width) !important; }
#sidebar.mob-open { transform: translateX(0); } #sidebar.mob-open { transform: translateX(0); }
#topbar, #sidebar.collapsed ~ #topbar { left: 0 !important; } #topbar, #sidebar.collapsed ~ #topbar { left: 0 !important; }
#main, #sidebar.collapsed ~ #main { margin-left: 0 !important; } #main, #sidebar.collapsed ~ #main { margin-left: 0 !important; }
} }
.sb-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1039; } .sb-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1039; }
.sb-overlay.on { display: block; } .sb-overlay.on { display: block; }
@keyframes spin { to { transform: rotate(360deg); } } @keyframes spin { to { transform: rotate(360deg); } }
{% block extra_css %}{% endblock %} {% block extra_css %}{% endblock %}
</style> </style>
</head> </head>
<body> <body>
<div class="sb-overlay" id="sbOverlay"></div>
<div class="sb-overlay" id="sbOverlay"></div> <!-- SIDEBAR -->
<nav id="sidebar">
<!-- SIDEBAR --> <div class="sb-brand">
<nav id="sidebar">
<div class="sb-brand">
<div class="b-icon"><i class="bi bi-currency-exchange"></i></div> <div class="b-icon"><i class="bi bi-currency-exchange"></i></div>
<span class="b-text">PFM</span> <span class="b-text">PFM</span>
</div> </div>
<div class="sb-nav"> <div class="sb-nav">
<a href="{{ url_for('dashboard.index') }}" class="sb-link {% if request.endpoint == 'dashboard.index' %}active{% endif %}"> <a
<i class="bi bi-grid-1x2"></i><span class="lt">Dashboard</span> href="{{ url_for('dashboard.index') }}"
class="sb-link {% if request.endpoint == 'dashboard.index' %}active{% endif %}"
>
<i class="bi bi-grid-1x2"></i><span class="lt">Dashboard</span>
</a> </a>
<div class="sb-section">Money</div> <div class="sb-section">Money</div>
<a href="{{ url_for('transactions.index') }}" class="sb-link {% if request.blueprint == 'transactions' %}active{% endif %}"> <a
<i class="bi bi-arrow-left-right"></i><span class="lt">Transactions</span> href="{{ url_for('transactions.index') }}"
class="sb-link {% if request.blueprint == 'transactions' %}active{% endif %}"
>
<i class="bi bi-arrow-left-right"></i
><span class="lt">Transactions</span>
</a> </a>
<a href="{{ url_for('transactions.new', type='income') }}" class="sb-link"> <a
<i class="bi bi-arrow-down-circle"></i><span class="lt">Add Income</span> href="{{ url_for('transactions.new', type='income') }}"
class="sb-link"
>
<i class="bi bi-arrow-down-circle"></i
><span class="lt">Add Income</span>
</a> </a>
<a href="{{ url_for('transactions.new', type='expense') }}" class="sb-link"> <a
<i class="bi bi-arrow-up-circle"></i><span class="lt">Add Expense</span> href="{{ url_for('transactions.new', type='expense') }}"
class="sb-link"
>
<i class="bi bi-arrow-up-circle"></i
><span class="lt">Add Expense</span>
</a> </a>
<a href="{{ url_for('accounts.index') }}" class="sb-link {% if request.blueprint == 'accounts' %}active{% endif %}"> <a
<i class="bi bi-wallet2"></i><span class="lt">Accounts</span> href="{{ url_for('accounts.index') }}"
class="sb-link {% if request.blueprint == 'accounts' %}active{% endif %}"
>
<i class="bi bi-wallet2"></i><span class="lt">Accounts</span>
</a> </a>
<div class="sb-section">Planning</div> <div class="sb-section">Planning</div>
<a href="{{ url_for('budgets.index') }}" class="sb-link {% if request.blueprint == 'budgets' %}active{% endif %}"> <a
<i class="bi bi-pie-chart"></i><span class="lt">Budgets</span> href="{{ url_for('budgets.index') }}"
class="sb-link {% if request.blueprint == 'budgets' %}active{% endif %}"
>
<i class="bi bi-pie-chart"></i><span class="lt">Budgets</span>
</a> </a>
<a href="{{ url_for('goals.index') }}" class="sb-link {% if request.blueprint == 'goals' %}active{% endif %}"> <a
<i class="bi bi-bullseye"></i><span class="lt">Goals</span> href="{{ url_for('goals.index') }}"
class="sb-link {% if request.blueprint == 'goals' %}active{% endif %}"
>
<i class="bi bi-bullseye"></i><span class="lt">Goals</span>
</a> </a>
<div class="sb-section">Growth</div> <div class="sb-section">Growth</div>
<a href="{{ url_for('investments.index') }}" class="sb-link {% if request.blueprint == 'investments' %}active{% endif %}"> <a
<i class="bi bi-graph-up-arrow"></i><span class="lt">Investments</span> href="{{ url_for('investments.index') }}"
class="sb-link {% if request.blueprint == 'investments' %}active{% endif %}"
>
<i class="bi bi-graph-up-arrow"></i
><span class="lt">Investments</span>
</a> </a>
<a href="{{ url_for('reports.index') }}" class="sb-link {% if request.blueprint == 'reports' %}active{% endif %}"> <a
<i class="bi bi-file-earmark-bar-graph"></i><span class="lt">Reports</span> href="{{ url_for('reports.index') }}"
class="sb-link {% if request.blueprint == 'reports' %}active{% endif %}"
>
<i class="bi bi-file-earmark-bar-graph"></i
><span class="lt">Reports</span>
</a> </a>
<div class="sb-section">AI</div> <div class="sb-section">AI</div>
<a href="{{ url_for('ai.index') }}" class="sb-link {% if request.blueprint == 'ai' %}active{% endif %}"> <a
<i class="bi bi-stars"></i><span class="lt">AI Assistant</span> href="{{ url_for('ai.index') }}"
class="sb-link {% if request.blueprint == 'ai' %}active{% endif %}"
>
<i class="bi bi-stars"></i><span class="lt">AI Assistant</span>
</a> </a>
</div> </div>
<div class="sb-footer"> <div class="sb-footer">
<a href="{{ url_for('categories.index') }}" class="sb-link {% if request.blueprint == 'categories' %}active{% endif %}"> <a
<i class="bi bi-tags"></i><span class="lt">Categories</span> href="{{ url_for('categories.index') }}"
class="sb-link {% if request.blueprint == 'categories' %}active{% endif %}"
>
<i class="bi bi-tags"></i><span class="lt">Categories</span>
</a> </a>
<a href="{{ url_for('settings.profile') }}" class="sb-link {% if request.blueprint == 'settings' %}active{% endif %}"> <a
<i class="bi bi-gear"></i><span class="lt">Settings</span> href="{{ url_for('settings.index') }}"
class="sb-link {% if request.blueprint == 'settings' %}active{% endif %}"
>
<i class="bi bi-gear"></i><span class="lt">Settings</span>
</a> </a>
<a href="{{ url_for('auth.logout') }}" class="sb-link"> <a href="{{ url_for('auth.logout') }}" class="sb-link">
<i class="bi bi-box-arrow-right"></i><span class="lt">Logout</span> <i class="bi bi-box-arrow-right"></i><span class="lt">Logout</span>
</a> </a>
</div> </div>
</nav> </nav>
<!-- TOPBAR --> <!-- TOPBAR -->
<header id="topbar"> <header id="topbar">
<button class="tb-toggle" id="sbToggle"><i class="bi bi-list"></i></button> <button class="tb-toggle" id="sbToggle">
<span class="tb-title">{% block page_title %}{% endblock %}</span> <i class="bi bi-list"></i>
<div class="tb-right"> </button>
<span class="tb-title">{% block page_title %}{% endblock %}</span>
<div class="tb-right">
{% block topbar_actions %}{% endblock %} {% block topbar_actions %}{% endblock %}
<span class="d-none d-sm-inline small text-muted mono">{{ current_user.display_name or current_user.username }}</span> <span class="d-none d-sm-inline small text-muted mono"
>{{ current_user.display_name or current_user.username }}</span
>
</div>
</header>
<!-- FLASH -->
<div class="flash-wrap">
{% with messages = get_flashed_messages(with_categories=true) %} {% for
cat, msg in messages %}
<div
class="alert alert-{{ 'danger' if cat == 'error' else cat }} alert-dismissible fade show shadow-sm mb-0 py-2 px-3"
style="font-size: 13px; border-radius: 8px"
role="alert"
>
{{ msg }}<button
type="button"
class="btn-close"
style="padding: 0.4rem"
data-bs-dismiss="alert"
></button>
</div>
{% endfor %} {% endwith %}
</div> </div>
</header>
<!-- FLASH --> <!-- MAIN -->
<div class="flash-wrap"> <main id="main">{% block content %}{% endblock %}</main>
{% with messages = get_flashed_messages(with_categories=true) %}
{% for cat, msg in messages %}
<div class="alert alert-{{ 'danger' if cat == 'error' else cat }} alert-dismissible fade show shadow-sm mb-0 py-2 px-3" style="font-size:13px;border-radius:8px;" role="alert">
{{ msg }}<button type="button" class="btn-close" style="padding:.4rem;" data-bs-dismiss="alert"></button>
</div>
{% endfor %}
{% endwith %}
</div>
<!-- MAIN --> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
<main id="main">{% block content %}{% endblock %}</main> <script>
(function () {
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script> const sb = document.getElementById("sidebar");
<script> const overlay = document.getElementById("sbOverlay");
(function(){ const KEY = "pfm_sb";
const sb = document.getElementById('sidebar'); const mob = () => window.innerWidth < 769;
const overlay = document.getElementById('sbOverlay'); if (!mob() && localStorage.getItem(KEY) === "1")
const KEY = 'pfm_sb'; sb.classList.add("collapsed");
const mob = () => window.innerWidth < 769; document
if (!mob() && localStorage.getItem(KEY)==='1') sb.classList.add('collapsed'); .getElementById("sbToggle")
document.getElementById('sbToggle').addEventListener('click', function(){ .addEventListener("click", function () {
if (mob()) { sb.classList.toggle('mob-open'); overlay.classList.toggle('on'); } if (mob()) {
else { sb.classList.toggle('collapsed'); localStorage.setItem(KEY, sb.classList.contains('collapsed')?'1':'0'); } sb.classList.toggle("mob-open");
}); overlay.classList.toggle("on");
overlay.addEventListener('click', function(){ sb.classList.remove('mob-open'); overlay.classList.remove('on'); }); } else {
document.querySelectorAll('.flash-wrap .alert').forEach(function(el){ sb.classList.toggle("collapsed");
setTimeout(function(){ bootstrap.Alert.getOrCreateInstance(el).close(); }, 4500); localStorage.setItem(
}); KEY,
})(); sb.classList.contains("collapsed") ? "1" : "0",
</script> );
{% block extra_js %}{% endblock %} }
</body> });
overlay.addEventListener("click", function () {
sb.classList.remove("mob-open");
overlay.classList.remove("on");
});
document.querySelectorAll(".flash-wrap .alert").forEach(function (el) {
setTimeout(function () {
bootstrap.Alert.getOrCreateInstance(el).close();
}, 4500);
});
})();
</script>
{% block extra_js %}{% endblock %}
</body>
</html> </html>