matemat/templates/admin.html
s3lph f614fe1afc
All checks were successful
/ test (push) Successful in 1m22s
/ codestyle (push) Successful in 1m4s
/ build_wheel (push) Successful in 1m59s
/ build_debian (push) Successful in 2m33s
breaking: remove the config option to automatically close tabs after ean purchase
fix: improve error handling on database consistency errors (e.g. non-unique ean codes) in the settings
feat: handle ean codes in the already open tab via a websocket connection
feat: populate ean code input field when a barcode is scanned while in the product settings
2024-11-25 23:29:30 +01:00

34 lines
825 B
HTML

{% extends "base.html" %}
{% block header %}
{# If the logged in user is an administrator, call the title "Administration", otherwise "Settings" #}
{% if authuser.is_admin %}
<h1>Administration</h1>
{% else %}
<h1>Settings</h1>
{% endif %}
{{ super() }}
{% endblock %}
{% block main %}
{# Always show the settings a user can edit for itself #}
{% include "admin_all.html" %}
{# Only show the "restricted" section if the user is an admin #}
{% if authuser.is_admin %}
{% include "admin_restricted.html" %}
{% endif %}
{{ super() }}
{% endblock %}
{% block eanwebsocket %}
function (e) {
let eaninput = document.getElementById("admin-newproduct-ean");
eaninput.value = e.data;
eaninput.select();
eaninput.scrollIntoView();
}
{% endblock %}