Startseite für Angemeldete erreichbar gemacht

This commit is contained in:
2021-09-01 21:12:10 +02:00
parent 3687de6069
commit fd2eb164e1
3 changed files with 8 additions and 8 deletions
+2 -5
View File
@@ -19,15 +19,12 @@
Index-Blueprint Index-Blueprint
""" """
from flask import Blueprint, g, redirect, url_for, render_template from flask import Blueprint, render_template
bp = Blueprint("index", __name__) bp = Blueprint("index", __name__)
@bp.route("/") @bp.route("/")
def index(): def index():
""" Startseite (Pfad ``/``, leitet bei angemeldetem Lehrer auf Klausurseite um) """ """ Startseite (Pfad ``/``) """
if g.lehrer is not None:
return redirect(url_for("klausuren.mine"), code=303)
else:
return render_template("index/index.html.j2") return render_template("index/index.html.j2")
+1 -1
View File
@@ -54,7 +54,7 @@
<body> <body>
<header> <header>
<a id="nateman-logo-container" href="{{ url_for('klausuren.mine' if g.lehrer is not none else 'index.index') }}"> <a id="nateman-logo-container" href="{{ url_for('index.index') }}">
<img id="nateman-logo" alt="NateMan Logo" <img id="nateman-logo" alt="NateMan Logo"
src="{{ url_for('static', filename='img/logo.png') }}" draggable="false"> src="{{ url_for('static', filename='img/logo.png') }}" draggable="false">
</a> </a>
+4 -1
View File
@@ -30,6 +30,9 @@
{%- if not loop.first -%}{%- if loop.last %} und {% else -%}, {% endif -%}{%- endif -%} {%- if not loop.first -%}{%- if loop.last %} und {% else -%}, {% endif -%}{%- endif -%}
<a href="{{ url_for('klausuren.stufe', stufe_name=stufe.name) }}">{{ stufe.name }}</a> <a href="{{ url_for('klausuren.stufe', stufe_name=stufe.name) }}">{{ stufe.name }}</a>
{%- endfor %} {%- endfor %}
einsehen oder sich als Lehrer <a href="{{ url_for('auth.login') }}">anmelden</a>. einsehen
{%- if g.lehrer is none %}
oder sich als Lehrer <a href="{{ url_for('auth.login') }}">anmelden</a>
{%- endif -%}.
</p> </p>
{% endblock %} {% endblock %}