Skip to content

Commit

Permalink
EtikettServer page (for tekst-etiketter)
Browse files Browse the repository at this point in the history
  • Loading branch information
sondregronas committed Aug 2, 2023
1 parent 6187461 commit fa8a332
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
10 changes: 8 additions & 2 deletions BookingSystem/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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')
Expand Down Expand Up @@ -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')
Expand Down
5 changes: 5 additions & 0 deletions BookingSystem/templates/labelserver.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{% extends 'layout.html' %}

{% block content %}
<iframe src="{{labelserver_url}}" style="width:100%; min-height: 110vh;"></iframe>
{% endblock %}
1 change: 1 addition & 0 deletions BookingSystem/templates/partials/header_admin.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
</a></li>
<div class="dropdown-content">
<a href="{{ url_for('admin_settings') }}">Adminpanel</a>
<a href="{{ url_for('labelserver') }}">Etikettserver</a>
<a href="{{ url_for('audits') }}">Audits</a>
<a href="https://github.com/sondregronas/FeideUtstyrbase" target="_blank">Kildekode</a>
<a href="{{url_for('privacy')}}">Personvern</a>
Expand Down

0 comments on commit fa8a332

Please sign in to comment.