239 lines
7.7 KiB
HTML
239 lines
7.7 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>{% block title %}Admin Dashboard - Moto Adventure{% endblock %}</title>
|
|
<link rel="icon" type="image/x-icon" href="{{ url_for('static', filename='favicon.ico') }}">
|
|
|
|
<!-- Bootstrap CSS -->
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
<!-- Font Awesome -->
|
|
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
|
|
|
|
<style>
|
|
body {
|
|
font-size: 0.875rem;
|
|
background-color: #f8f9fa;
|
|
}
|
|
|
|
.sidebar {
|
|
position: fixed;
|
|
top: 0;
|
|
bottom: 0;
|
|
left: 0;
|
|
z-index: 100;
|
|
padding: 48px 0 0;
|
|
box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
|
|
background-color: #343a40;
|
|
width: 240px;
|
|
}
|
|
|
|
.sidebar-sticky {
|
|
position: relative;
|
|
top: 0;
|
|
height: calc(100vh - 48px);
|
|
padding-top: .5rem;
|
|
overflow-x: hidden;
|
|
overflow-y: auto;
|
|
}
|
|
|
|
.sidebar .nav-link {
|
|
color: rgba(255, 255, 255, .75);
|
|
padding: 10px 20px;
|
|
border-radius: 0;
|
|
}
|
|
|
|
.sidebar .nav-link:hover {
|
|
color: #fff;
|
|
background-color: rgba(255, 255, 255, .1);
|
|
}
|
|
|
|
.sidebar .nav-link.active {
|
|
color: #fff;
|
|
background-color: #007bff;
|
|
}
|
|
|
|
.sidebar-heading {
|
|
font-size: .75rem;
|
|
text-transform: uppercase;
|
|
color: rgba(255, 255, 255, .5);
|
|
padding: 15px 20px 5px;
|
|
}
|
|
|
|
.main-content {
|
|
margin-left: 240px;
|
|
padding: 20px;
|
|
min-height: 100vh;
|
|
}
|
|
|
|
.navbar-brand {
|
|
color: #fff !important;
|
|
background-color: #007bff;
|
|
padding: 10px 20px;
|
|
margin: 0;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.card {
|
|
border: none;
|
|
box-shadow: 0 0.15rem 1.75rem 0 rgba(33, 40, 50, 0.15);
|
|
margin-bottom: 1.5rem;
|
|
}
|
|
|
|
.card-header {
|
|
background-color: #fff;
|
|
border-bottom: 1px solid rgba(33, 40, 50, 0.125);
|
|
font-weight: 600;
|
|
}
|
|
|
|
.border-left-primary {
|
|
border-left: 0.25rem solid #4e73df !important;
|
|
}
|
|
|
|
.border-left-success {
|
|
border-left: 0.25rem solid #1cc88a !important;
|
|
}
|
|
|
|
.border-left-warning {
|
|
border-left: 0.25rem solid #f6c23e !important;
|
|
}
|
|
|
|
.border-left-info {
|
|
border-left: 0.25rem solid #36b9cc !important;
|
|
}
|
|
|
|
.text-xs {
|
|
font-size: 0.7rem;
|
|
}
|
|
|
|
.text-gray-800 {
|
|
color: #5a5c69 !important;
|
|
}
|
|
|
|
.text-gray-300 {
|
|
color: #dddfeb !important;
|
|
}
|
|
|
|
.table th {
|
|
border-top: none;
|
|
font-weight: 600;
|
|
font-size: 0.8rem;
|
|
color: #5a5c69;
|
|
background-color: #f8f9fc;
|
|
}
|
|
|
|
@media (max-width: 768px) {
|
|
.sidebar {
|
|
transform: translateX(-100%);
|
|
transition: transform 0.3s;
|
|
}
|
|
|
|
.sidebar.show {
|
|
transform: translateX(0);
|
|
}
|
|
|
|
.main-content {
|
|
margin-left: 0;
|
|
}
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<!-- Sidebar -->
|
|
<nav class="sidebar" id="sidebar">
|
|
<div class="navbar-brand">
|
|
<i class="fas fa-cogs"></i> Admin Panel
|
|
</div>
|
|
<div class="sidebar-sticky">
|
|
<div class="sidebar-heading">
|
|
Administration
|
|
</div>
|
|
<ul class="nav flex-column">
|
|
<li class="nav-item">
|
|
<a class="nav-link {{ 'active' if request.endpoint == 'admin.dashboard' }}" href="{{ url_for('admin.dashboard') }}">
|
|
<i class="fas fa-tachometer-alt"></i> Dashboard
|
|
</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link {{ 'active' if request.endpoint == 'admin.posts' }}" href="{{ url_for('admin.posts') }}">
|
|
<i class="fas fa-file-alt"></i> Posts
|
|
{% if pending_posts_count %}
|
|
<span class="badge bg-warning text-dark ms-2">{{ pending_posts_count }}</span>
|
|
{% endif %}
|
|
</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link {{ 'active' if request.endpoint == 'admin.users' }}" href="{{ url_for('admin.users') }}">
|
|
<i class="fas fa-users"></i> Users
|
|
</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link {{ 'active' if request.endpoint == 'admin.analytics' }}" href="{{ url_for('admin.analytics') }}">
|
|
<i class="fas fa-chart-bar"></i> Analytics
|
|
</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link {{ 'active' if request.endpoint == 'admin.mail_settings' }}" href="{{ url_for('admin.mail_settings') }}">
|
|
<i class="fas fa-envelope"></i> Mail Server Settings
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
|
|
<div class="sidebar-heading">
|
|
Quick Actions
|
|
</div>
|
|
<ul class="nav flex-column">
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="{{ url_for('community.index') }}" target="_blank">
|
|
<i class="fas fa-external-link-alt"></i> View Site
|
|
</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="{{ url_for('admin.posts', status='pending') }}">
|
|
<i class="fas fa-clock"></i> Pending Posts
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</nav>
|
|
|
|
<!-- Main Content -->
|
|
<div class="main-content">
|
|
<!-- Mobile menu button -->
|
|
<button class="btn btn-primary d-md-none mb-3" type="button" id="sidebarToggle">
|
|
<i class="fas fa-bars"></i>
|
|
</button>
|
|
|
|
<!-- Flash Messages -->
|
|
{% with messages = get_flashed_messages(with_categories=true) %}
|
|
{% if messages %}
|
|
{% for category, message in messages %}
|
|
<div class="alert alert-{{ 'danger' if category == 'error' else 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 %}
|
|
|
|
{% block admin_content %}{% endblock %}
|
|
</div>
|
|
|
|
<!-- Bootstrap JS -->
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
|
|
|
|
<script>
|
|
// Mobile sidebar toggle
|
|
document.getElementById('sidebarToggle')?.addEventListener('click', function() {
|
|
document.getElementById('sidebar').classList.toggle('show');
|
|
});
|
|
|
|
// Auto-refresh stats every 30 seconds
|
|
setTimeout(function() {
|
|
location.reload();
|
|
}, 30000);
|
|
</script>
|
|
</body>
|
|
</html>
|