Etappe 2: Cockpit progressiv + Check-In + Paarung + Lehrer-Dashboard
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.
This commit is contained in:
182
templates/admin_dashboard.html
Normal file
182
templates/admin_dashboard.html
Normal file
@@ -0,0 +1,182 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}Dashboard — Admin{% endblock %}
|
||||
{% block content %}
|
||||
|
||||
<div class="section-header">
|
||||
<h1>Dashboard</h1>
|
||||
<div>
|
||||
<a href="{{ url_for('admin.profile_liste') }}" class="btn btn-secondary">Profile</a>
|
||||
<a href="{{ url_for('admin.admin_logout') }}" class="btn btn-secondary">Admin-Logout</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{# ====== Schnell-Zahlen ====== #}
|
||||
<div class="grid" style="grid-template-columns: repeat(3, 1fr); gap: 1rem;">
|
||||
<div class="stat-card">
|
||||
<div class="number">{{ zahlen.heute_n }}</div>
|
||||
<div class="label">heute eingecheckt</div>
|
||||
</div>
|
||||
<div class="stat-card" style="{% if zahlen.review_n > 0 %}border: 2px solid var(--warning);{% endif %}">
|
||||
<div class="number" style="{% if zahlen.review_n > 0 %}color: var(--warning);{% endif %}">{{ zahlen.review_n }}</div>
|
||||
<div class="label">wartet auf Review</div>
|
||||
</div>
|
||||
<div class="stat-card" style="{% if zahlen.drucker_problem_n > 0 %}border: 2px solid var(--danger);{% endif %}">
|
||||
<div class="number" style="{% if zahlen.drucker_problem_n > 0 %}color: var(--danger);{% endif %}">{{ zahlen.drucker_problem_n }}</div>
|
||||
<div class="label">Drucker-Problem</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{# ====== Sektion 1: Wer ist heute hier ====== #}
|
||||
<div class="card" style="margin-top: 1.5rem;">
|
||||
<h2>👋 Wer ist heute hier ({{ heute|length }})</h2>
|
||||
{% if heute %}
|
||||
<table>
|
||||
<thead>
|
||||
<tr><th></th><th>Vorname</th><th>Modus</th><th>Notiz</th><th>seit</th><th></th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for h in heute %}
|
||||
<tr>
|
||||
<td style="font-size: 1.6rem;">{{ tier_emoji(h.tier) }}</td>
|
||||
<td><strong>{{ h.vorname }}</strong></td>
|
||||
<td>
|
||||
{% if h.modus == 'weiter_wie_bisher' %}Arbeitet weiter
|
||||
{% elif h.modus == 'neues_projekt' %}🆕 Neues Projekt
|
||||
{% elif h.modus == 'onboarding' %}📚 Onboarding
|
||||
{% elif h.modus == 'drucken' %}🖨️ Drucken
|
||||
{% elif h.modus == 'helfen' %}🤝 Hilft anderen
|
||||
{% else %}{{ h.modus }}{% endif %}
|
||||
</td>
|
||||
<td style="font-style: italic; color: var(--text-light); font-size: 0.9rem;">{{ h.freitext or "" }}</td>
|
||||
<td style="font-size: 0.85rem; color: var(--text-light);">{{ h.erstellt_am[11:16] if h.erstellt_am else '' }}</td>
|
||||
<td>
|
||||
<details>
|
||||
<summary class="btn btn-secondary" style="padding: 0.2rem 0.5rem; font-size: 0.8rem; list-style: none;">Notiz schreiben</summary>
|
||||
<form method="post" action="{{ url_for('admin.profil_notiz', profil_id=h.profil_id) }}" style="margin-top: 0.4rem; display: flex; gap: 0.3rem;">
|
||||
<input type="text" name="text" placeholder="Kurze Nachricht …" required
|
||||
style="padding: 0.3rem; border: 1px solid var(--border); border-radius: 4px; width: 220px;">
|
||||
<button class="btn btn-primary" style="padding: 0.3rem 0.6rem; font-size: 0.85rem;">senden</button>
|
||||
</form>
|
||||
</details>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% else %}
|
||||
<p style="color: var(--text-light);">Noch keiner heute eingecheckt.</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{# ====== Sektion 2: Wartet auf Review ====== #}
|
||||
<div class="card">
|
||||
<h2>⏳ Wartet auf Review ({{ review|length }})</h2>
|
||||
{% if review %}
|
||||
<table>
|
||||
<thead><tr><th></th><th>Projekt</th><th>SuS</th><th>Selbsteinschaetzung</th><th>abgeschlossen</th><th></th></tr></thead>
|
||||
<tbody>
|
||||
{% for r in review %}
|
||||
<tr>
|
||||
<td style="font-size: 1.4rem;">{{ tier_emoji(r.tier) }}</td>
|
||||
<td><strong>{{ r.titel }}</strong></td>
|
||||
<td>{{ r.vorname }}</td>
|
||||
<td>
|
||||
{% if r.selbsteinschaetzung == 'zufrieden' %}🟢 zufrieden
|
||||
{% elif r.selbsteinschaetzung == 'mittel' %}🟡 mittel
|
||||
{% elif r.selbsteinschaetzung == 'gelernt' %}🔴 gelernt
|
||||
{% endif %}
|
||||
</td>
|
||||
<td style="font-size: 0.85rem; color: var(--text-light);">{{ r.abgeschlossen_am[:10] if r.abgeschlossen_am else '' }}</td>
|
||||
<td>
|
||||
<a href="#" class="btn btn-primary" style="padding: 0.2rem 0.6rem; font-size: 0.85rem; opacity: 0.5;" title="Etappe 6">Reviewen</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% else %}
|
||||
<p style="color: var(--text-light);">Keine offenen Reviews. <em>(Selbstlern-Loop kommt mit Etappe 6.)</em></p>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{# ====== Sektion 3: Drucker-Status ====== #}
|
||||
<div class="card">
|
||||
<h2>🖨️ Drucker-Status</h2>
|
||||
<div class="grid" style="grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.8rem;">
|
||||
{% for d in drucker %}
|
||||
<div class="drucker-kachel drucker-{{ d.status or 'idle' }}">
|
||||
<h3 style="margin-bottom: 0.2rem;">{{ d.name }}</h3>
|
||||
<p style="font-size: 0.85rem; color: var(--text-light); margin: 0;">
|
||||
{{ d.modell }}{% if not d.geschlossenes_gehaeuse %} · <span style="color: var(--danger);">offen</span>{% endif %}
|
||||
</p>
|
||||
<p style="margin-top: 0.5rem; font-weight: 600;">
|
||||
{% if d.status == 'printing' %}🟢 drucken
|
||||
{% elif d.status == 'idle' %}⚪ idle
|
||||
{% elif d.status == 'paused' %}🟡 pausiert
|
||||
{% elif d.status == 'finished' %}✅ fertig
|
||||
{% elif d.status == 'failed' %}🔴 Fehler
|
||||
{% elif d.status == 'offline' %}⚫ offline
|
||||
{% else %}⚪ kein Status (API noch nicht in Etappe 5){% endif %}
|
||||
</p>
|
||||
{% if d.job_name %}<p style="font-size: 0.85rem;">{{ d.job_name }}</p>{% endif %}
|
||||
{% if d.progress_pct %}<p style="font-size: 0.85rem;">{{ d.progress_pct|round|int }} %{% if d.restzeit_min %} · noch {{ d.restzeit_min }} min{% endif %}</p>{% endif %}
|
||||
{% if d.fehlermeldung %}<p style="font-size: 0.85rem; color: var(--danger);">{{ d.fehlermeldung }}</p>{% endif %}
|
||||
{% if d.notiz %}<p style="font-size: 0.8rem; color: var(--text-light); margin-top: 0.5rem;">ℹ️ {{ d.notiz }}</p>{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{# ====== Sektion 4: Wer haengt fest ====== #}
|
||||
<div class="card">
|
||||
<h2>💤 Wer hängt fest (>2 Wochen kein Check-In)</h2>
|
||||
{% if haengen_fest %}
|
||||
<table>
|
||||
<thead><tr><th></th><th>Vorname</th><th>letzter Check-In</th><th></th></tr></thead>
|
||||
<tbody>
|
||||
{% for h in haengen_fest %}
|
||||
<tr>
|
||||
<td style="font-size: 1.4rem;">{{ tier_emoji(h.tier) }}</td>
|
||||
<td><strong>{{ h.vorname }}</strong></td>
|
||||
<td style="font-size: 0.85rem; color: var(--text-light);">
|
||||
{% if h.letzter_check_in %}{{ h.letzter_check_in }}{% else %}<em>noch nie</em>{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<details>
|
||||
<summary class="btn btn-secondary" style="padding: 0.2rem 0.5rem; font-size: 0.8rem; list-style: none;">Erinnerung</summary>
|
||||
<form method="post" action="{{ url_for('admin.profil_notiz', profil_id=h.id) }}" style="margin-top: 0.4rem; display: flex; gap: 0.3rem;">
|
||||
<input type="hidden" name="typ" value="erinnerung">
|
||||
<input type="text" name="text" placeholder="Hey, lange nicht gesehen — alles okay?" required
|
||||
style="padding: 0.3rem; border: 1px solid var(--border); border-radius: 4px; width: 240px;">
|
||||
<button class="btn btn-primary" style="padding: 0.3rem 0.6rem; font-size: 0.85rem;">senden</button>
|
||||
</form>
|
||||
</details>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% else %}
|
||||
<p style="color: var(--text-light);">Alle dabei. 👍</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{# ====== Sektion: Offene Rueckfragen ====== #}
|
||||
{% if rueckfragen %}
|
||||
<div class="card" style="border-left: 4px solid var(--warning);">
|
||||
<h2>❓ Offene Rückfragen ({{ rueckfragen|length }})</h2>
|
||||
<p style="font-size: 0.85rem; color: var(--text-light);">SuS hat noch nicht nachgebessert.</p>
|
||||
<ul style="margin-top: 0.5rem; padding-left: 1.2rem;">
|
||||
{% for r in rueckfragen %}
|
||||
<li style="margin: 0.3rem 0;">
|
||||
{{ tier_emoji(r.tier) }} <strong>{{ r.vorname }}</strong> ·
|
||||
„{{ r.projekt_titel }}" ·
|
||||
seit {{ r.erstellt_am[:10] }} ·
|
||||
<em>„{{ r.text[:80] }}{% if r.text|length > 80 %}…{% endif %}"</em>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
268
templates/cockpit.html
Normal file
268
templates/cockpit.html
Normal file
@@ -0,0 +1,268 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}Cockpit — {{ vorname }}{% endblock %}
|
||||
{% block content %}
|
||||
|
||||
{# ====== Header ====== #}
|
||||
<div class="section-header">
|
||||
<h1 style="display:flex; align-items:center; gap:0.5rem;">
|
||||
<span style="font-size: 2.2rem;">{{ tier_emoji(tier) }}</span>
|
||||
Hallo, {{ vorname }}!
|
||||
</h1>
|
||||
<a href="{{ url_for('profil.logout') }}" class="btn btn-secondary">Abmelden</a>
|
||||
</div>
|
||||
|
||||
{# ====== BANNER: Lehrer-Notizen (V5-Quick-Action) ====== #}
|
||||
{% for n in status.notizen %}
|
||||
<div class="card" style="background: #FEF9E7; border-left: 5px solid var(--warning); margin-bottom: 0.5rem;">
|
||||
<p style="margin: 0; color: #B7950B;">
|
||||
<strong>📌 Lehrer-Notiz:</strong> {{ n.text }}
|
||||
</p>
|
||||
<form method="post" action="{{ url_for('profil.notiz_gelesen', notiz_id=n.id) }}" style="margin-top: 0.5rem;">
|
||||
<button class="btn btn-secondary" style="padding: 0.2rem 0.6rem; font-size: 0.85rem;">verstanden</button>
|
||||
</form>
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
{# ====== BANNER: Offene Rueckfragen zu eigenen Projekten (V6) ====== #}
|
||||
{% for r in status.rueckfragen %}
|
||||
<div class="card" style="background: #FEF9E7; border-left: 5px solid var(--warning); margin-bottom: 0.5rem;">
|
||||
<p style="margin: 0; color: #B7950B;">
|
||||
<strong>❓ Rueckfrage zu „{{ r.projekt_titel }}":</strong> {{ r.text }}
|
||||
</p>
|
||||
<p style="margin-top: 0.5rem; font-size: 0.85rem; color: var(--text-light);">
|
||||
Bessere das Projekt nach, dann melde es erneut zur Freigabe.
|
||||
</p>
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
{# ====== BANNER: Eingegangene Paarungs-Anfragen ====== #}
|
||||
{% for a in status.offene_anfragen %}
|
||||
<div class="card" style="background: #EBF5FB; border-left: 5px solid var(--primary); margin-bottom: 0.5rem;">
|
||||
<p style="margin: 0;">
|
||||
<strong>{{ tier_emoji(a.von_tier) }} {{ a.von_vorname }}</strong> moechte mit dir
|
||||
zusammenarbeiten. Magst du?
|
||||
</p>
|
||||
<div style="margin-top: 0.5rem; display: flex; gap: 0.5rem;">
|
||||
<form method="post" action="{{ url_for('profil.paarung_anfrage_beantworten', anfrage_id=a.id, aktion='annehmen') }}">
|
||||
<button class="btn btn-primary" style="padding: 0.3rem 0.8rem;">Ja, gerne</button>
|
||||
</form>
|
||||
<form method="post" action="{{ url_for('profil.paarung_anfrage_beantworten', anfrage_id=a.id, aktion='ablehnen') }}">
|
||||
<button class="btn btn-secondary" style="padding: 0.3rem 0.8rem;">Nein, lieber nicht</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
{# ====== Check-In-Modal — wenn heute noch nichts gewaehlt wurde ====== #}
|
||||
{% if not status.check_in_heute %}
|
||||
<div class="card" style="border-top: 4px solid var(--primary);">
|
||||
<h2>Was machst du heute? 🎯</h2>
|
||||
<p style="color: var(--text-light); font-size: 0.9rem;">
|
||||
Damit Herb und Markus auf einen Blick sehen, woran du arbeitest.
|
||||
Ein Klick reicht — Freitext nur, wenn du willst.
|
||||
</p>
|
||||
<form method="post" action="{{ url_for('profil.check_in') }}" style="margin-top: 1rem;">
|
||||
<div class="check-in-optionen">
|
||||
{% set hat_projekte = status.aktive_projekte | length > 0 %}
|
||||
{% if hat_projekte %}
|
||||
<label class="ci-option">
|
||||
<input type="radio" name="modus" value="weiter_wie_bisher" checked>
|
||||
<span>Ich arbeite an „{{ status.aktive_projekte[0].titel }}" weiter</span>
|
||||
</label>
|
||||
{% endif %}
|
||||
<label class="ci-option">
|
||||
<input type="radio" name="modus" value="neues_projekt" {% if not hat_projekte %}checked{% endif %}>
|
||||
<span>Neues Projekt anfangen</span>
|
||||
</label>
|
||||
{% if status.ist_neu %}
|
||||
<label class="ci-option">
|
||||
<input type="radio" name="modus" value="onboarding">
|
||||
<span>Onboarding-Lektion machen</span>
|
||||
</label>
|
||||
{% endif %}
|
||||
<label class="ci-option">
|
||||
<input type="radio" name="modus" value="drucken">
|
||||
<span>Drucken / auf Drucker warten</span>
|
||||
</label>
|
||||
<label class="ci-option">
|
||||
<input type="radio" name="modus" value="helfen">
|
||||
<span>Jemandem helfen</span>
|
||||
</label>
|
||||
<label class="ci-option">
|
||||
<input type="radio" name="modus" value="sonstiges">
|
||||
<span>Sonstiges</span>
|
||||
</label>
|
||||
</div>
|
||||
<input type="text" name="freitext" placeholder="(optional) was genau …"
|
||||
style="width: 100%; padding: 0.5rem; margin-top: 0.6rem; border: 1px solid var(--border); border-radius: 4px;">
|
||||
<button class="btn btn-primary" style="margin-top: 0.6rem;">Los geht's</button>
|
||||
</form>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="card" style="background: #EAFBF1; border-left: 4px solid var(--success);">
|
||||
<p style="margin: 0; font-size: 0.9rem;">
|
||||
<strong>Heute eingecheckt:</strong>
|
||||
{% if status.check_in_heute.modus == 'weiter_wie_bisher' %}Arbeite weiter
|
||||
{% elif status.check_in_heute.modus == 'neues_projekt' %}Neues Projekt
|
||||
{% elif status.check_in_heute.modus == 'onboarding' %}Onboarding
|
||||
{% elif status.check_in_heute.modus == 'drucken' %}Drucken
|
||||
{% elif status.check_in_heute.modus == 'helfen' %}Hilft anderen
|
||||
{% else %}{{ status.check_in_heute.modus }}{% endif %}
|
||||
{% if status.check_in_heute.freitext %} — „{{ status.check_in_heute.freitext }}"{% endif %}
|
||||
</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="grid" style="grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem;">
|
||||
|
||||
{# ====== ONBOARDING-KARTE (V1: nur wenn nicht fertig) ====== #}
|
||||
{% if status.ist_neu %}
|
||||
<div class="card" style="grid-column: span 2; border-top: 4px solid var(--success);">
|
||||
<h2>Dein Onboarding-Pfad 🚀</h2>
|
||||
<p style="color: var(--text-light); margin-bottom: 1rem;">
|
||||
Drei Lektionen, damit du allein klarkommst. Du klickst selbst „fertig", wenn du soweit bist.
|
||||
</p>
|
||||
<div class="onboarding-liste">
|
||||
{% for l in status.onboarding.lektionen %}
|
||||
<div class="onb-zeile onb-{{ l.status }}{% if l.aktuell %} onb-aktuell{% endif %}">
|
||||
<span class="onb-icon">
|
||||
{% if l.status == 'fertig' %}✅
|
||||
{% elif l.status == 'laeuft' %}🟡
|
||||
{% else %}⚪{% endif %}
|
||||
</span>
|
||||
<span class="onb-titel">
|
||||
<strong>L{{ l.nummer }}</strong> — {{ l.titel }}
|
||||
</span>
|
||||
<span class="onb-aktion">
|
||||
{% if l.status != 'fertig' %}
|
||||
<a href="{{ url_for('oeffentlich.lektion_detail', nummer=l.nummer) }}"
|
||||
class="btn btn-secondary" style="padding: 0.2rem 0.6rem; font-size: 0.8rem;">
|
||||
ansehen
|
||||
</a>
|
||||
<form method="post" action="{{ url_for('profil.lektion_status_setzen', nummer=l.nummer) }}" style="display:inline;">
|
||||
{% if l.status == 'offen' %}
|
||||
<button name="status" value="laeuft" class="btn btn-secondary" style="padding: 0.2rem 0.6rem; font-size: 0.8rem;">starte</button>
|
||||
{% else %}
|
||||
<button name="status" value="fertig" class="btn btn-primary" style="padding: 0.2rem 0.6rem; font-size: 0.8rem;">fertig ✓</button>
|
||||
{% endif %}
|
||||
</form>
|
||||
{% else %}
|
||||
<form method="post" action="{{ url_for('profil.lektion_status_setzen', nummer=l.nummer) }}" style="display:inline;">
|
||||
<button name="status" value="laeuft" class="btn btn-secondary" style="padding: 0.2rem 0.6rem; font-size: 0.75rem; opacity: 0.6;">nochmal</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
</span>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% if not status.darf_slots_buchen %}
|
||||
<p style="margin-top: 1rem; font-size: 0.85rem; color: var(--text-light);">
|
||||
ℹ️ Drucker reservieren kannst du, sobald <strong>L1 (Sicherheit)</strong> erledigt ist.
|
||||
</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{# ====== PROJEKT-KARTE (V1: nur wenn Projekte oder Onboarding fertig) ====== #}
|
||||
{% if status.hat_projekte or not status.ist_neu %}
|
||||
<div class="card">
|
||||
<h2>{% if status.paarung %}Euer Projekt{% else %}Dein Projekt{% endif %}</h2>
|
||||
{% if status.aktive_projekte %}
|
||||
{% for p in status.aktive_projekte %}
|
||||
<div style="margin-bottom: 0.8rem;">
|
||||
<strong>{{ p.titel }}</strong>
|
||||
{% if p.beschreibung_md %}
|
||||
<div style="margin-top: 0.3rem; font-size: 0.9rem;">{{ p.beschreibung_md|markdown }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<p style="color: var(--text-light);">
|
||||
Du hast noch kein laufendes Projekt.
|
||||
</p>
|
||||
<p style="margin-top: 0.5rem; font-size: 0.85rem; color: var(--text-light);">
|
||||
<em>Projekt-Anlage kommt mit Etappe 6.</em>
|
||||
</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{# ====== PAARUNG / TEAM-KARTE — immer wenn Paarung aktiv, sonst nur fuer Erfahrene ====== #}
|
||||
{% if status.paarung or not status.ist_neu %}
|
||||
<div class="card">
|
||||
<h2>{% if status.paarung %}Dein Team{% else %}Allein arbeiten?{% endif %}</h2>
|
||||
{% if status.paarung %}
|
||||
<p style="font-size: 1.1rem;">
|
||||
Du arbeitest mit
|
||||
<strong>{{ tier_emoji(status.paarung.partner.tier) }} {{ status.paarung.partner.vorname }}</strong>
|
||||
zusammen seit {{ status.paarung.gebildet_am[:10] }}.
|
||||
</p>
|
||||
<form method="post" action="{{ url_for('profil.paarung_aufloesen') }}"
|
||||
onsubmit="return confirm('Paarung wirklich aufloesen?')"
|
||||
style="margin-top: 0.8rem;">
|
||||
<button class="btn btn-secondary" style="font-size: 0.85rem;">Paarung aufloesen</button>
|
||||
</form>
|
||||
{% else %}
|
||||
<p style="color: var(--text-light); margin-bottom: 0.5rem;">
|
||||
Du kannst dich mit jemandem zusammenschliessen — frag im Cockpit-Untermenue.
|
||||
</p>
|
||||
{% if andere_profile %}
|
||||
<details>
|
||||
<summary style="cursor:pointer; color: var(--primary);">Anfrage stellen</summary>
|
||||
<div id="paarung-suche" style="margin-top: 0.5rem;">
|
||||
{% for andere in andere_profile %}
|
||||
<form method="post" action="{{ url_for('profil.paarung_anfragen', andere_profil_id=andere.id) }}"
|
||||
style="display: inline-block; margin: 0.2rem;">
|
||||
<button class="btn btn-secondary" style="padding: 0.3rem 0.6rem; font-size: 0.85rem;">
|
||||
{{ tier_emoji(andere.tier) }} {{ andere.vorname }}
|
||||
</button>
|
||||
</form>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</details>
|
||||
{% else %}
|
||||
<p style="font-size: 0.85rem; color: var(--text-light); margin-top: 0.5rem;">
|
||||
<em>Noch niemand sonst in der AG.</em>
|
||||
</p>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{# ====== DRUCKER-/SLOT-KARTE (V1: nur wenn L1 fertig) ====== #}
|
||||
{% if status.darf_slots_buchen %}
|
||||
<div class="card" style="grid-column: span 2; opacity: 0.7;">
|
||||
<h2>🖨️ Drucker reservieren</h2>
|
||||
<p style="color: var(--text-light);">
|
||||
Slot-System kommt mit <em>Etappe 7</em>. Bis dahin: sprich dich vor Ort ab.
|
||||
</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block scripts %}
|
||||
<style>
|
||||
.check-in-optionen { display: flex; flex-direction: column; gap: 0.4rem; }
|
||||
.ci-option {
|
||||
display: flex; gap: 0.6rem; align-items: center;
|
||||
padding: 0.5rem 0.7rem; border-radius: 6px; cursor: pointer;
|
||||
transition: background 0.15s;
|
||||
}
|
||||
.ci-option:hover { background: #F2F3F4; }
|
||||
.ci-option input[type=radio] { margin: 0; }
|
||||
|
||||
.onboarding-liste { display: flex; flex-direction: column; gap: 0.5rem; }
|
||||
.onb-zeile {
|
||||
display: flex; gap: 0.7rem; align-items: center;
|
||||
padding: 0.5rem 0.7rem; border-radius: 6px;
|
||||
background: #F2F3F4;
|
||||
}
|
||||
.onb-zeile.onb-fertig { background: #EAFBF1; opacity: 0.8; }
|
||||
.onb-zeile.onb-aktuell { background: #EBF5FB; border-left: 4px solid var(--primary); }
|
||||
.onb-icon { font-size: 1.2rem; }
|
||||
.onb-titel { flex: 1; }
|
||||
.onb-aktion { display: flex; gap: 0.3rem; }
|
||||
</style>
|
||||
{% endblock %}
|
||||
44
templates/lektion_detail.html
Normal file
44
templates/lektion_detail.html
Normal file
@@ -0,0 +1,44 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}L{{ lektion.nummer }} — {{ lektion.titel }}{% endblock %}
|
||||
{% block content %}
|
||||
<div class="section-header">
|
||||
<h1><span style="color: var(--text-light);">L{{ lektion.nummer }}</span> {{ lektion.titel }}</h1>
|
||||
<a href="{{ url_for('oeffentlich.lektionen') }}" class="btn btn-secondary">← Alle Lektionen</a>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
{% if lektion.onboarding %}<span class="badge badge-pflicht">Onboarding</span>{% endif %}
|
||||
<span class="badge badge-{{ lektion.schwierigkeit }}">{{ lektion.schwierigkeit }}</span>
|
||||
|
||||
<div class="content" style="margin-top: 1rem;">{{ lektion.aufgabe_md|markdown }}</div>
|
||||
|
||||
{% if lektion.tipp_md %}
|
||||
<details style="margin-top: 1rem;">
|
||||
<summary style="cursor:pointer; color: var(--primary);"><strong>💡 Tipp</strong></summary>
|
||||
<div class="content" style="margin-top: 0.5rem;">{{ lektion.tipp_md|markdown }}</div>
|
||||
</details>
|
||||
{% endif %}
|
||||
|
||||
{% if lektion.extern_link %}
|
||||
<p style="margin-top: 1rem;">
|
||||
<a href="{{ lektion.extern_link }}" target="_blank" rel="noopener noreferrer" class="btn btn-secondary">
|
||||
Externer Link ↗
|
||||
</a>
|
||||
</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{# Wenn eingeloggt: Status-Buttons zum Selbst-Zertifizieren #}
|
||||
{% if session.profil_id %}
|
||||
<div class="card" style="background: #EBF5FB; border-left: 4px solid var(--primary);">
|
||||
<p style="margin: 0;"><strong>Status setzen</strong> (du entscheidest selbst, wann du fertig bist):</p>
|
||||
<div style="display: flex; gap: 0.5rem; margin-top: 0.5rem; flex-wrap: wrap;">
|
||||
{% for opt, label in [('offen', '⚪ noch nicht angefangen'), ('laeuft', '🟡 läuft'), ('fertig', '✅ fertig')] %}
|
||||
<form method="post" action="{{ url_for('profil.lektion_status_setzen', nummer=lektion.nummer) }}">
|
||||
<button name="status" value="{{ opt }}" class="btn btn-secondary" style="font-size: 0.85rem;">{{ label }}</button>
|
||||
</form>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
23
templates/lektionen.html
Normal file
23
templates/lektionen.html
Normal file
@@ -0,0 +1,23 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}Lektionen{% endblock %}
|
||||
{% block content %}
|
||||
<h1>Lektionen</h1>
|
||||
<p style="color: var(--text-light);">
|
||||
<strong>Onboarding</strong> (L1-L3) sind für Neue gedacht. Wer schon dabei
|
||||
ist, kann sie überspringen oder als Auffrischung nochmal durchgehen.
|
||||
</p>
|
||||
|
||||
<div class="grid" style="grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; margin-top: 1.5rem;">
|
||||
{% for l in lektionen %}
|
||||
<a href="{{ url_for('oeffentlich.lektion_detail', nummer=l.nummer) }}" class="card" style="text-decoration: none; color: inherit;">
|
||||
<h3 style="margin-bottom: 0.3rem;">
|
||||
<span style="color: var(--text-light);">L{{ l.nummer }}</span> {{ l.titel }}
|
||||
</h3>
|
||||
<p>
|
||||
{% if l.onboarding %}<span class="badge badge-pflicht">Onboarding</span>{% else %}<span class="badge badge-frei">Frei</span>{% endif %}
|
||||
<span class="badge badge-{{ l.schwierigkeit }}">{{ l.schwierigkeit }}</span>
|
||||
</p>
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user