KankenOnline/kanken_online/templates/base.html
2024-10-14 17:10:12 +01:00

41 lines
1.5 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<title>{% block title %}{% endblock %} - {{ localize("kanken_online") }}</title>
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
{% if session %}
<link rel="stylesheet" href="{{ url_for('static', filename='dark_theme.css') if session['theme'] == 'dark' else url_for('static', filename='light_theme.css')}}">
{% else %}
<link rel="stylesheet" href="{{ url_for('static', filename='theme_select.css') }}"> <!-- Use CSS-based theme detection if no user login supplied -->
{% endif %}
{% block styles %}{% endblock %}
{% block scripts %}{% endblock %}
</head>
<body>
<nav>
<h1><a href="/">{{ localize("kanken_online") }}</a></h1>
<ul>
{% if g.user %}
<li><span>{{ g.user['username'] }}</span>
<li><a href="{{ url_for('options') }}">{{ localize("options") }}</a>
<li><a href="{{ url_for('auth.logout') }}">{{ localize("log_out") }}</a>
{% else %}
<li><a href="{{ url_for('auth.register') }}">{{ localize("register") }}</a>
<li><a href="{{ url_for('auth.login') }}">{{ localize("log_in") }}</a>
{% endif %}
<li><a href="{{ url_for('about_page') }}">{{ localize("about") }}</a></li>
<li><a href="{{ url_for('indices.indices_page') }}">{{ localize("indices") }}</a></li>
</ul>
</nav>
<section class="content">
<header>
{% block header %}{% endblock %}
</header>
{% for message in get_flashed_messages() %}
<div class="flash">{{ localize(message) }}</div>
{% endfor %}
{% block content %}{% endblock %}
</section>
</body>
</html>