2018-07-07 15:11:27 +02:00
|
|
|
{% extends "base.html" %}
|
|
|
|
|
|
|
|
{% block header %}
|
2018-07-23 00:19:41 +02:00
|
|
|
{# 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() }}
|
2018-07-07 15:11:27 +02:00
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block main %}
|
|
|
|
|
2018-07-23 00:19:41 +02:00
|
|
|
{# Always show the settings a user can edit for itself #}
|
|
|
|
{% include "admin_all.html" %}
|
2018-07-07 15:11:27 +02:00
|
|
|
|
2018-07-23 00:19:41 +02:00
|
|
|
{# Only show the "restricted" section if the user is an admin #}
|
|
|
|
{% if authuser.is_admin %}
|
|
|
|
{% include "admin_restricted.html" %}
|
|
|
|
{% endif %}
|
2018-07-07 15:11:27 +02:00
|
|
|
|
2018-07-23 00:19:41 +02:00
|
|
|
{{ super() }}
|
2018-07-07 15:11:27 +02:00
|
|
|
|
|
|
|
{% endblock %}
|
2024-11-25 23:29:30 +01:00
|
|
|
|
|
|
|
{% block eanwebsocket %}
|
2024-12-01 23:37:22 +01:00
|
|
|
let tokeninput = document.getElementById("admin-newtoken-token");
|
|
|
|
tokeninput.value = e.data;
|
|
|
|
tokeninput.select();
|
2024-12-01 21:58:16 +01:00
|
|
|
{% if authuser.is_admin %}
|
2024-11-25 23:29:30 +01:00
|
|
|
let eaninput = document.getElementById("admin-newproduct-ean");
|
|
|
|
eaninput.value = e.data;
|
|
|
|
eaninput.select();
|
2024-12-01 21:58:16 +01:00
|
|
|
{% else %}
|
|
|
|
tokeninput.scrollIntoView();
|
|
|
|
{% endif %}
|
2024-11-25 23:29:30 +01:00
|
|
|
{% endblock %}
|