238 lines
8.7 KiB
HTML
238 lines
8.7 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block content %}
|
|
<div class="container-fluid">
|
|
<div class="row">
|
|
<!-- Sidebar Toggle Button (mobile only) -->
|
|
<button class="btn sidebar-toggle d-md-none" id="sidebarToggleBtn" aria-label="Toggle sidebar navigation" aria-expanded="false" aria-controls="sidebar">
|
|
<i class="bi bi-list"></i> Menu
|
|
</button>
|
|
|
|
<!-- Sidebar -->
|
|
<div class="col-md-3 col-lg-2 d-md-block bg-light sidebar collapse" id="sidebar">
|
|
<div class="position-sticky pt-3">
|
|
<h5 class="sidebar-heading d-flex justify-content-between align-items-center px-3 mb-1 text-muted">
|
|
<span>Dashboard</span>
|
|
</h5>
|
|
<ul class="nav flex-column">
|
|
<li class="nav-item">
|
|
<a class="nav-link {% if active_section == 'home' %}active{% endif %}" href="/dashboard">
|
|
<i class="bi bi-speedometer2 me-1"></i>
|
|
Overview
|
|
</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link {% if active_section == 'user' %}active{% endif %}" href="/dashboard/user">
|
|
<i class="bi bi-person me-1"></i>
|
|
User
|
|
</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link {% if active_section == 'resource_provider' %}active{% endif %}" href="/dashboard/resource_provider">
|
|
<i class="bi bi-hdd-rack me-1"></i>
|
|
Resource Provider
|
|
</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link {% if active_section == 'application_provider' %}active{% endif %}" href="/dashboard/application-provider">
|
|
<i class="bi bi-app me-1"></i>
|
|
Application Provider
|
|
</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link {% if active_section == 'service_provider' %}active{% endif %}" href="/dashboard/service-provider">
|
|
<i class="bi bi-person-workspace me-1"></i>
|
|
Service Provider
|
|
</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link {% if active_section == 'wallet' %}active{% endif %}" href="/dashboard/wallet">
|
|
<i class="bi bi-wallet2 me-1"></i>
|
|
Wallet
|
|
</a>
|
|
</li>
|
|
|
|
<!-- Shopping & Orders Section -->
|
|
<h6 class="sidebar-heading d-flex justify-content-between align-items-center px-3 mt-4 mb-1 text-muted">
|
|
<span>Shopping</span>
|
|
</h6>
|
|
<li class="nav-item">
|
|
<a class="nav-link {% if active_section == 'cart' %}active{% endif %}" href="/dashboard/cart" id="cartNavLink">
|
|
<i class="bi bi-cart3 me-1"></i>
|
|
Shopping Cart
|
|
</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link {% if active_section == 'orders' %}active{% endif %}" href="/dashboard/orders">
|
|
<i class="bi bi-receipt me-1"></i>
|
|
Order History
|
|
</a>
|
|
</li>
|
|
|
|
<!-- HIDE: Pools navigation - keeping for future use
|
|
<li class="nav-item">
|
|
<a class="nav-link {% if active_section == 'pools' %}active{% endif %}" href="/dashboard/pools">
|
|
<i class="bi bi-currency-exchange me-1"></i>
|
|
Credits Pools
|
|
</a>
|
|
</li>
|
|
-->
|
|
|
|
<!-- Communication Section -->
|
|
<h6 class="sidebar-heading d-flex justify-content-between align-items-center px-3 mt-4 mb-1 text-muted">
|
|
<span>Communication</span>
|
|
</h6>
|
|
<li class="nav-item">
|
|
<a class="nav-link position-relative {% if active_section == 'messages' %}active{% endif %}" href="/dashboard/messages">
|
|
<i class="bi bi-chat-dots me-1"></i>
|
|
Messages
|
|
<span class="badge bg-danger rounded-pill ms-auto message-badge" style="display: none; font-size: 0.7rem;">0</span>
|
|
</a>
|
|
</li>
|
|
|
|
<!-- Settings Section -->
|
|
<h6 class="sidebar-heading d-flex justify-content-between align-items-center px-3 mt-4 mb-1 text-muted">
|
|
<span>Account</span>
|
|
</h6>
|
|
<li class="nav-item">
|
|
<a class="nav-link {% if active_section == 'settings' %}active{% endif %}" href="/dashboard/settings">
|
|
<i class="bi bi-gear me-1"></i>
|
|
Settings
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Main Content -->
|
|
<div class="col-md-9 ms-sm-auto col-lg-10 px-md-4 main-content-wrapper position-relative">
|
|
<!-- Sidebar Backdrop (mobile only) - positioned here so it doesn't cover the sidebar -->
|
|
<div class="sidebar-backdrop d-md-none" id="sidebarBackdrop"></div>
|
|
{% block dashboard_content %}
|
|
<!-- Content will be injected here by child templates -->
|
|
{% endblock %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|
|
|
|
{% block head %}
|
|
<!-- Add Bootstrap Icons -->
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.8.0/font/bootstrap-icons.css">
|
|
|
|
<style>
|
|
.sidebar {
|
|
position: fixed;
|
|
top: 56px; /* Navbar height */
|
|
bottom: 0;
|
|
left: 0;
|
|
z-index: 100;
|
|
padding: 20px 0 0;
|
|
box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
|
|
height: 100%; /* Full height */
|
|
overflow-y: auto;
|
|
}
|
|
|
|
/* Footer should only appear on the right side */
|
|
@media (min-width: 768px) {
|
|
.footer {
|
|
margin-left: 25%; /* Matches the width of col-md-3 */
|
|
}
|
|
}
|
|
|
|
@media (min-width: 992px) {
|
|
.footer {
|
|
margin-left: 16.666667%; /* Matches the width of col-lg-2 */
|
|
}
|
|
}
|
|
|
|
.sidebar-heading {
|
|
font-size: .75rem;
|
|
text-transform: uppercase;
|
|
}
|
|
|
|
.sidebar .nav-link {
|
|
font-weight: 500;
|
|
color: #333;
|
|
}
|
|
|
|
.sidebar .nav-link.active {
|
|
color: #2470dc;
|
|
}
|
|
|
|
.dashboard-section {
|
|
padding: 20px;
|
|
margin-bottom: 20px;
|
|
border-radius: 5px;
|
|
background-color: #f8f9fa;
|
|
box-shadow: 0 .125rem .25rem rgba(0, 0, 0, .075);
|
|
}
|
|
|
|
.dashboard-card {
|
|
border: 1px solid #dee2e6;
|
|
border-radius: 5px;
|
|
padding: 15px;
|
|
margin-bottom: 20px;
|
|
background-color: white;
|
|
transition: all 0.3s ease;
|
|
}
|
|
|
|
.dashboard-card:hover {
|
|
box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15);
|
|
}
|
|
|
|
.stats-card {
|
|
border-left: 4px solid;
|
|
background-color: white;
|
|
padding: 15px;
|
|
margin-bottom: 20px;
|
|
border-radius: 5px;
|
|
box-shadow: 0 .125rem .25rem rgba(0, 0, 0, .075);
|
|
}
|
|
|
|
.stats-card.primary {
|
|
border-left-color: #007bff;
|
|
}
|
|
|
|
.stats-card.success {
|
|
border-left-color: #28a745;
|
|
}
|
|
|
|
.stats-card.info {
|
|
border-left-color: #17a2b8;
|
|
}
|
|
|
|
.stats-card.warning {
|
|
border-left-color: #ffc107;
|
|
}
|
|
|
|
.badge-role {
|
|
font-size: 0.75rem;
|
|
padding: 0.25rem 0.5rem;
|
|
margin-right: 5px;
|
|
}
|
|
|
|
/* Adjust for fixed navbar */
|
|
main.py-4 {
|
|
padding-top: 4.5rem !important;
|
|
}
|
|
|
|
/* Removed conflicting media query */
|
|
</style>
|
|
{% endblock %}
|
|
|
|
{% block scripts %}
|
|
<script src="/static/js/dashboard_layout.js"></script>
|
|
<script src="/static/js/messaging-system.js"></script>
|
|
<script>
|
|
// Dynamic user detection for messaging system
|
|
try {
|
|
// Initialize messaging system with dynamic user detection
|
|
if (window.MessagingSystem) {
|
|
window.MessagingSystem.initializeWithDynamicUser();
|
|
}
|
|
} catch (error) {
|
|
console.error('Failed to initialize messaging system:', error);
|
|
}
|
|
</script>
|
|
{% endblock %} |