init turbo

This commit is contained in:
2024-04-05 11:22:14 +02:00
parent 56ec2cfb15
commit 8be441bab9
6 changed files with 74 additions and 50 deletions

View File

@ -23,10 +23,14 @@ def index():
Leitet den normalen Website-Aufruf zum Login weiter.
:return HTML:
"""
return redirect(url_for("login"))
if current_user.is_authenticated:
return welcome()
else:
return login()
@app.route("/dashboard")
@app.route("/dashboard", methods=["GET", "POST"])
@login_required
def welcome():
"""
@ -46,7 +50,15 @@ def welcome():
else:
t = "hidden"
p = ""
return render_template('dashboard.html', kurs=kurs, name=name, theorie=t, praxis=p)
if turbo.can_stream():
print ("Streaming...")
return turbo.stream([
turbo.update(
render_template('dashboard.html', kurs=kurs, name=name, theorie=t, praxis=p), target="content")
])
else:
print ("Not streaming!")
return render_template('dashboard.html', kurs=kurs, name=name, theorie=t, praxis=p)
@app.route("/theorie/noten")