SARBase/templates/base.html

108 lines
4.0 KiB
HTML
Raw Normal View History

2023-11-01 18:46:27 +00:00
<!DOCTYPE html>
<html lang="en">
<head>
<!-- ... meta tags, styles, etc. ... -->
2023-11-01 18:46:27 +00:00
<title>{% block title %}Default Title{% endblock %}</title>
</head>
<body>
<!-- Navbar/Header -->
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" href="#">{{ _('SAR App') }}</a>
2023-11-01 18:46:27 +00:00
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav"
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav mr-auto">
<!-- Nav items go here -->
<li class="nav-item">
<a class="nav-link" href="/list_sar">{{ _('SAR records') }}</a>
2023-11-01 18:46:27 +00:00
</li>
2023-11-19 21:08:19 +00:00
{% if current_user.is_authenticated %}
2023-11-23 09:08:14 +00:00
<li class="nav-item">
<a class="nav-link" href="/create_sar">{{ _('New record') }}</a>
</li>
2023-11-19 21:08:19 +00:00
{% endif %}
2023-11-01 18:46:27 +00:00
</ul>
<!-- Display user info and logout link if user is authenticated -->
<ul class="navbar-nav ml-auto">
2023-11-23 09:08:14 +00:00
{% if current_user.is_authenticated %}
<li class="nav-item">
<a class="nav-link" href="/admin">{{ _('DB Admin') }}</a>
</li>
{% endif %}
<!-- Language Dropdown in Bootstrap -->
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" role="button"
data-bs-toggle="dropdown-menu" aria-expanded="false">
{{ _('Language') }}
</a>
<ul class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
<li><a class="dropdown-item" href="{{ url_for('set_language', lang_code='en') }}">English</a></li>
<li><a class="dropdown-item" href="{{ url_for('set_language', lang_code='ru') }}">Русский</a></li>
<li><a class="dropdown-item" href="{{ url_for('set_language', lang_code='ee') }}">Eesti</a></li>
<li><a class="dropdown-item" href="{{ url_for('set_language', lang_code='fi') }}">Suomi</a></li>
<!-- Add other languages here -->
</ul>
</li>
2023-11-01 18:46:27 +00:00
{% if current_user.is_authenticated %}
<li class="nav-item">
<a class="nav-link" href="#">{{ _('Logged in as:') }} {{ current_user.username }}</a>
2023-11-01 18:46:27 +00:00
</li>
<li class="nav-item">
<a class="nav-link" href="{{ url_for('logout') }}">{{ _('Logout') }}</a>
2023-11-01 18:46:27 +00:00
</li>
{% else %}
<!-- Display login link if user is not authenticated -->
<li class="nav-item">
<a class="nav-link" href="{{ url_for('login') }}">{{ _('Login') }}</a>
2023-11-01 18:46:27 +00:00
</li>
{% endif %}
</ul>
</div>
</nav>
<!-- Main Content -->
<div class="container">
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
{% for category, message in messages %}
<div class="alert alert-{{ category }}">{{ message }}</div>
{% endfor %}
{% endif %}
{% endwith %}
{% block content %}
<!-- Default content can be placed here. It will be overridden by child templates. -->
{% endblock %}
</div>
<!-- Footer -->
<footer>
<!-- ... footer content ... -->
</footer>
2023-11-23 09:08:14 +00:00
<!-- Scripts -->
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
2023-11-23 09:08:14 +00:00
<script>
$(document).ready(function () {
$(".dropdown-toggle").dropdown();
});
</script>
2023-11-01 18:46:27 +00:00
</body>
</html>