From 4970653e4445b1c16f26b50f80b1cf73a5d8cb54 Mon Sep 17 00:00:00 2001 From: Lorenzo Date: Mon, 11 Sep 2017 15:42:28 +0200 Subject: [PATCH] Add Impiegato details page --- server.py | 10 +++++++- templates/dispositivo/details.htm | 2 +- templates/impiegato/details.htm | 38 +++++++++++++++++++++++++++++++ 3 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 templates/impiegato/details.htm diff --git a/server.py b/server.py index a70c6ce..41cd0e8 100644 --- a/server.py +++ b/server.py @@ -410,12 +410,20 @@ def page_disp_list(): def page_details_host(did): if 'username' not in session: return redirect(url_for('page_login')) - disp = Dispositivo.query.filter_by(did=did).first() + disp = Dispositivo.query.filter_by(did=did).first_or_404() accessi = Accesso.query.filter_by(did=did).all() css = url_for("static", filename="style.css") return render_template("dispositivo/details.htm", css=css, disp=disp, accessi=accessi, type="disp", user=session["username"]) +@app.route('/imp_details/') +def page_details_imp(iid): + if 'username' not in session: + return redirect(url_for('page_login')) + impiegato = Impiegato.query.filter_by(iid=iid).first() + css = url_for("static", filename="style.css") + return render_template("impiegato/details.htm", css=css, imp=impiegato, type="imp",user=session["username"]) + if __name__ == "__main__": # db.create_all() # p = b"admin" diff --git a/templates/dispositivo/details.htm b/templates/dispositivo/details.htm index 3360132..2db3fd8 100644 --- a/templates/dispositivo/details.htm +++ b/templates/dispositivo/details.htm @@ -43,7 +43,7 @@ diff --git a/templates/impiegato/details.htm b/templates/impiegato/details.htm new file mode 100644 index 0000000..0fd3dc2 --- /dev/null +++ b/templates/impiegato/details.htm @@ -0,0 +1,38 @@ +{% extends "base.htm" %} +{% block title %}Dettagli Impiegato{% endblock %} +{% block content %} +

+ Ispeziona Impiegato +

+ + + + +{% endblock %} \ No newline at end of file