batman (working version kinda)
This commit is contained in:
commit
6dd38036e7
65 changed files with 3950 additions and 0 deletions
147
app/templates/layout.html
Normal file
147
app/templates/layout.html
Normal file
|
@ -0,0 +1,147 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{{ title if title else 'Network Documentation' }}</title>
|
||||
<!-- Bootstrap CSS -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<!-- Tabler Icons -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@tabler/icons-webfont@2.22.0/tabler-icons.min.css">
|
||||
<!-- Font Awesome -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
||||
<!-- Google Fonts -->
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
|
||||
<!-- Custom CSS -->
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/app.css') }}">
|
||||
{% block styles %}{% endblock %}
|
||||
</head>
|
||||
|
||||
<body class="{{ 'auth-page' if not current_user.is_authenticated else '' }}">
|
||||
<!-- Notification Area -->
|
||||
<div id="notification-area"></div>
|
||||
|
||||
{% if current_user.is_authenticated %}
|
||||
<!-- Sidebar for authenticated users -->
|
||||
<aside class="sidebar">
|
||||
<div class="sidebar-brand">
|
||||
<span class="ti ti-network"></span>
|
||||
<span class="sidebar-brand-text">NetDocs</span>
|
||||
</div>
|
||||
|
||||
<div class="sidebar-nav">
|
||||
<div class="sidebar-heading">Main</div>
|
||||
<a href="{{ url_for('dashboard.dashboard_home') }}"
|
||||
class="sidebar-item {{ 'active' if request.endpoint == 'dashboard.dashboard_home' }}">
|
||||
<span class="ti ti-dashboard me-2"></span> Dashboard
|
||||
</a>
|
||||
<a href="{{ url_for('dashboard.server_list') }}"
|
||||
class="sidebar-item {{ 'active' if request.endpoint and request.endpoint.startswith('dashboard.server') }}">
|
||||
<span class="ti ti-server me-2"></span> Servers
|
||||
</a>
|
||||
<a href="{{ url_for('ipam.ipam_home') }}"
|
||||
class="sidebar-item {{ 'active' if request.endpoint and request.endpoint.startswith('ipam.') }}">
|
||||
<span class="ti ti-network me-2"></span> IPAM
|
||||
</a>
|
||||
|
||||
<div class="sidebar-heading">Management</div>
|
||||
<a href="{{ url_for('dashboard.server_new') }}" class="sidebar-item">
|
||||
<span class="ti ti-plus me-2"></span> Add Server
|
||||
</a>
|
||||
<a href="{{ url_for('ipam.subnet_new') }}" class="sidebar-item">
|
||||
<span class="ti ti-plus me-2"></span> Add Subnet
|
||||
</a>
|
||||
|
||||
<div class="sidebar-heading">User</div>
|
||||
<a href="{{ url_for('auth.logout') }}" class="sidebar-item">
|
||||
<span class="ti ti-logout me-2"></span> Logout
|
||||
</a>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
<!-- Main Content for authenticated users -->
|
||||
<div class="main-content">
|
||||
<!-- Top Navbar -->
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-white border-bottom mb-4">
|
||||
<div class="container-fluid">
|
||||
<button class="sidebar-toggler btn btn-outline-secondary d-lg-none me-2">
|
||||
<span class="ti ti-menu-2"></span>
|
||||
</button>
|
||||
|
||||
<span class="navbar-brand d-none d-lg-block">
|
||||
{{ title if title else 'Network Documentation' }}
|
||||
</span>
|
||||
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="dropdown">
|
||||
<a href="#" class="d-flex align-items-center text-decoration-none dropdown-toggle"
|
||||
id="user-dropdown" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
<span class="d-none d-md-inline me-2">{{ current_user.email }}</span>
|
||||
<span class="ti ti-user"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="user-dropdown">
|
||||
<li><a class="dropdown-item" href="{{ url_for('auth.logout') }}">Logout</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<!-- Flash Messages -->
|
||||
<div class="container-fluid mt-3">
|
||||
{% with messages = get_flashed_messages(with_categories=true) %}
|
||||
{% if messages %}
|
||||
{% for category, message in messages %}
|
||||
<div class="alert alert-{{ category }} alert-dismissible fade show" role="alert">
|
||||
{{ message }}
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
</div>
|
||||
{% else %}
|
||||
<!-- Simple flash message container for non-authenticated users -->
|
||||
<div class="container mt-3">
|
||||
{% with messages = get_flashed_messages(with_categories=true) %}
|
||||
{% if messages %}
|
||||
{% for category, message in messages %}
|
||||
<div class="alert alert-{{ category }} alert-dismissible fade show" role="alert">
|
||||
{{ message }}
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- ONLY ONE CONTENT BLOCK FOR BOTH AUTHENTICATED AND NON-AUTHENTICATED STATES -->
|
||||
<div class="{{ 'py-4' if current_user.is_authenticated else '' }}">
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
|
||||
{% if current_user.is_authenticated %}
|
||||
</div> <!-- End of main-content div that was opened for authenticated users -->
|
||||
{% endif %}
|
||||
|
||||
<!-- Bootstrap JS -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<!-- HTMX for dynamic content -->
|
||||
<script src="https://unpkg.com/htmx.org@1.9.2"></script>
|
||||
<!-- Custom JS -->
|
||||
<script src="{{ url_for('static', filename='js/app.js') }}"></script>
|
||||
<script>
|
||||
// Sidebar toggle for mobile - using modern event listener approach
|
||||
const sidebarToggler = document.querySelector('.sidebar-toggler');
|
||||
if (sidebarToggler) {
|
||||
sidebarToggler.addEventListener('click', () => {
|
||||
document.querySelector('.sidebar').classList.toggle('show');
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{% block scripts %}{% endblock %}
|
||||
</body>
|
||||
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue