diff --git a/README.md b/README.md index 256e771..1a232bc 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ NateMan (**Na**chschreib**te**rmin-**Man**ager) ist eine Webanwendung zur Koordi * Excel-Export von Nachschreibplänen mit automatischer Terminzuordnung * Klausurerinnerungen an Lehrkräfte per E-Mail * öffentlich einsehbare Klausurpläne +* individuelle Klausurplanansicht für Schüler und Schülerinnen ## Schnelle Installation @@ -20,7 +21,7 @@ NateMan (**Na**chschreib**te**rmin-**Man**ager) ist eine Webanwendung zur Koordi 1. Installieren Sie [Python](https://www.python.org/downloads/) und [Python-Venv](https://docs.python.org/3/library/venv.html).
Details - + Unter Linux (Debian und Derivate) installieren Sie die Pakete `python3` und `python3-venv`.\ Unter Windows und macOS laden Sie den [Python-Installer](https://www.python.org/downloads/) herunter und führen Sie ihn aus. Python-Venv wird standardmäßig mitinstalliert.
@@ -35,7 +36,7 @@ NateMan (**Na**chschreib**te**rmin-**Man**ager) ist eine Webanwendung zur Koordi python3 -m venv venv source venv/bin/activate ``` - + **Windows:** ```dos mkdir nateman @@ -63,4 +64,4 @@ An der Entwicklung sind beteiligt: * [Niklas Elsbrock](https://github.com/nelsbrock) (Hauptentwickler) * [Johannes Bingel](https://github.com/Hecht376) (Exportfunktion und Excel-Importfunktion) -* Dipl.-Inform. Christian Wolf, OStR (Idee und Betreuung) \ No newline at end of file +* Dipl.-Inform. Christian Wolf, OStR (Idee und Betreuung) diff --git a/nateman/blueprints/klausuren.py b/nateman/blueprints/klausuren.py index 3e2fa18..2a6e815 100644 --- a/nateman/blueprints/klausuren.py +++ b/nateman/blueprints/klausuren.py @@ -43,6 +43,29 @@ def mine(): klausuren_vergangen=klausuren_vergangen) +@bp.route("/schueler", endpoint="schueler") +def schueler_(): + schueler_id = request.args.get("id") + schueler_nachname = request.args.get("nachname") + if schueler_id is None or schueler_nachname is None: + flash("Fehlende Schülerdaten.", "error") + return redirect(url_for("index.index"), code=303) + schueler = Schueler.query.filter_by(id=schueler_id, nachname=schueler_nachname).first() + if schueler is None: + flash("Ungültige Schülerdaten.", "error") + return redirect(url_for("index.index"), code=303) + + kt_query = Klausurteilnahme.query.join(Schueler).join(Klausur) \ + .filter(Schueler.id == schueler_id) \ + .order_by(Klausur.date) + + kt_anstehend = kt_query.filter(Klausur.date > datetime.now().date()).all() + kt_vergangen = kt_query.filter(Klausur.date <= datetime.now().date()).all() + + return render_template("klausuren/schueler.html.j2", schueler=schueler, kt_vergangen=kt_vergangen, + kt_anstehend=kt_anstehend) + + @bp.route("//", endpoint="stufe") def stufe_(stufe_name): """ Ansicht der Klausuren einer Stufe (Seite *Klausuren [Stufe]*) """ diff --git a/nateman/templates/index/index.html.j2 b/nateman/templates/index/index.html.j2 index dd80bbf..22eff00 100644 --- a/nateman/templates/index/index.html.j2 +++ b/nateman/templates/index/index.html.j2 @@ -35,4 +35,23 @@ oder sich als Lehrer anmelden {%- endif -%}.

+ +
+ +

Klausurpläne für Schüler und Schülerinnen

+
+
+
+
+
+
+
+
+
+
+
+

+ +

+
{% endblock %} diff --git a/nateman/templates/klausuren/schueler.html.j2 b/nateman/templates/klausuren/schueler.html.j2 new file mode 100644 index 0000000..beaefee --- /dev/null +++ b/nateman/templates/klausuren/schueler.html.j2 @@ -0,0 +1,68 @@ +{# + NateMan – Nachschreibtermin-Manager + templates/klausuren/schueler.html.j2 + Copyright © 2021 Niklas Elsbrock + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +-#} + +{% extends 'base.html.j2' %} + +{% macro kt_table(kt_list) %} + {% if kt_list|length == 0 %} +

keine

+ {% else %} + + + + + + + + + + + {% for kt in kt_list %} + + + + + + + {% endfor %} + +
DatumLehrkraftKursZeitraum
{{ macros.date(kt.klausur.date) }}{{ kt.klausur.lehrer.kuerzel }}{{ kt.klausur.kursname }}{{ macros.zeitraum(kt.klausur) }} Std.
+ {% endif %} +{% endmacro %} + +{% block title %} + Klausurplan für {{ schueler.vorname }} {{ schueler.nachname }} ({{ schueler.stufe.name }}) +{% endblock %} +{% block header %} + Klausurplan für {{ schueler.vorname }} {{ schueler.nachname }} ({{ schueler.stufe.name }}) +{% endblock %} + +{# schueler #} +{# kt_vergangen #} +{# kt_anstehend #} + +{% block content %} + +

vergangen:

+{{ kt_table(kt_vergangen) }} + +

anstehend:

+{{ kt_table(kt_anstehend) }} + +{% endblock %}