Files
qgreper/forum/templates/base.html
2023-07-24 20:02:45 +03:00

49 lines
1.5 KiB
HTML

<!doctype html>
<head>
<title>{{ title }}</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="generator" content="Agreper - minimal, no-JS forum software">
<meta content="utf-8" http-equiv="encoding">
<link rel=stylesheet href="{{ url_for('static', filename='theme.css') }}">
{%- if config.server_name -%}
<link rel=stylesheet href="{{ url_for('static', filename='user.css') }}">
{%- endif -%}
</head>
<body>
<nav>
<a class=logo href="{{ url_for('index') }}">A</a>
<div style="margin:auto"></div>
{%- if user is not none -%}
<a href="{{ url_for('user_edit') }}">
{{- user.name }}
{%- if user.is_banned() %} (banned for {{ format_until(user.banned_until) }}){% endif -%}
</a>
<span> | </span>
{%- if user.is_admin() -%}
<a href="{{ url_for('admin') }}">Admin panel</a>
<span> | </span>
{%- endif -%}
<a href="{{ url_for('logout') }}">Logout</a>
{%- else -%}
{%- if config.registration_enabled -%}
<a href="{{ url_for('register') }}">Register</a>
<span> | </span>
{%- endif -%}
<a href="{{ url_for('login') }}">Login</a>
{%- endif -%}
<span> | </span>
<a href="{{ url_for('help') }}">Help</a>
</nav>
<main>
<h1>{{ title }}</h1>
{%- for category, msg in get_flashed_messages(True) -%}
{#-
FIXME ensure all flash() messages are free of XSS vectors.
In particular, check places where we flash error messages.
-#}
<p class="flash {{ category }}">{{ msg | safe }}</p>
{%- endfor -%}
{%- block content %}{% endblock -%}
</main>
</body>