revert b968825aae
revert U19: Spielstand speichern - Session, INSERT, UPDATE, Weiterspielen
This commit is contained in:
parent
1299ce57e0
commit
f760af8e31
1 changed files with 1 additions and 13 deletions
14
app/app.py
14
app/app.py
|
|
@ -1,10 +1,9 @@
|
||||||
from flask import Flask, request, session, redirect
|
from flask import Flask, request
|
||||||
import html
|
import html
|
||||||
import sqlite3
|
import sqlite3
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
app.secret_key = "geheimnis-aus-dem-weltall"
|
|
||||||
DB_PATH = Path(__file__).with_name("adventure.db")
|
DB_PATH = Path(__file__).with_name("adventure.db")
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -210,10 +209,6 @@ def raum(id):
|
||||||
body = f"""
|
body = f"""
|
||||||
<h1>{html.escape(r['name'])}</h1>
|
<h1>{html.escape(r['name'])}</h1>
|
||||||
<p>{html.escape(r['beschreibung'])}</p>
|
<p>{html.escape(r['beschreibung'])}</p>
|
||||||
"""
|
|
||||||
if "spieler" in session:
|
|
||||||
body = body + '<p><small>Unterwegs als: ' + html.escape(session["spieler"]) + '</small></p>'
|
|
||||||
body = body + """
|
|
||||||
<div class="links">
|
<div class="links">
|
||||||
"""
|
"""
|
||||||
for a in ausgaenge:
|
for a in ausgaenge:
|
||||||
|
|
@ -222,12 +217,5 @@ def raum(id):
|
||||||
return render_page(html.escape(r["name"]), body)
|
return render_page(html.escape(r["name"]), body)
|
||||||
|
|
||||||
|
|
||||||
@app.route("/reset")
|
|
||||||
@app.route("/app/reset")
|
|
||||||
def reset():
|
|
||||||
session.pop("spieler", None)
|
|
||||||
return redirect("/app/")
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
app.run(host="0.0.0.0", port=9004)
|
app.run(host="0.0.0.0", port=9004)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue