Files
2026-05-08 10:15:40 -04:00

196 lines
8.2 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 %}Salon POS{% endblock %}</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.css">
<link rel="stylesheet" href="{{ url_for('static', filename='css/tenant.css') }}">
</head>
<body class="bg-light">
{% if current_user.is_authenticated %}
<!-- Top navbar -->
<nav class="navbar navbar-expand-lg navbar-dark bg-primary">
<div class="container-fluid">
<a class="navbar-brand fw-bold" href="{{ url_for('dashboard.index') }}">
<i class="bi bi-scissors me-2"></i>
{% if g.tenant is defined and g.tenant %}{{ g.tenant.name }}{% else %}Salon POS{% endif %}
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarMain">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarMain">
<!-- Location switcher (tenant_admin and tenant_manager only) -->
{% if current_user.role in ('tenant_admin', 'tenant_manager') %}
<div class="navbar-nav me-3">
<div class="nav-item dropdown">
<a class="nav-link dropdown-toggle text-white" href="#" role="button" data-bs-toggle="dropdown">
<i class="bi bi-geo-alt me-1"></i>
{% if g.location is defined and g.location %}{{ g.location.name }}{% else %}Select Location{% endif %}
</a>
<ul class="dropdown-menu">
{% if locations is defined %}
{% for loc in locations %}
<li>
<a class="dropdown-item {% if g.location and g.location.id == loc.id %}active{% endif %}"
href="{{ url_for('locations.switch', location_id=loc.id) }}">
{{ loc.name }}
{% if loc.is_primary %}<span class="badge bg-secondary ms-1">Primary</span>{% endif %}
</a>
</li>
{% endfor %}
{% endif %}
</ul>
</div>
</div>
{% endif %}
<!-- Demo badge -->
{% if g.tenant is defined and g.tenant and g.tenant.is_demo %}
<span class="badge bg-warning text-dark me-3">Demo Mode — Read Only</span>
{% endif %}
<div class="navbar-nav ms-auto">
<span class="navbar-text text-white me-3">
<i class="bi bi-person-circle me-1"></i>{{ current_user.name if current_user.name is defined else current_user.email }}
</span>
{% if current_user.role == 'tenant_staff' %}
<a class="nav-link text-warning" href="{{ url_for('staff_auth.staff_logout') }}">
<i class="bi bi-box-arrow-right"></i> Logout
</a>
{% else %}
<a class="nav-link text-warning" href="{{ url_for('tenant_auth.logout') }}">
<i class="bi bi-box-arrow-right"></i> Logout
</a>
{% endif %}
</div>
</div>
</div>
</nav>
<div class="container-fluid">
<div class="row">
<!-- Sidebar (hidden for tenant_staff) -->
{% if current_user.role != 'tenant_staff' %}
<nav class="col-md-2 d-none d-md-block bg-white border-end sidebar pt-3">
<ul class="nav flex-column">
<li class="nav-item">
<a class="nav-link {% if request.endpoint and 'dashboard' in request.endpoint %}active fw-bold{% endif %}"
href="{{ url_for('dashboard.index') }}">
<i class="bi bi-speedometer2 me-2"></i>Dashboard
</a>
</li>
<li class="nav-item">
<a class="nav-link {% if request.endpoint and 'appointments' in request.endpoint %}active fw-bold{% endif %}"
href="{{ url_for('appointments.index') }}">
<i class="bi bi-calendar3 me-2"></i>Appointments
</a>
</li>
<li class="nav-item">
<a class="nav-link {% if request.endpoint and 'pos' in request.endpoint %}active fw-bold{% endif %}"
href="{{ url_for('pos.checkout') }}">
<i class="bi bi-cash-register me-2"></i>POS / Checkout
</a>
</li>
<li class="nav-item">
<a class="nav-link {% if request.endpoint and 'customers' in request.endpoint %}active fw-bold{% endif %}"
href="{{ url_for('customers.index') }}">
<i class="bi bi-people me-2"></i>Customers
</a>
</li>
<li class="nav-item">
<a class="nav-link {% if request.endpoint and 'staff' in request.endpoint %}active fw-bold{% endif %}"
href="{{ url_for('staff.index') }}">
<i class="bi bi-person-badge me-2"></i>Staff
</a>
</li>
<li class="nav-item">
<a class="nav-link {% if request.endpoint and 'services' in request.endpoint %}active fw-bold{% endif %}"
href="{{ url_for('services.index') }}">
<i class="bi bi-card-list me-2"></i>Services & Products
</a>
</li>
<li class="nav-item">
<a class="nav-link {% if request.endpoint and 'inventory' in request.endpoint %}active fw-bold{% endif %}"
href="{{ url_for('inventory.index') }}">
<i class="bi bi-box-seam me-2"></i>Inventory
</a>
</li>
<li class="nav-item">
<a class="nav-link {% if request.endpoint and 'gift_cards' in request.endpoint %}active fw-bold{% endif %}"
href="{{ url_for('gift_cards.index') }}">
<i class="bi bi-gift me-2"></i>Gift Cards
</a>
</li>
<li class="nav-item">
<a class="nav-link {% if request.endpoint and 'reconciliation' in request.endpoint %}active fw-bold{% endif %}"
href="{{ url_for('reconciliation.index') }}">
<i class="bi bi-calculator me-2"></i>Reconciliation
</a>
</li>
<li class="nav-item">
<a class="nav-link {% if request.endpoint and 'pay_periods' in request.endpoint %}active fw-bold{% endif %}"
href="{{ url_for('pay_periods.index') }}">
<i class="bi bi-wallet2 me-2"></i>Pay Periods
</a>
</li>
<li class="nav-item">
<a class="nav-link {% if request.endpoint and 'reports' in request.endpoint %}active fw-bold{% endif %}"
href="{{ '#' }}">
<i class="bi bi-bar-chart-line me-2"></i>Reports
</a>
</li>
{% if current_user.role == 'tenant_admin' %}
<li class="nav-item">
<a class="nav-link {% if request.endpoint and 'marketing' in request.endpoint %}active fw-bold{% endif %}"
href="{{ '#' }}">
<i class="bi bi-megaphone me-2"></i>Marketing
</a>
</li>
<li class="nav-item">
<a class="nav-link {% if request.endpoint and 'locations' in request.endpoint %}active fw-bold{% endif %}"
href="{{ url_for('locations.index') }}">
<i class="bi bi-geo-alt me-2"></i>Locations
</a>
</li>
<li class="nav-item">
<a class="nav-link {% if request.endpoint and 'settings' in request.endpoint %}active fw-bold{% endif %}"
href="{{ url_for('settings.index') }}">
<i class="bi bi-gear me-2"></i>Settings
</a>
</li>
{% endif %}
</ul>
</nav>
{% endif %}
<!-- Main content -->
<main class="{% if current_user.role != 'tenant_staff' %}col-md-10{% else %}col-12{% endif %} ms-sm-auto px-4 py-3">
{% endif %}
{% 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" role="alert">
{{ message }}
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
</div>
{% endfor %}
{% endwith %}
{% block content %}{% endblock %}
{% if current_user.is_authenticated %}
</main>
</div>
</div>
{% endif %}
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
{% block scripts %}{% endblock %}
</body>
</html>