Cockpit (V1, progressives Layout): - /cockpit zeigt nur Karten, die zum Status passen. Onboarding-Karte nur fuer Neue; Paarungs-Karte immer wenn aktiv; Drucker-Buchung erst nach L1 fertig. - Banner-System: ungelesene Lehrer-Notizen, offene Rueckfragen, eingegangene Paarungs-Anfragen. Check-In (V3 + E-021): - Modal beim ersten Cockpit-Aufruf eines Besuchstages. - "Ich arbeite weiter" als Default-Ein-Klick-Option. - Freitext optional. - POST /cockpit/check-in mit UNIQUE-Constraint pro Tag. Onboarding-Status (E-019): - /cockpit/lektion/<nr>/status (selbst-zertifiziert). - profil_lektion_status-Tabelle, ON CONFLICT-Upsert. Paarung (E-002): - profil_anfrage-Tabelle on-demand. - Anfrage stellen / annehmen / ablehnen / aufloesen. - Konflikt-Check (keine Doppel-Paarungen). - Banner im Cockpit des Adressaten. Lehrer-Dashboard (V5, docs/lehrer-dashboard.md): - /admin/dashboard mit 4 Sektionen (Wer ist heute hier / Wartet auf Review / Drucker-Status / Wer haengt fest) + Schnell-Zahlen + offene Rueckfragen. - "Notiz hinterlassen"-Quick-Action via lehrer_notiz-Tabelle. - Live-Drucker-Status kommt mit Etappe 5 (aktuell nur DB-Stand). Daten-Helper getrennt: - services/cockpit_status.py: Bundle fuer progressives Cockpit - services/dashboard_status.py: 4-Sektionen-Queries Vorgezogen aus Etappe 3: - /lektionen + /lektion/<nr> Minimal-Renderer mit Markdown - 3 Onboarding-Lektionen als Seeds (Platzhalter-Text fuer Markus) Smoke-Test bestanden: Login als neuer SuS -> Onboarding -> Check-In -> L1 fertig -> Paarung mit zweitem SuS -> Admin-Dashboard -> Lehrer-Notiz -> Banner im Cockpit.
76 lines
1.8 KiB
Python
76 lines
1.8 KiB
Python
"""Oeffentliche Routen (kein Login noetig).
|
|
|
|
Etappe 1: nur Startseite + Error-Handler portiert.
|
|
Etappe 3: Lektionen, Software, Projekt-Katalog, Troubleshooting.
|
|
Etappe 5: Drucker-Live-View.
|
|
"""
|
|
from flask import Blueprint, render_template, abort
|
|
|
|
bp = Blueprint("oeffentlich", __name__)
|
|
|
|
|
|
@bp.route("/")
|
|
def index():
|
|
return render_template("index.html")
|
|
|
|
|
|
# Stubs fuer spaetere Etappen — geben 501 zurueck, damit Navigation nicht bricht.
|
|
|
|
@bp.route("/lektionen")
|
|
def lektionen():
|
|
"""Lektions-Uebersicht — Etappe 2 minimal, Etappe 3 voll mit Status-Badges."""
|
|
from database import get_db
|
|
conn = get_db()
|
|
lektionen = conn.execute(
|
|
"SELECT nummer, titel, onboarding, schwierigkeit FROM lektion "
|
|
"WHERE aktiv = 1 ORDER BY nummer"
|
|
).fetchall()
|
|
conn.close()
|
|
return render_template("lektionen.html", lektionen=lektionen)
|
|
|
|
|
|
@bp.route("/lektion/<int:nummer>")
|
|
def lektion_detail(nummer):
|
|
"""Lektion einzeln — Etappe 2 minimal, Etappe 3 mit Status-Buttons + Inline-Edit."""
|
|
from database import get_db
|
|
conn = get_db()
|
|
lektion = conn.execute(
|
|
"SELECT nummer, titel, onboarding, aufgabe_md, tipp_md, extern_link, schwierigkeit "
|
|
"FROM lektion WHERE nummer = ? AND aktiv = 1",
|
|
(nummer,)
|
|
).fetchone()
|
|
conn.close()
|
|
if not lektion:
|
|
abort(404)
|
|
return render_template("lektion_detail.html", lektion=lektion)
|
|
|
|
|
|
@bp.route("/software")
|
|
def software():
|
|
abort(501)
|
|
|
|
|
|
@bp.route("/software/<slug>")
|
|
def software_detail(slug):
|
|
abort(501)
|
|
|
|
|
|
@bp.route("/projekte")
|
|
def projekte():
|
|
abort(501)
|
|
|
|
|
|
@bp.route("/projekte/<int:projekt_id>")
|
|
def projekt_detail(projekt_id):
|
|
abort(501)
|
|
|
|
|
|
@bp.route("/troubleshooting")
|
|
def troubleshooting():
|
|
abort(501)
|
|
|
|
|
|
@bp.route("/drucker")
|
|
def drucker():
|
|
abort(501)
|