diff --git a/server.py b/server.py index fcd767e..3d99fff 100644 --- a/server.py +++ b/server.py @@ -264,7 +264,7 @@ def page_ente_add(): if 'username' not in session: return abort(403) if request.method == 'GET': - return render_template("ente/add.htm", pagetype="ente", user=session.get("username")) + return render_template("ente/show.htm", action="add", pagetype="ente", user=session.get("username")) else: nuovoent = Ente(request.form['nomeente'], request.form['nomebreveente']) db.session.add(nuovoent) @@ -305,7 +305,7 @@ def page_ente_show(eid): return abort(403) if request.method == "GET": ente = Ente.query.get_or_404(eid) - return render_template("ente/show.htm", ente=ente, user=session.get("username")) + return render_template("ente/show.htm", action="show", ente=ente, user=session.get("username")) else: ente = Ente.query.get_or_404(eid) ente.nomeente = request.form["nomeente"] diff --git a/templates/ente/add.htm b/templates/ente/add.htm deleted file mode 100644 index c79355b..0000000 --- a/templates/ente/add.htm +++ /dev/null @@ -1,12 +0,0 @@ -{% extends "base.htm" %} -{% block title %}Aggiungi ente • estus{% endblock %} -{% block content %} -

- Aggiungi nuovo ente -

-
- - - -
-{% endblock %} \ No newline at end of file diff --git a/templates/ente/show.htm b/templates/ente/show.htm index a66c6f5..41d0adc 100644 --- a/templates/ente/show.htm +++ b/templates/ente/show.htm @@ -2,12 +2,15 @@ {% block title %}Modifica ente • estus{% endblock %} {% block content %}

- Modifica ente + {% if action == "add" %} + Crea ente + {% elif action == "show" %} + Modifica ente + {% endif %}

-
- - + + +
{% endblock %}