diff --git a/BookingSystem/api.py b/BookingSystem/api.py index bd5cd84..a89134b 100644 --- a/BookingSystem/api.py +++ b/BookingSystem/api.py @@ -28,6 +28,14 @@ def get_items() -> flask.Response: return flask.jsonify([item.api_repr() for item in items]) +@api.route('/items/available', methods=['GET']) +@login_required(admin_only=True, api=True) +def get_items_available() -> flask.Response: + """Get all items in the database for frontend display.""" + items = inventory.get_all_available() + return flask.jsonify([item.api_repr() for item in items]) + + @api.route('/items/unavailable', methods=['GET']) @login_required(admin_only=True, api=True) def get_items_unavailable() -> flask.Response: @@ -68,7 +76,6 @@ def add_item() -> flask.Response: def edit_item(item_id: str) -> flask.Response: """Edit an item in the database.""" form = flask.request.form - print(form) item = {key: form.get(key) for key in form.keys() if key in Item.__annotations__} item = Item(**item) @@ -119,12 +126,12 @@ def print_label(item_id: str) -> flask.Response: def book_equipment() -> flask.Response: """Book out equipment for a user.""" form = flask.request.form - user = form.get('user') + userid = form.get('user') days = form.get('days') item_ids = form.getlist('equipment') for item in item_ids: - inventory.register_out(item_id=item, user=user, days=days) + inventory.register_out(item_id=item, userid=userid, days=days) return flask.Response('Utstyr ble utlevert.', status=200) @@ -179,6 +186,7 @@ def update_groups() -> flask.Response: """Update a class in the database.""" con = sqlite3.connect(DATABASE) cur = con.cursor() + # noinspection SqlWithoutWhere cur.execute('DELETE FROM groups') con.commit() @@ -198,6 +206,7 @@ def update_categories() -> flask.Response: """Update every category in the database.""" con = sqlite3.connect(DATABASE) cur = con.cursor() + # noinspection SqlWithoutWhere cur.execute('DELETE FROM categories') con.commit() @@ -217,6 +226,7 @@ def update_emails() -> flask.Response: """Update every email in the database.""" con = sqlite3.connect(DATABASE) cur = con.cursor() + # noinspection SqlWithoutWhere cur.execute('DELETE FROM emails') con.commit() diff --git a/BookingSystem/app.py b/BookingSystem/app.py index 682308d..967c219 100644 --- a/BookingSystem/app.py +++ b/BookingSystem/app.py @@ -8,13 +8,9 @@ import api import feide -import groups -import inventory -import mail -import user -from __init__ import logger, KIOSK_FQDN, LABEL_SERVER -from db import init_db, add_admin -from utils import login_required +import routes +from __init__ import logger +from db import init_db def create_app() -> flask.Flask: @@ -31,8 +27,10 @@ def create_app() -> flask.Flask: Session(app) + # Register blueprints app.register_blueprint(api.api) app.register_blueprint(feide.feide) + app.register_blueprint(routes.app) @app.template_filter('strftime') def _jinja2_filter_datetime(date, fmt='%d.%m.%Y') -> str: @@ -43,115 +41,15 @@ def _jinja2_filter_strftime(date, fmt='%d.%m.%Y') -> str: return datetime.fromtimestamp(float(date)).strftime(fmt) @app.errorhandler(401) - def unauthorized(e) -> flask.Response: + def unauthorized(_) -> flask.Response: logger.warning(f'Unauthorized access: {flask.request.url} from {flask.request.remote_addr}') - return flask.redirect(flask.url_for('login')) + return flask.redirect(flask.url_for('app.login')) @app.errorhandler(403) - def unauthorized(e) -> flask.Response: + def unauthorized(_) -> flask.Response: flask.session.clear() logger.warning(f'Unauthorized access: {flask.request.url} from {flask.request.remote_addr}') - return flask.redirect(flask.url_for('login')) - - @app.route('/') - @login_required() - def index() -> str: - if flask.session.get("user").is_admin: - return flask.render_template('index_admin.html', overdue_items=inventory.get_all_overdue()) - return flask.render_template('index_student.html', all_groups=groups.get_all()) - - @app.route('/login') - def login() -> str | flask.Response: - if flask.session.get("user"): - return flask.redirect(flask.url_for('index')) - if KIOSK_FQDN and flask.request.headers.get('Host') == KIOSK_FQDN: - flask.session['method'] = 'kiosk' - r = flask.request.referrer - 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') - - @app.route('/register') - @login_required() - def register() -> flask.Response: - user = flask.session.get("user") - if user.is_admin and not user.exists: - add_admin(flask.session.get("user").__dict__) - - return flask.redirect(flask.url_for('index')) - - @app.route('/logout') - def logout() -> flask.Response: - flask.session.clear() - return flask.redirect(flask.url_for('login')) - - @app.route('/admin') - @login_required(admin_only=True) - def admin_settings() -> str: - return flask.render_template('admin_settings.html', all_groups=groups.get_all(), - all_categories=inventory.all_categories(), - all_emails=mail.get_all_emails(), - last_sent=mail.get_last_sent()) - - @app.route('/audits') - @login_required(admin_only=True) - def audits() -> str: - """All audits in data/audits.log""" - log = open('data/audits.log', 'r').readlines() - log = [{ - 'timestamp': audit.split('|')[0].strip(), - 'event': audit.split('|')[1].split(' - ')[0].strip(), - 'message': ''.join(audit.split(' - ')[1:]).strip() - } for audit in log if audit.strip()] - return flask.render_template('audits.html', audits=log) - - @app.route('/inventar') - @login_required(admin_only=True) - def inventar() -> str: - return flask.render_template('inventar.html', items=inventory.get_all()) - - @app.route('/inventar/add') - @login_required(admin_only=True) - def inventar_add() -> str: - return flask.render_template('inventar_add.html', categories=inventory.all_categories()) - - @app.route('/inventar/edit/') - @login_required(admin_only=True) - def edit_item(item_id: str) -> str: - return flask.render_template('inventar_edit.html', item=inventory.get(item_id), - categories=inventory.all_categories()) - - @app.route('/inventar/print/') - @login_required(admin_only=True) - def print_item(item_id: str) -> str: - return flask.render_template('inventar_print.html', item=inventory.get(item_id)) - - @app.route('/booking') - @login_required(admin_only=True) - def booking() -> str: - return flask.render_template('booking.html', - all_users=user.get_all_active_users(), - all_items=inventory.get_all()) - - @app.route('/innlevering') - @login_required(admin_only=True) - def innlevering() -> str: - return flask.render_template('innlevering.html', - 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') - - @app.route('/personvern') - def privacy() -> str: - return flask.render_template('privacy.html') + return flask.redirect(flask.url_for('app.login')) return app diff --git a/BookingSystem/groups.py b/BookingSystem/groups.py index 31a6220..fe4075b 100644 --- a/BookingSystem/groups.py +++ b/BookingSystem/groups.py @@ -6,6 +6,6 @@ def get_all() -> list[str]: """Return a list of all groups in the database.""" con = sqlite3.connect(DATABASE) - groups = [row[0] for row in con.execute('SELECT classroom FROM groups ORDER BY classroom ASC')] + groups = [row[0] for row in con.execute('SELECT classroom FROM groups ORDER BY classroom')] con.close() return groups diff --git a/BookingSystem/import.py b/BookingSystem/import.py index bd8cd5d..7eaddb8 100644 --- a/BookingSystem/import.py +++ b/BookingSystem/import.py @@ -4,7 +4,7 @@ This script imports all items from the label server into the database, if they don't already exist. You shouldn't really need this script, but it's here just in case. Whenever you print a label, the label server -keeps track of it in it's audit log. This script reads the audit log and imports all items into the database. +keeps track of it in its audit log. This script reads the audit log and imports all items into the database. """ import sqlite3 @@ -19,8 +19,8 @@ def get_items_from_label_server() -> list: response = requests.get(f'{LABEL_SERVER}/audits') json = response.json() filtered = [] - for item in [{key: value.strip() for key, value in item.items()} for item in json]: - if item['id'] not in [i['id'] for i in filtered]: + for i in [{key: value.strip() for key, value in i.items()} for i in json]: + if i['id'] not in [ii['id'] for ii in filtered]: filtered.append(item) return filtered diff --git a/BookingSystem/inventory.py b/BookingSystem/inventory.py index 5033a02..bd65fae 100644 --- a/BookingSystem/inventory.py +++ b/BookingSystem/inventory.py @@ -150,6 +150,14 @@ def get_all() -> list[Item]: return items +def get_all_available() -> list[Item]: + """Return a JSON list of all available items in the database.""" + con = sqlite3.connect(DATABASE) + items = [Item(*row) for row in con.execute('SELECT * FROM inventory WHERE available=1')] + con.close() + return items + + def get_all_unavailable() -> list[Item]: """Return a JSON list of all unavailable items in the database.""" con = sqlite3.connect(DATABASE) @@ -179,7 +187,7 @@ def _update_last_seen(item_id: str) -> None: con.close() -def register_out(item_id: str, user: str, days: str = 1) -> None: +def register_out(item_id: str, userid: str, days: str = 1) -> None: """Set the item with the given ID to unavailable and register the order details.""" due_date = datetime.now() + timedelta(days=datetime.strptime(days, '%d').day) @@ -190,7 +198,7 @@ def register_out(item_id: str, user: str, days: str = 1) -> None: con = sqlite3.connect(DATABASE) try: sql = 'UPDATE inventory SET available=0, borrowed_to=:borrowed_to, order_due_date=:order_due_date WHERE id=:id' - con.execute(sql, {'id': item_id, 'borrowed_to': user, 'order_due_date': due_date}) + con.execute(sql, {'id': item_id, 'borrowed_to': userid, 'order_due_date': due_date}) con.commit() logger.info(f'{item_id} er ikke lenger tilgjengelig.') except sqlite3.IntegrityError: diff --git a/BookingSystem/mail.py b/BookingSystem/mail.py index 9eb86d7..fbc0442 100644 --- a/BookingSystem/mail.py +++ b/BookingSystem/mail.py @@ -18,7 +18,7 @@ def get_all_emails() -> list[str]: """Return a list of all emails in the database.""" con = sqlite3.connect(DATABASE) - emails = [row[0] for row in con.execute('SELECT email FROM emails ORDER BY email ASC')] + emails = [row[0] for row in con.execute('SELECT email FROM emails ORDER BY email')] con.close() return emails @@ -72,7 +72,7 @@ def formatted_overdue_items() -> str: def send_report() -> flask.Response: - """Send an email to all emails in the database.""" + """Send an e-mail to all emails in the database.""" items = [item for item in inventory.get_all_unavailable() if item.overdue] if not items: update_last_sent() diff --git a/BookingSystem/routes.py b/BookingSystem/routes.py new file mode 100644 index 0000000..0689241 --- /dev/null +++ b/BookingSystem/routes.py @@ -0,0 +1,121 @@ +import flask + +import groups +import inventory +import mail +import user +import utils +from __init__ import KIOSK_FQDN +from __init__ import LABEL_SERVER +from db import add_admin +from utils import login_required + +app = flask.blueprints.Blueprint('app', __name__) + + +@app.route('/') +@login_required() +def index() -> str: + if flask.session.get("user").is_admin: + return flask.render_template('index_admin.html', overdue_items=inventory.get_all_overdue()) + return flask.render_template('index_student.html', all_groups=groups.get_all()) + + +@app.route('/login') +def login() -> str | flask.Response: + if flask.session.get("user"): + return flask.redirect(flask.url_for('app.index')) + if KIOSK_FQDN and flask.request.headers.get('Host') == KIOSK_FQDN: + flask.session['method'] = 'kiosk' + r = flask.request.referrer + if r and r != flask.url_for('app.login'): + return flask.redirect(r) + return flask.redirect(flask.url_for('app.index')) + return flask.render_template('login.html') + + +@app.route('/register') +@login_required() +def register() -> flask.Response: + u = flask.session.get("user") + if u.is_admin and not u.exists: + add_admin(flask.session.get("user").__dict__) + + return flask.redirect(flask.url_for('app.index')) + + +@app.route('/logout') +def logout() -> flask.Response: + flask.session.clear() + return flask.redirect(flask.url_for('app.login')) + + +@app.route('/admin') +@login_required(admin_only=True) +def admin_settings() -> str: + return flask.render_template('admin_settings.html', all_groups=groups.get_all(), + all_categories=inventory.all_categories(), + all_emails=mail.get_all_emails(), + last_sent=mail.get_last_sent()) + + +@app.route('/audits') +@login_required(admin_only=True) +def audits() -> str: + return flask.render_template('audits.html', audits=utils.get_audits()) + + +@app.route('/inventar') +@login_required(admin_only=True) +def inventar() -> str: + return flask.render_template('inventar.html', items=inventory.get_all()) + + +@app.route('/inventar/add') +@login_required(admin_only=True) +def inventar_add() -> str: + return flask.render_template('inventar_add.html', categories=inventory.all_categories()) + + +@app.route('/inventar/edit/') +@login_required(admin_only=True) +def edit_item(item_id: str) -> str: + return flask.render_template('inventar_edit.html', item=inventory.get(item_id), + categories=inventory.all_categories()) + + +@app.route('/inventar/print/') +@login_required(admin_only=True) +def print_item(item_id: str) -> str: + return flask.render_template('inventar_print.html', item=inventory.get(item_id)) + + +@app.route('/booking') +@login_required(admin_only=True) +def booking() -> str: + return flask.render_template('booking.html', + all_users=user.get_all_active_users(), + all_items=inventory.get_all()) + + +@app.route('/innlevering') +@login_required(admin_only=True) +def innlevering() -> str: + return flask.render_template('innlevering.html', + 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') + + +@app.route('/personvern') +def privacy() -> str: + return flask.render_template('privacy.html') diff --git a/BookingSystem/templates/admin_settings.html b/BookingSystem/templates/admin_settings.html index a13d2bf..e57ccc2 100644 --- a/BookingSystem/templates/admin_settings.html +++ b/BookingSystem/templates/admin_settings.html @@ -2,66 +2,66 @@ {% block content %} -
-

Admin innstillinger

-

Dersom du er forvirret av denne siden, så kan du trygt forlate den :)

-
+
+

Admin innstillinger

+

Dersom du er forvirret av denne siden, så kan du trygt forlate den :)

+
-{% if last_sent %} - - - -{% else %} - - - -{% endif %} + {% if last_sent %} + + + + {% else %} + + + + {% endif %} -
-

Klasserom

-

Et klasserom per linje, format: 1MEKA (Kontaktlærer)

-
-{% include 'forms/groups.html' %} +
+

Klasserom

+

Et klasserom per linje, format: 1MEKA (Kontaktlærer)

+
+ {% include 'forms/groups.html' %} -
-

E-poster

-

Hvem skal motta e-post? En addresse per linje

-
-{% include 'forms/emails.html' %} +
+

E-poster

+

Hvem skal motta e-post? En addresse per linje

+
+ {% include 'forms/emails.html' %} -
-

Kategorier

-

En kategori per linje

-
-{% include 'forms/categories.html' %} +
+

Kategorier

+

En kategori per linje

+
+ {% include 'forms/categories.html' %} - + {% endblock %} diff --git a/BookingSystem/templates/audits.html b/BookingSystem/templates/audits.html index 64ee6f4..5e174da 100644 --- a/BookingSystem/templates/audits.html +++ b/BookingSystem/templates/audits.html @@ -1,57 +1,57 @@ {% extends 'layout.html' %} {% block extra_head %} -{% include 'templates/datatables.html' %} + {% include 'templates/datatables.html' %} {% endblock %} {% block content %} -
-

Logg

-

Her kan du søke i loggen etter forlatt utstyr, hva skjedde med det?

-
+
+

Logg

+

Her kan du søke i loggen etter forlatt utstyr, hva skjedde med det?

+
- - - - - - - - - - {% for audit in audits %} - - - - - - {% endfor %} - -
TimestampEventMessage
{{ audit.timestamp }}{{ audit.event }}{{ audit.message }}
+ + + + + + + + + + {% for audit in audits %} + + + + + + {% endfor %} + +
TimestampEventMessage
{{ audit.timestamp }}{{ audit.event }}{{ audit.message }}
- + {% endblock %} \ No newline at end of file diff --git a/BookingSystem/templates/booking.html b/BookingSystem/templates/booking.html index a82d450..532cfa6 100644 --- a/BookingSystem/templates/booking.html +++ b/BookingSystem/templates/booking.html @@ -1,88 +1,88 @@ {% extends 'layout.html' %} {% block extra_head %} -{% include 'templates/chosen.html' %} + {% include 'templates/chosen.html' %} {% endblock %} {% block content %} -
-

Lån ut utstyr

-

Dersom du ikke finner eleven i listen, må eleven logge inn på nettstedet og fullføre registreringen.

-
+
+

Lån ut utstyr

+

Dersom du ikke finner eleven i listen, må eleven logge inn på nettstedet og fullføre registreringen.

+
-
- - + + + - - + + - - + + -

+

- -
+ + - + }); + {% endblock %} diff --git a/BookingSystem/templates/forms/categories.html b/BookingSystem/templates/forms/categories.html index c62a424..8d87421 100644 --- a/BookingSystem/templates/forms/categories.html +++ b/BookingSystem/templates/forms/categories.html @@ -1,5 +1,5 @@ -
- +
diff --git a/BookingSystem/templates/forms/emails.html b/BookingSystem/templates/forms/emails.html index 20335fe..a595040 100644 --- a/BookingSystem/templates/forms/emails.html +++ b/BookingSystem/templates/forms/emails.html @@ -1,5 +1,6 @@ -
- +
diff --git a/BookingSystem/templates/forms/groups.html b/BookingSystem/templates/forms/groups.html index d1629d5..eca4919 100644 --- a/BookingSystem/templates/forms/groups.html +++ b/BookingSystem/templates/forms/groups.html @@ -1,5 +1,6 @@ -
- +
diff --git a/BookingSystem/templates/index_admin.html b/BookingSystem/templates/index_admin.html index 79aa200..19324b6 100644 --- a/BookingSystem/templates/index_admin.html +++ b/BookingSystem/templates/index_admin.html @@ -1,81 +1,81 @@ {% extends 'layout.html' %} {% block extra_head %} -{% include 'templates/datatables.html' %} + {% include 'templates/datatables.html' %} {% endblock %} {% block content %} -
-

Vågen Utstyrbase

-

Velkommen! Her kan du levere inn og låne bort utstyr! -

-
+
+

Vågen Utstyrbase

+

Velkommen! Her kan du levere inn og låne bort utstyr! +

+
-
+
- - - - - - - - - + + + + + + + + + -{% if overdue_items %} -

-
-

- Overskredet utstyr: -

-
- - - - - - - - - - {% for item in overdue_items %} - - - - - - - {% endfor %} -
LøpenummerUtstyrUtlånt tilFrist for levering
{{ item.id }}{{ item.name }} ({{ item.category }}){{ item.lender }}{{ item.order_due_date|strftime }}
-{% endif %} + {% if overdue_items %} +

+
+

+ Overskredet utstyr: +

+
+ + + + + + + + + + {% for item in overdue_items %} + + + + + + + {% endfor %} +
LøpenummerUtstyrUtlånt tilFrist for levering
{{ item.id }}{{ item.name }} ({{ item.category }}){{ item.lender }}{{ item.order_due_date|strftime }}
+ {% endif %} - + {% endblock %} diff --git a/BookingSystem/templates/index_student.html b/BookingSystem/templates/index_student.html index 398ea5e..d103584 100644 --- a/BookingSystem/templates/index_student.html +++ b/BookingSystem/templates/index_student.html @@ -1,55 +1,56 @@ {% extends 'layout.html' %} {% block content %} -
-

Hei {{session.user.name}}!

-

Velkommen til utstyrsrommet! Før du kan bruke utstyrsrommet må du velge klassen og kontaktlæreren din fra listen - under.

-
- -
- - - - -
- - - -
-
-

Obs!

-

Ansvarsavtalen inkluderer økonomisk ansvar for utstyr som blir ødelagt eller mistet, i henhold til - avtalen. -

-
- - -
- -{% if session.user.active %} -
- Status: Du er klar til å bruke utstyrsrommet! -
-{% else %} -
- Status: - Du må oppdatere klassen din for å kunne bruke utstyrsrommet i år. -
-{% endif %} +
+

Hei {{ session.user.name }}!

+

Velkommen til utstyrsrommet! Før du kan bruke utstyrsrommet må du velge klassen og kontaktlæreren din fra + listen + under.

+
+ +
+ + + + +
+ + + +
+
+

Obs!

+

Ansvarsavtalen inkluderer økonomisk ansvar for utstyr som blir ødelagt eller mistet, i henhold til + avtalen. +

+
+ + +
+ + {% if session.user.active %} +
+ Status: Du er klar til å bruke utstyrsrommet! +
+ {% else %} +
+ Status: + Du må oppdatere klassen din for å kunne bruke utstyrsrommet i år. +
+ {% endif %} {% endblock %} diff --git a/BookingSystem/templates/innlevering.html b/BookingSystem/templates/innlevering.html index e79fad1..a66125b 100644 --- a/BookingSystem/templates/innlevering.html +++ b/BookingSystem/templates/innlevering.html @@ -1,74 +1,74 @@ {% extends 'layout.html' %} {% block extra_head %} -{% include 'templates/datatables.html' %} + {% include 'templates/datatables.html' %} {% endblock %} {% block content %} -
-

Aktive ordre

-

Sjekk at alt er med - bruk søkefeltet under til å dobbeltsjekke alle aktive ordre!

-
+
+

Aktive ordre

+

Sjekk at alt er med - bruk søkefeltet under til å dobbeltsjekke alle aktive ordre!

+
-
+
-{% include 'forms/return.html' %} + {% include 'forms/return.html' %} -{% if unavailable_items %} - - - - - - - - - - {% for item in unavailable_items %} - {% if item.overdue %} - - {% else %} - - {% endif %} - - - - - - {% endfor %} -
LøpenummerUtstyrUtlånt tilFrist for levering
{{ item.id }}{{ item.name }} ({{ item.category }}){{ item.lender }}{{ item.order_due_date|strftime }}
-{% else %} -
-

Smooth!

-

Alt utstyr ligger inne.

-
-{% endif %} + {% if unavailable_items %} + + + + + + + + + + {% for item in unavailable_items %} + {% if item.overdue %} + + {% else %} + + {% endif %} + + + + + + {% endfor %} +
LøpenummerUtstyrUtlånt tilFrist for levering
{{ item.id }}{{ item.name }} ({{ item.category }}){{ item.lender }}{{ item.order_due_date|strftime }}
+ {% else %} +
+

Smooth!

+

Alt utstyr ligger inne.

+
+ {% endif %} - + {% endblock %} diff --git a/BookingSystem/templates/inventar.html b/BookingSystem/templates/inventar.html index 40e7092..7bd33ca 100644 --- a/BookingSystem/templates/inventar.html +++ b/BookingSystem/templates/inventar.html @@ -1,77 +1,77 @@ {% extends 'layout.html' %} {% block extra_head %} -{% include 'templates/datatables.html' %} + {% include 'templates/datatables.html' %} {% endblock %} {% block content %} -
-

Inventar

-

Her kan du legge til og endre inventaren. Du kan også skrive ut etiketter.

-
+
+

Inventar

+

Her kan du legge til og endre inventaren. Du kan også skrive ut etiketter.

+
- - - + + + -
-
+
+
- - - - - - - - - - - - {% for item in items %} - - - - - - - - {% endfor %} - -
IDNavnKategoriSist settAdministrer
{{ item.id }}{{ item.name }}{{ item.category }}{{ item.last_seen }} - {% if item.available %} - Rediger - | - Etikett - {% else %} - Utlånt - {% endif %} -
+ + + + + + + + + + + + {% for item in items %} + + + + + + + + {% endfor %} + +
IDNavnKategoriSist settAdministrer
{{ item.id }}{{ item.name }}{{ item.category }}{{ item.last_seen }} + {% if item.available %} + Rediger + | + Etikett + {% else %} + Utlånt + {% endif %} +
- + {% endblock %} \ No newline at end of file diff --git a/BookingSystem/templates/inventar_add.html b/BookingSystem/templates/inventar_add.html index d25d2e1..f341601 100644 --- a/BookingSystem/templates/inventar_add.html +++ b/BookingSystem/templates/inventar_add.html @@ -1,115 +1,115 @@ {% extends 'layout.html' %} {% block extra_head %} -{% include 'templates/chosen.html' %} + {% include 'templates/chosen.html' %} {% endblock %} {% block content %} -
-

Legg til nytt inventar

-

Her kan du legge til nytt inventar. Legg gjerne til flere, så forlater du bare siden når du er ferdig

-
+
+

Legg til nytt inventar

+

Her kan du legge til nytt inventar. Legg gjerne til flere, så forlater du bare siden når du er ferdig

+
-
- - + + + - - + + - - + + - + - - - - - - -
Utskrift
- - - - - -
+ + + + + + +
Utskrift
+ + + + + +
- -
+ + - - - + + + - + }); + {% endblock %} diff --git a/BookingSystem/templates/inventar_edit.html b/BookingSystem/templates/inventar_edit.html index 0a769de..881d37c 100644 --- a/BookingSystem/templates/inventar_edit.html +++ b/BookingSystem/templates/inventar_edit.html @@ -1,93 +1,93 @@ {% extends 'layout.html' %} {% block extra_head %} -{% include 'templates/chosen.html' %} + {% include 'templates/chosen.html' %} {% endblock %} {% block content %} -
-

Rediger inventar

-

Redigerer {{ item.id }} ({{ item.name }})

-
+
+

Rediger inventar

+

Redigerer {{ item.id }} ({{ item.name }})

+
-
- - + + + - - + + - - + + - - + + - -
+ + - + - + {% endblock %} \ No newline at end of file diff --git a/BookingSystem/templates/inventar_print.html b/BookingSystem/templates/inventar_print.html index 0208ff9..e9d4f2b 100644 --- a/BookingSystem/templates/inventar_print.html +++ b/BookingSystem/templates/inventar_print.html @@ -1,71 +1,71 @@ {% extends 'layout.html' %} {% block content %} -
-

Skriv ut etikett

-

For {{ item.id }} ({{ item.name }})

-
+
+

Skriv ut etikett

+

For {{ item.id }} ({{ item.name }})

+
-
-
- Label preview -
+ +
+ Label preview +
- - - -
- - - - - -
+ + + +
+ + + + + +
- -
+ + - - - + + + - + {% endblock %} diff --git a/BookingSystem/templates/labelserver.html b/BookingSystem/templates/labelserver.html index 7d93485..1c7c313 100644 --- a/BookingSystem/templates/labelserver.html +++ b/BookingSystem/templates/labelserver.html @@ -1,5 +1,5 @@ {% extends 'layout.html' %} {% block content %} - + {% endblock %} \ No newline at end of file diff --git a/BookingSystem/templates/layout.html b/BookingSystem/templates/layout.html index e7ffe74..f4a0008 100644 --- a/BookingSystem/templates/layout.html +++ b/BookingSystem/templates/layout.html @@ -9,11 +9,11 @@
{% block header %} - {% if session.user and session.user.is_admin %} - {% include 'partials/header_admin.html' %} - {% else %} - {% include 'partials/header.html' %} - {% endif %} + {% if session.user and session.user.is_admin %} + {% include 'partials/header_admin.html' %} + {% else %} + {% include 'partials/header.html' %} + {% endif %} {% endblock %}
@@ -21,11 +21,11 @@
{% block footer %} - {% if session.user and session.user.is_admin %} - {% include 'partials/footer_admin.html' %} - {% else %} - {% include 'partials/footer.html' %} - {% endif %} + {% if session.user and session.user.is_admin %} + {% include 'partials/footer_admin.html' %} + {% else %} + {% include 'partials/footer.html' %} + {% endif %} {% endblock %}
diff --git a/BookingSystem/templates/login.html b/BookingSystem/templates/login.html index 29f9fa4..6a99cce 100644 --- a/BookingSystem/templates/login.html +++ b/BookingSystem/templates/login.html @@ -1,23 +1,23 @@ {% extends 'layout.html' %} {% block content %} -
-

Logg inn

-

For å kunne låne utstyr må du først logge inn med din Feide bruker

-
+
+

Logg inn

+

For å kunne låne utstyr må du først logge inn med din Feide bruker

+
- - - + + + -
+
-
- - Personvernerklæring - -
+
+ + Personvernerklæring + +
{% endblock %} \ No newline at end of file diff --git a/BookingSystem/templates/partials/head.html b/BookingSystem/templates/partials/head.html index 3311712..349b0ff 100644 --- a/BookingSystem/templates/partials/head.html +++ b/BookingSystem/templates/partials/head.html @@ -1,9 +1,9 @@ {% if session.user and session.user.is_admin %} -{% include 'partials/css.html' %} -{% include 'partials/js.html' %} + {% include 'partials/css.html' %} + {% include 'partials/js.html' %} {% else %} -{% include 'partials/css_student.html' %} -{% include 'partials/js_student.html' %} + {% include 'partials/css_student.html' %} + {% include 'partials/js_student.html' %} {% endif %} Utstyrbase diff --git a/BookingSystem/templates/partials/header.html b/BookingSystem/templates/partials/header.html index 4662735..b0797a6 100644 --- a/BookingSystem/templates/partials/header.html +++ b/BookingSystem/templates/partials/header.html @@ -1,9 +1,9 @@