From 4ec935a00e4a1982971b6c3688719ae06b985eac Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Thu, 2 Feb 2017 08:19:45 +0100 Subject: [PATCH] Aggiunta la navbar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ma non l'avevo giĆ  fatto ieri? --- server.py | 10 +++++----- static/style.css | 12 +++++++++++- templates/nav.html.j2 | 18 ++++++++++++++++++ 3 files changed, 34 insertions(+), 6 deletions(-) create mode 100644 templates/nav.html.j2 diff --git a/server.py b/server.py index 22b9739..414571a 100644 --- a/server.py +++ b/server.py @@ -141,7 +141,7 @@ def page_ente_show(eid): if request.method == "GET": ente = Ente.query.get(eid) css = url_for("static", filename="style.css") - return render_template("ente/show.html.j2", css=css, ente=ente, type="ente", user=session["username"]) + return render_template("ente/show.html.j2", css=css, ente=ente, user=session["username"]) else: ente = Ente.query.get(eid) ente.nomeente = request.form["nomeente"] @@ -189,7 +189,7 @@ def page_serv_list_plus(eid): return redirect(url_for('page_login')) serv = Servizio.query.join(Ente).filter_by(eid=eid).all() css = url_for("static", filename="style.css") - return render_template("servizio/list.html.j2", css=css, serv=serv, type="serv", user=session["username"]) + return render_template("servizio/list.html.j2", css=css, user=session["username"]) @app.route('/serv_show/', methods=['GET', 'POST']) def page_serv_show(sid): @@ -199,7 +199,7 @@ def page_serv_show(sid): serv = Servizio.query.get(sid) enti = Ente.query.all() css = url_for("static", filename="style.css") - return render_template("servizio/show.html.j2", css=css, serv=serv, enti=enti, type="serv", user=session["username"]) + return render_template("servizio/show.html.j2", css=css, serv=serv, enti=enti, user=session["username"]) else: serv = Servizio.query.get(sid) serv.eid = request.form["eid"] @@ -244,7 +244,7 @@ def page_imp_list_plus(sid): return redirect(url_for('page_login')) impiegati = Impiegato.query.join(Servizio).filter_by(sid=sid).join(Ente).all() css = url_for("static", filename="style.css") - return render_template("impiegato/list.html.j2", css=css, impiegati=impiegati, type="imp", user=session["username"]) + return render_template("impiegato/list.html.j2", css=css, impiegati=impiegati, user=session["username"]) @app.route('/imp_show/', methods=['GET', 'POST']) def page_imp_show(iid): @@ -254,7 +254,7 @@ def page_imp_show(iid): imp = Impiegato.query.get(iid) servizi = Servizio.query.all() css = url_for("static", filename="style.css") - return render_template("impiegato/show.html.j2", css=css, imp=imp, servizi=servizi, type="imp", user=session["username"]) + return render_template("impiegato/show.html.j2", css=css, imp=imp, servizi=servizi, user=session["username"]) else: imp = Impiegato.query.get(iid) imp.sid = request.form["sid"] diff --git a/static/style.css b/static/style.css index c17f331..64179dc 100644 --- a/static/style.css +++ b/static/style.css @@ -1,9 +1,19 @@ .goldfish { - width: 25vh; + width: 25%; } .monospace { font-family: "Consolas", monospace; } + +.btn-right +{ + margin-right: 16px; +} + +body +{ + padding-top: 70px; /*Per la navbar*/ +} diff --git a/templates/nav.html.j2 b/templates/nav.html.j2 new file mode 100644 index 0000000..83a03db --- /dev/null +++ b/templates/nav.html.j2 @@ -0,0 +1,18 @@ +