Compare commits
3 Commits
e6c8964f19
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| e3a4fc4758 | |||
| c2fab079a5 | |||
| 11a3f8a31e |
9
app.py
9
app.py
@@ -65,23 +65,24 @@ def delete_compito(id):
|
|||||||
compiti.remove(ciscomerda)
|
compiti.remove(ciscomerda)
|
||||||
update_file()
|
update_file()
|
||||||
return jsonify(ciscomerda), 200
|
return jsonify(ciscomerda), 200
|
||||||
update_file()
|
|
||||||
return jsonify([]), 404
|
return jsonify([]), 404
|
||||||
|
|
||||||
@app.route("/ui")
|
@app.route("/ui")
|
||||||
def web_ui():
|
def web_ui():
|
||||||
# Tabella compiti
|
# Tabella compiti
|
||||||
html = "<table border>"
|
html = "<html><head>"
|
||||||
|
html += "<meta charset=\"UTF-8\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>Gestione compiti</title>"
|
||||||
|
html += "</head><body><table border>"
|
||||||
for ciscomerda in compiti:
|
for ciscomerda in compiti:
|
||||||
html += "<tr>"
|
html += "<tr>"
|
||||||
html += f"<td>{ciscomerda["descrizione"]}</td><td><a href=\"/form_delete?id={ciscomerda["id"]}\" class=\"button\">Elimina</a>"
|
html += f"<td>{ciscomerda["descrizione"]}</td><td><a href=\"/form_delete?id={ciscomerda["id"]}\" class=\"button\"><button>Elimina</button></a>"
|
||||||
html += "</tr>"
|
html += "</tr>"
|
||||||
html += "</table>"
|
html += "</table>"
|
||||||
|
|
||||||
html += "<form action=\"/form_add\">"
|
html += "<form action=\"/form_add\">"
|
||||||
html += "<input type=\"text\" name=\"descrizione\" placeholder=\"Descrizione compito\">"
|
html += "<input type=\"text\" name=\"descrizione\" placeholder=\"Descrizione compito\">"
|
||||||
html += "<input type=\"submit\" value=\"Aggiungi compito\">"
|
html += "<input type=\"submit\" value=\"Aggiungi compito\">"
|
||||||
html += "</form>"
|
html += "</form></body></html>"
|
||||||
|
|
||||||
return html, 200
|
return html, 200
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user