rename .html templates to .jinja2 for more consistency
This commit is contained in:
parent
7f050afb8b
commit
2887d94a8c
36 changed files with 34 additions and 33 deletions
61
templates/base.jinja2
Normal file
61
templates/base.jinja2
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
<!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>
|
||||
<div class="content">
|
||||
{% for msg in get_flashed_messages() %}
|
||||
<div class="flash">{{ msg }}</div>
|
||||
{% endfor %}
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
<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="/" title="{{ T('homepage') }}"><span class="material-icons">home</span></a></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>
|
||||
<li><a href="/accounts/login/" title="{{ T('login') }}" rel="nofollow"><span class="material-icons">login</span></a></li>
|
||||
</ul>
|
||||
<div class="footer">
|
||||
<div class="footer-copyright">© 2020–2023 Sakuragasaki46.</div>
|
||||
<div class="footer-loggedinas">
|
||||
{% if current_user.is_authenticated %}
|
||||
{{ T('logged-in-as') }}: <strong>{{ current_user.username }}</strong>
|
||||
{% else %}
|
||||
{{ 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>
|
||||
</div>
|
||||
<div class="backontop"><a href="#__top" title="Back on top"><span class="material-icons">arrow_upward</span></a></div>
|
||||
{% block scripts %}{% endblock %}
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue