Stopp nach der Gliederung als Häkchen neben „Buch erzeugen“

Das Häkchen steht im Lauf neben dem Startknopf und bei „Neue Version“
neben „Buch erzeugen“, nicht mehr im Anlegen-Formular. Es wird mit dem
Start gespeichert und ist sichtbar, solange die Gliederung aussteht.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
team3
2026-10-12 16:02:57 +02:00
parent 4cd4b7ed2e
commit e06be9d50a
7 changed files with 26 additions and 21 deletions

View File

@@ -30,7 +30,6 @@ class ThemaNeu(BaseModel):
name: str
hinweise: str = ""
spezialisierung: str = ""
stopp_gliederung: bool = False
class VersionNeu(BaseModel):
@@ -38,6 +37,10 @@ class VersionNeu(BaseModel):
stopp_gliederung: bool = False
class Start(BaseModel):
stopp_gliederung: bool | None = None # None: wie gespeichert
class Position(BaseModel):
abschnitt: str | None = None
lesemodus: str | int | None = None # neu: key des Bildschirms, alt: Index
@@ -91,7 +94,7 @@ async def thema_anlegen(body: ThemaNeu):
if not state.name_ok(name) or not state.name_ok(state.bezeichnung(name, body.spezialisierung.strip())):
raise HTTPException(400, "Ungültiger Name")
try:
return _thema_info(state.anlegen(name, body.hinweise, body.spezialisierung, body.stopp_gliederung))
return _thema_info(state.anlegen(name, body.hinweise, body.spezialisierung))
except ValueError as e:
raise HTTPException(409, str(e))
@@ -137,10 +140,13 @@ async def version_loeschen(slug: str, n: int):
@app.post("/api/themen/{slug}/v{n}/start")
async def start(slug: str, n: int):
async def start(slug: str, n: int, body: Start | None = None):
key = _key(slug, n)
if state.zustand(key)["status"] == "fertig":
st = state.zustand(key)
if st["status"] == "fertig":
raise HTTPException(400, "Lauf ist fertig – erst zurücksetzen")
if body and body.stopp_gliederung is not None:
st["stopp_gliederung"] = body.stopp_gliederung
pipeline.starten(key)
return {"ok": True}