salvi/templates/base.jinja2

72 lines
3.7 KiB
Django/Jinja
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html>
<head>
<title>{% block title %}{{ app_name }}{% endblock %}</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{% block meta %}{% endblock %}
<link rel="stylesheet" href="/static/style.css">
<!-- material icons -->
{% if material_icons_url %}
<link rel="stylesheet" href="{{ material_icons_url }}">
{% else %}
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
{% endif %}
{% if math_version and katex_url %}
<link rel="stylesheet" href="{{ katex_url }}" />
<style type="text/css">
.katex img {
object-fit: fill;
padding: unset;
display: block;
position: absolute;
width: 100%;
height: inherit;
}
</style>
{% endif %}
{% block json_info %}{% endblock %}
</head>
<body {% if request.cookies.get('dark') == '1' %}class="dark"{% endif %}>
<div id="__top"></div>
<header class="header">
<span class="header-app-name"><a href="/">{{ app_name }}</a></span>
<span class="header-blank">&nbsp;</span>
<ul class="top-menu">
<li class="dark-theme-toggle-anchor"><a href="{{ url_for('theme_switch', next=request.path) }}" onclick="toggleDarkTheme(true);return false" class="dark-theme-toggle-on" title="Dark theme"><span class="material-icons">brightness_3</span></a><a href="{{ url_for('theme_switch', next=request.path) }}" onclick="toggleDarkTheme(false);return false" class="dark-theme-toggle-off" title="Light theme"><span class="material-icons">brightness_5</span></a><script>function toggleDarkTheme(a){document.cookie="dark="+(+a)+";max-age=31556952;path=/;SameSite=Strict";document.body.classList.toggle("dark",a)}</script></li>
<li><a href="/search/" title="{{ T('search') }}" rel="nofollow"><span class="material-icons">search</span></a></li>
<li><a href="/p/random/" title="{{ T('random-page') }}" rel="nofollow"><span class="material-icons">shuffle</span></a></li>
<li><a href="/create/" title="{{ T('new-note') }}" rel="nofollow"><span class="material-icons">create</span></a></li>
</ul>
<ul class="user_menu">
{% if current_user.is_authenticated %}
<li><a href="/@{{ current_user.username }}/">{{ current_user.username }}</a></li>
<li><a href="/accounts/logout/" title="{{ T('logout') }}" rel="nofollow"><span class="material-icons">logout</span></a></li>
{% else %}
<li><a href="/accounts/login/" title="{{ T('login') }}" rel="nofollow"><span class="material-icons">login</span></a></li>
{% endif %}
</ul>
</header>
<div class="content">
{% for msg in get_flashed_messages() %}
<div class="flash">{{ msg }}</div>
{% endfor %}
{% block content %}{% endblock %}
{% block toc %}{% endblock %}
</div>
<footer class="footer">
<div class="footer-copyright">&copy; 20202023 Sakuragasaki46.</div>
<div class="footer-loggedinas">
{% if current_user.is_authenticated %}
<span class="material-icons">person</span> {{ T('logged-in-as') }}: <strong>{{ current_user.username }}</strong>
{% else %}
<span class="material-icons">person_off</span> {{ T('not-logged-in') }}. <a href="/accounts/login">{{ T("login") }}</a>
{% endif %}
</div>
<div class="footer-actions" id="page-actions">{% block actions %}{% endblock %}</div>
<div class="footer-versions">{{app_name}} version {{app_version}}</div>
</footer>
<div class="backontop"><a href="#__top" title="Back on top"><span class="material-icons">arrow_upward</span></a></div>
{% block scripts %}{% endblock %}
</body>
</html>