diff --git a/BookingSystem/app.py b/BookingSystem/app.py index 91a1062..d46652a 100644 --- a/BookingSystem/app.py +++ b/BookingSystem/app.py @@ -9,7 +9,7 @@ import inventory import mail import user -from __init__ import app, logger, KIOSK_FQDN +from __init__ import app, logger, KIOSK_FQDN, LABEL_SERVER from db import init_db, add_admin from utils import login_required @@ -53,7 +53,7 @@ def login() -> str | flask.Response: if KIOSK_FQDN and flask.request.headers.get('Host') == KIOSK_FQDN: flask.session['method'] = 'kiosk' r = flask.request.referrer - if r != flask.url_for('login'): + if r and r != flask.url_for('login'): return flask.redirect(r) return flask.redirect(flask.url_for('index')) return flask.render_template('login.html') @@ -137,6 +137,12 @@ def innlevering() -> str: unavailable_items=inventory.get_all_unavailable()) +@app.route('/etikettserver') +@login_required(admin_only=True) +def labelserver() -> str: + return flask.render_template('labelserver.html', labelserver_url=LABEL_SERVER) + + @app.route('/ansvarsavtale') def responsibility() -> str: return flask.render_template('responsibility.html') diff --git a/BookingSystem/templates/labelserver.html b/BookingSystem/templates/labelserver.html new file mode 100644 index 0000000..319acfc --- /dev/null +++ b/BookingSystem/templates/labelserver.html @@ -0,0 +1,5 @@ +{% extends 'layout.html' %} + +{% block content %} + +{% endblock %} \ No newline at end of file diff --git a/BookingSystem/templates/partials/header_admin.html b/BookingSystem/templates/partials/header_admin.html index 9042f58..4131453 100644 --- a/BookingSystem/templates/partials/header_admin.html +++ b/BookingSystem/templates/partials/header_admin.html @@ -10,6 +10,7 @@