SARBase/templates/base.html

102 lines
3.8 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>
<li class="nav-item">
<a class="nav-link" href="/create_sar">{{ _('New record') }}</a>
2023-11-01 18:46:27 +00:00
</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>
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>
<!-- 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>
2023-11-01 18:46:27 +00:00
</body>
</html>