Files
zbiorki_app/templates/base.html
Mateusz Gruszczyński e9db945bb4 przebudowa systemu
2025-08-28 10:27:06 +02:00

83 lines
3.6 KiB
HTML

<!DOCTYPE html>
<html lang="pl">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<title>{% block title %}Aplikacja Zbiórek{% endblock %}</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootswatch@5.3.0/dist/darkly/bootstrap.min.css">
<link rel="stylesheet" href="{{ url_for('static', filename='css/custom.css') }}" />
{% block extra_head %}{% endblock %}
</head>
<body class="d-flex flex-column min-vh-100">
<nav class="navbar navbar-expand-lg">
<div class="container">
<a class="navbar-brand" href="{{ url_for('index') }}">
{% if global_settings and global_settings.show_logo_in_navbar and global_settings.logo_url %}
<img src="{{ global_settings.logo_url }}" alt="Logo" style="max-height:40px; vertical-align:middle;">
{% endif %}
{{ global_settings.site_title if global_settings and global_settings.site_title else "Zbiórki" }}
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#mainNavbar"
aria-controls="mainNavbar" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="mainNavbar">
<ul class="navbar-nav ms-auto">
{% set hide_links = request.path == url_for('index') or request.path ==
url_for('zbiorki_zrealizowane') %}
{% if not hide_links %}
<li class="nav-item">
<a class="nav-link" href="{{ url_for('index') }}">Aktualne zbiórki</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ url_for('zbiorki_zrealizowane') }}">Zrealizowane zbiórki</a>
</li>
{% endif %}
{% if current_user.is_authenticated %}
<li class="nav-item"><a class="nav-link" href="{{ url_for('admin_dashboard') }}">Panel Admina</a>
</li>
<li class="nav-item"><a class="nav-link" href="{{ url_for('wyloguj') }}">Wyloguj</a></li>
{% else %}
{% if is_ip_allowed %}
<li class="nav-item"><a class="nav-link" href="{{ url_for('zaloguj') }}">Zaloguj</a></li>
{% endif %}
{% endif %}
</ul>
</div>
</div>
</nav>
<div class="container mt-4">
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
{% for category, message in messages %}
<div class="alert alert-{{ category|default('secondary') }}">{{ message }}</div>
{% endfor %}
{% endif %}
{% endwith %}
<main class="flex-grow-1">
{% block content %}{% endblock %}
</main>
</div>
<!-- stopka -->
<footer class="mt-auto text-center py-3 border-top" style="background: var(--surface-0);">
{% if global_settings and global_settings.logo_url %}
<img src="{{ global_settings.logo_url }}" alt="Logo" style="max-height:60px; opacity:0.85;">
{% else %}
<small class="text-muted">© linuxiarz.pl</small>
{% endif %}
</footer>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
<script src="{{ url_for('static', filename='js/progress.js') }}"></script>
{% block extra_scripts %}{% endblock %}
</body>
</html>