2018-07-07 15:11:27 +02:00
|
|
|
<!DOCTYPE html>
|
2023-02-20 10:02:12 +01:00
|
|
|
<html lang="en">
|
2024-12-07 15:50:37 +01:00
|
|
|
<head>
|
2023-02-20 10:02:12 +01:00
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
2024-12-07 15:50:37 +01:00
|
|
|
<meta http-equiv="encoding" charset="utf-8" />
|
|
|
|
{# Show the setup name, as set in the config file, as tab title. Don't escape HTML entities. #}
|
|
|
|
<title>{{ setupname|safe }}</title>
|
|
|
|
<link rel="stylesheet" href="/static/css/bootstrap.min.css" />
|
|
|
|
<link rel="stylesheet" href="/static/css/matemat.css"/>
|
|
|
|
<link rel="stylesheet" href="/static/css/theme.css"/>
|
|
|
|
<script src="/static/js/bootstrap.bundle.min.js"></script>
|
|
|
|
</head>
|
2018-07-23 00:19:41 +02:00
|
|
|
|
2024-12-07 15:50:37 +01:00
|
|
|
<body>
|
2018-07-23 00:19:41 +02:00
|
|
|
|
2024-12-07 15:50:37 +01:00
|
|
|
<header class="navbar navbar-expand-lg navbar-dark bg-dark">
|
|
|
|
{% block header %}
|
2018-07-07 15:11:27 +02:00
|
|
|
|
2024-12-07 15:50:37 +01:00
|
|
|
<nav class="container-fluid">
|
|
|
|
<a class="navbar-brand" href="/">{{ setupname|safe }}</a>
|
|
|
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar-collapse" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
|
|
|
<span class="navbar-toggler-icon"></span>
|
|
|
|
</button>
|
|
|
|
<div class="collapse navbar-collapse" id="navbar-collapse">
|
|
|
|
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
|
|
|
|
{# Show a link to the settings, if a user logged in via password (authlevel 2). #}
|
|
|
|
{% if authuser is defined and authlevel|default(0) > 1 %}
|
|
|
|
<li class="nav-item"><a href="/settings" class="nav-link">Settings</a></li>
|
|
|
|
{% if authuser.is_admin %}
|
|
|
|
<li class="nav-item"><a href="/admin" class="nav-link">Administration</a></li>
|
|
|
|
<li class="nav-item"><a href="/statistics" class="nav-link">Sales Statistics</a></li>
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
|
|
|
{# Login/Logout buttons #}
|
|
|
|
{% if authuser is defined %}
|
|
|
|
<li class="nav-item justify-content-end"><a href="/logout" class="nav-link">Logout</a></li>
|
|
|
|
{% else %}
|
|
|
|
<li class="nav-item justify-content-end"><a href="/login" class="nav-link">Login</a></li>
|
|
|
|
{% if signup|default(false) %}
|
|
|
|
<li class="nav-item justify-content-end"><a href="/signup" class="nav-link">Signup</a></li>
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
|
|
|
</ul>
|
|
|
|
</div>
|
2023-02-20 10:02:12 +01:00
|
|
|
</nav>
|
2024-12-07 15:50:37 +01:00
|
|
|
{% endblock %}
|
|
|
|
</header>
|
2018-07-23 00:19:41 +02:00
|
|
|
|
2024-12-07 15:50:37 +01:00
|
|
|
<main class="container-fluid pb-5 pt-3">
|
|
|
|
{% block notifications %}
|
|
|
|
{% for n in notifications | default([]) %}
|
|
|
|
<div class="alert {{ n.classes | join(' ') }}" role="alert">
|
|
|
|
{{ n.msg|safe }}
|
|
|
|
</div>
|
|
|
|
{% endfor %}
|
|
|
|
{% endblock %}
|
|
|
|
{% block main %}
|
2018-07-23 00:19:41 +02:00
|
|
|
{# Here be content. #}
|
2024-12-07 15:50:37 +01:00
|
|
|
{% endblock %}
|
|
|
|
</main>
|
2018-07-23 00:19:41 +02:00
|
|
|
|
2024-12-07 15:50:37 +01:00
|
|
|
<footer class="fixed-bottom p-3 bg-light">
|
|
|
|
{% block footer %}
|
|
|
|
<div class="container text-muted">
|
|
|
|
{{ setupname|safe }} | Matemat {{ __version__ }}
|
|
|
|
</div>
|
|
|
|
{% endblock %}
|
|
|
|
</footer>
|
2018-07-23 00:19:41 +02:00
|
|
|
|
2024-12-07 15:50:37 +01:00
|
|
|
{% if eanwebsocket %}
|
|
|
|
<script>
|
|
|
|
function connect() {
|
|
|
|
let socket = new WebSocket("{{ eanwebsocket }}");
|
|
|
|
socket.onclose = () => { setTimeout(connect, 1000); };
|
|
|
|
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 %}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
window.addEventListener("load", () => { connect(); });
|
|
|
|
</script>
|
|
|
|
{% endif %}
|
|
|
|
</body>
|
2018-07-07 15:11:27 +02:00
|
|
|
</html>
|