Software-Sektion + Drucker-Verwaltung + Slot-System + Selbstlern-Loop
Vier zusammenhaengende Iterationen, die das Funktions-Geruest der AG aufbauen.
Alle 6 Migrationen sind idempotent und legen Schema-Erweiterungen + initiale
Seeds an (Mock-Projekte nur, falls Profil 100 existiert — auf prod nicht).
Software-Sektion (Etappe 3):
- software_seite-Tabelle: schlanker Karten-Katalog (slug, titel, urls,
plattform, kategorie, sortierung, Cover-BLOB)
- 7 Initial-Karten (Bambu Studio/Handy, Printables, MakerWorld,
TinkerCAD, Onshape, Gridfinity-Generator)
- Admin-Verwaltung: Liste, Anlegen-Form, Bearbeiten, Aktiv-Toggle,
Hart-Loeschen, Bild-Upload via Crop-Tool (Strg+V/Drag&Drop, 400x400)
Drucker-Verwaltung (Etappe 5-vorgezogen):
- drucker.freigegeben + gesperrt_grund (Lehrer-Sperre fuer Reparatur)
- drucker.manual_url + troubleshooting_url (Override fuer Modell-Defaults)
- SuS-View /drucker (eingeloggt): Kacheln + Sperre-Banner + Belegung
- Admin /admin/drucker: Status-Override (idle/printing/failed/...),
Sperren/Freigeben mit Grund, Inline-Edit fuer URLs
Slot-System / Reservierung (Etappe 7-vorgezogen):
- profil.reservieren_freigeschaltet (Lehrer schaltet manuell frei,
ersetzt L1-Gate-Automatismus)
- services/slots.py: Konflikt-Check, Belegungs-Helper
- SuS-Routen /cockpit/slot/neu (mit Konflikt-Check), /cockpit/slots,
Stornieren
- Admin /admin/slots Uebersicht + /admin/slot/neu (Lehrer reserviert
fuer SuS) + Hart-Loeschen + Profil-Freigabe-Toggle
Selbstlern-Loop (Etappe 6 — Kern):
- projekt-Spalten: 3-Achsen-Eval (Gesamt + Planung + Ausfuehrung),
was_klappte_nicht, cover_blob, modellier_software_slug,
drucker_id_used, makerworld_url
- Regel: max. 1 aktives Projekt pro SuS, neues nur nach Freigabe
(auto bei zufrieden/mittel, Lehrer-Review bei gelernt)
- SuS-Werkstatt-Sektion: Titel + Beschreibung + Software-Dropdown +
Drucker-Dropdown + MakerWorld-URL + Files-Upload (drag&drop,
base64, max 30 MB)
- Cover-Bild via Crop-Tool (Re-use admin_software_bild-Pattern)
- Abschluss-Block: Pflicht Cover + mindestens 1 Datei
- Eval-Form: visuelle 3x3 Radio-Karten + 2 Freitexte
- Lehrer-Review: /admin/projekte mit Filter (wartet/in_arbeit/
abgeschlossen/rueckfrage), Aktionen freigeben/rueckfrage/loeschen
- Oeffentlicher Katalog /projekte: Sortier-Tabelle (Titel/Person/
Status/Erfolg/Datum), aufklappbare Detail mit Cover/Beschreibung/
Datei-Downloads/MakerWorld-Link
- Wiederhol-Logik: "Sowas mache ich auch" via Verknuepfung
(vorlage_projekt_id), bidirektionale Lineage-Banner
Cockpit-Refactoring:
- Projekt-Karte ganz oben (vor Onboarding) mit "Hier weitermachen"
- Check-In-Quick-Actions: nach Auswahl direkt zu /cockpit/projekt/neu,
/drucker, /lektionen, /cockpit/projekt/<aktiv>
- "Modus aendern"-Button im Eingecheckt-Banner
- Admin-Dashboard-Hub mit Karten: SuS-Profile, Software, Lektionen,
Drucker, Reservierungen, Projekte (Badge bei wartenden), Alph
Bug-Fixes:
- Admin-Login redirected jetzt auf /admin/dashboard statt /admin/profile
- app.py: neue Jinja-Filter iso_format + dauer_min
- .gitignore: .claude/ ausschliessen (lokale launch.json)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -100,10 +100,15 @@ def get_ungelesene_notizen(profil_id: int) -> list[dict]:
|
||||
|
||||
|
||||
def get_aktive_projekte(profil_id: int) -> list[dict]:
|
||||
"""Eigene Projekte mit status_lebenszyklus='in_arbeit' (Etappe 6 fuellt das voll)."""
|
||||
"""Eigene Projekte mit status_lebenszyklus='in_arbeit'.
|
||||
|
||||
Nach Etappe 6: max. 1 (Regel "ein aktives Projekt pro SuS").
|
||||
Liefert trotzdem Liste, damit das Template unveraendert bleibt.
|
||||
"""
|
||||
conn = get_db()
|
||||
rows = conn.execute(
|
||||
"SELECT id, titel, beschreibung_md, geaendert_am "
|
||||
"SELECT id, titel, beschreibung_md, geaendert_am, "
|
||||
" (cover_blob IS NOT NULL) AS hat_cover "
|
||||
"FROM projekt "
|
||||
"WHERE profil_id = ? AND status_lebenszyklus = 'in_arbeit' "
|
||||
"ORDER BY geaendert_am DESC",
|
||||
@@ -113,6 +118,26 @@ def get_aktive_projekte(profil_id: int) -> list[dict]:
|
||||
return [dict(r) for r in rows]
|
||||
|
||||
|
||||
def get_projekt_kontext(profil_id: int) -> dict:
|
||||
"""Liefert den Projekt-Kontext fuers Cockpit:
|
||||
- aktives (in_arbeit)
|
||||
- darf_neues + sperr_grund
|
||||
- letztes_abgeschlossenes (wenn Wartet auf Freigabe oder Rueckfrage: anzeigen)
|
||||
"""
|
||||
from services.projekte import darf_neues_anlegen, aktives_projekt, letztes_projekt
|
||||
conn = get_db()
|
||||
aktiv = aktives_projekt(conn, profil_id)
|
||||
darf, grund = darf_neues_anlegen(conn, profil_id)
|
||||
letztes = letztes_projekt(conn, profil_id) if not aktiv else None
|
||||
conn.close()
|
||||
return {
|
||||
"aktiv": dict(aktiv) if aktiv else None,
|
||||
"darf_neues": darf,
|
||||
"sperr_grund": grund,
|
||||
"letztes": dict(letztes) if letztes else None,
|
||||
}
|
||||
|
||||
|
||||
def get_paarung(profil_id: int) -> Optional[dict]:
|
||||
"""Aktive Paarung des SuS (oder None)."""
|
||||
conn = get_db()
|
||||
@@ -185,6 +210,7 @@ def get_cockpit_status(profil_id: int) -> dict:
|
||||
"""
|
||||
onb = get_onboarding_fortschritt(profil_id)
|
||||
aktive_projekte = get_aktive_projekte(profil_id)
|
||||
projekt_kontext = get_projekt_kontext(profil_id)
|
||||
paarung = get_paarung(profil_id)
|
||||
return {
|
||||
"onboarding": onb,
|
||||
@@ -192,6 +218,7 @@ def get_cockpit_status(profil_id: int) -> dict:
|
||||
"rueckfragen": get_offene_rueckfragen(profil_id),
|
||||
"notizen": get_ungelesene_notizen(profil_id),
|
||||
"aktive_projekte": aktive_projekte,
|
||||
"projekt": projekt_kontext, # neu: Selbstlern-Loop-Kontext
|
||||
"paarung": paarung,
|
||||
"offene_anfragen": get_offene_anfragen_an_mich(profil_id),
|
||||
# Progressive-Schalter:
|
||||
|
||||
Reference in New Issue
Block a user