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