From 4f0354b94e700157c0aa948fd91e8580d0f74dfa Mon Sep 17 00:00:00 2001 From: Stefano Date: Mon, 18 Sep 2017 16:31:17 +0200 Subject: [PATCH] Remove net_add page --- server.py | 4 ++-- templates/net/add.htm | 15 --------------- templates/net/show.htm | 20 ++++++++++++-------- 3 files changed, 14 insertions(+), 25 deletions(-) delete mode 100644 templates/net/add.htm diff --git a/server.py b/server.py index a4cbffc..40496a3 100644 --- a/server.py +++ b/server.py @@ -662,7 +662,7 @@ def page_net_add(): if 'username' not in session: return abort(403) if request.method == 'GET': - return render_template("net/add.htm", pagetype="net", user=session.get("username")) + return render_template("net/show.htm", action="add", pagetype="net", user=session.get("username")) else: try: int(request.form["subnet"]) @@ -719,7 +719,7 @@ def page_net_show(nid): return abort(403) if request.method == 'GET': net = Rete.query.filter_by(nid=nid).first_or_404() - return render_template("net/show.htm", net=net, pagetype="net", user=session.get("username")) + return render_template("net/show.htm", action="show", net=net, pagetype="net", user=session.get("username")) else: net = Rete.query.filter_by(nid=nid).first_or_404() net.nome = request.form['nome'] diff --git a/templates/net/add.htm b/templates/net/add.htm deleted file mode 100644 index 61bd677..0000000 --- a/templates/net/add.htm +++ /dev/null @@ -1,15 +0,0 @@ -{% extends "base.htm" %} -{% block title %}Aggiungi rete • estus{% endblock %} -{% block content %} -

- Aggiungi nuova rete -

-
- - - - - - -
-{% endblock %} diff --git a/templates/net/show.htm b/templates/net/show.htm index d79ecfc..cd8001d 100644 --- a/templates/net/show.htm +++ b/templates/net/show.htm @@ -1,15 +1,19 @@ {% extends "base.htm" %} -{% block title %}Aggiungi rete • estus{% endblock %} +{% block title %}Modifica rete • estus{% endblock %} {% block content %}

- Aggiungi nuova rete + {% if action == "add" %} + Aggiungi rete + {% elif action == "show" %} + Modifica rete + {% endif %}

-
- - - - - + + + + + +
{% endblock %}