mirror of
https://github.com/nelsbrock/NateMan.git
synced 2026-08-14 21:36:49 +02:00
Startseite für Angemeldete erreichbar gemacht
This commit is contained in:
@@ -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")
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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 %}
|
||||||
|
|||||||
Reference in New Issue
Block a user