SARBase/templates/base.html

102 lines
3.8 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<!-- ... meta tags, styles, etc. ... -->
<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>
<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>
</li>
<li class="nav-item">
<a class="nav-link" href="/create_sar">{{ _('New record') }}</a>
</li>
</ul>
<!-- Display user info and logout link if user is authenticated -->
<ul class="navbar-nav ml-auto">
<!-- 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>
{% if current_user.is_authenticated %}
<li class="nav-item">
<a class="nav-link" href="#">{{ _('Logged in as:') }} {{ current_user.username }}</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ url_for('logout') }}">{{ _('Logout') }}</a>
</li>
{% else %}
<!-- Display login link if user is not authenticated -->
<li class="nav-item">
<a class="nav-link" href="{{ url_for('login') }}">{{ _('Login') }}</a>
</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>
<!-- 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>
<script>
$(document).ready(function () {
$(".dropdown-toggle").dropdown();
});
</script>
</body>
</html>