2018-07-07 15:11:27 +02:00
|
|
|
<!DOCTYPE html>
|
2023-02-20 10:02:12 +01:00
|
|
|
<html lang="en">
|
2018-07-07 15:11:27 +02:00
|
|
|
<head>
|
2023-02-20 10:02:12 +01:00
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
2018-07-07 15:11:27 +02:00
|
|
|
{% block head %}
|
2018-07-23 00:19:41 +02:00
|
|
|
{# Show the setup name, as set in the config file, as tab title. Don't escape HTML entities. #}
|
|
|
|
<title>{{ setupname|safe }}</title>
|
2019-11-22 03:58:54 +01:00
|
|
|
<link rel="stylesheet" href="/static/css/matemat.css"/>
|
2023-02-20 10:02:12 +01:00
|
|
|
<link rel="stylesheet" href="/static/css/theme.css"/>
|
2018-07-07 15:11:27 +02:00
|
|
|
{% endblock %}
|
|
|
|
</head>
|
2018-07-23 00:19:41 +02:00
|
|
|
|
2018-07-07 15:11:27 +02:00
|
|
|
<body>
|
2018-07-23 00:19:41 +02:00
|
|
|
|
2018-07-07 15:11:27 +02:00
|
|
|
<header>
|
|
|
|
{% block header %}
|
|
|
|
|
2024-11-23 04:35:05 +01:00
|
|
|
<nav class="navbarbutton">
|
2018-07-23 00:19:41 +02:00
|
|
|
{# Show a link to the settings, if a user logged in via password (authlevel 2). #}
|
|
|
|
{% if authlevel|default(0) > 1 %}
|
|
|
|
{% if authuser is defined %}
|
2023-12-22 19:57:51 +01:00
|
|
|
<a href="/">Home</a>
|
2018-07-23 00:19:41 +02:00
|
|
|
{# If a user is an admin, call the link "Administration". Otherwise, call it "Settings". #}
|
|
|
|
{% if authuser.is_admin %}
|
|
|
|
<a href="/admin">Administration</a>
|
2018-10-01 21:08:37 +02:00
|
|
|
<a href="/statistics">Sales Statistics</a>
|
2018-07-23 00:19:41 +02:00
|
|
|
{% else %}
|
|
|
|
<a href="/admin">Settings</a>
|
|
|
|
{% endif %}
|
2018-07-09 22:38:39 +02:00
|
|
|
{% endif %}
|
2018-07-07 15:11:27 +02:00
|
|
|
{% endif %}
|
2023-02-20 10:02:12 +01:00
|
|
|
</nav>
|
2018-07-07 15:11:27 +02:00
|
|
|
{% endblock %}
|
|
|
|
</header>
|
2018-07-23 00:19:41 +02:00
|
|
|
|
2018-07-07 15:11:27 +02:00
|
|
|
<main>
|
2024-11-23 09:48:53 +01:00
|
|
|
{% block notifications %}
|
|
|
|
{% for n in notifications | default([]) %}
|
|
|
|
<div class="notification {{ n.classes | join(' ') }}">{{ n.msg|safe }}</div>
|
|
|
|
{% endfor %}
|
|
|
|
{% endblock %}
|
2018-07-23 00:19:41 +02:00
|
|
|
{% block main %}
|
|
|
|
{# Here be content. #}
|
|
|
|
{% endblock %}
|
2018-07-07 15:11:27 +02:00
|
|
|
</main>
|
2018-07-23 00:19:41 +02:00
|
|
|
|
2018-07-07 15:11:27 +02:00
|
|
|
<footer>
|
|
|
|
{% block footer %}
|
2018-07-23 00:19:41 +02:00
|
|
|
{# Show some information in the footer, e.g. the instance name, the version, and copyright info. #}
|
|
|
|
<ul>
|
|
|
|
<li> {{ setupname|safe }}
|
|
|
|
<li> Matemat {{ __version__ }}
|
|
|
|
<li> MIT License
|
2023-07-29 23:12:38 +02:00
|
|
|
<li> git.kabelsalat.ch/s3lph/matemat
|
2018-07-23 00:19:41 +02:00
|
|
|
</ul>
|
2018-07-07 15:11:27 +02:00
|
|
|
{% endblock %}
|
|
|
|
</footer>
|
2018-07-23 00:19:41 +02:00
|
|
|
|
2024-11-25 23:29:30 +01:00
|
|
|
{% if eanwebsocket %}
|
|
|
|
<script>
|
|
|
|
function connect() {
|
|
|
|
let socket = new WebSocket("{{ eanwebsocket }}");
|
|
|
|
socket.onclose = () => { setTimeout(connect, 1000); };
|
2024-11-27 23:43:23 +01:00
|
|
|
socket.onmessage = function (e) {
|
|
|
|
// Focus this tab - requires https://git.kabelsalat.ch/ccc-basel/barcode-utils
|
|
|
|
if (typeof window.extension_tabfocus === "function") {
|
|
|
|
window.extension_tabfocus();
|
|
|
|
}
|
|
|
|
{% block eanwebsocket %}{% endblock %}
|
|
|
|
};
|
2024-11-25 23:29:30 +01:00
|
|
|
}
|
|
|
|
window.addEventListener("load", () => { connect(); });
|
|
|
|
</script>
|
|
|
|
{% endif %}
|
2018-07-07 15:11:27 +02:00
|
|
|
</body>
|
|
|
|
</html>
|