feat: Quickstart, Benutzerverwaltung und Orion-Ergebnisbox

This commit is contained in:
Schubert Ferenc 2026-07-12 12:19:54 +02:00
parent 4f669a3426
commit e9e46f2cb4
404 changed files with 1032 additions and 600 deletions

View file

@ -8,6 +8,7 @@ from app.modules.orion.assets import schubamed_logo_uri
from app.modules.orion.components.base import ReportComponent
from app.modules.orion.context import ReportContext
from app.modules.orion.html import definition_list, paragraph, section, table, text, yes_no
from app.modules.orion.result import validation_result_box, validation_result_label
def render_template_text(content: str, context: ReportContext) -> str:
@ -63,7 +64,6 @@ class CoverComponent(ReportComponent):
("Pruefdatum", validation.performed_on),
("Pruefungsort", validation.test_location),
("Pruefer", validation.examiner_name),
("Gesamtergebnis", validation.result),
("Status", validation.status),
(
"Ansprechpartner",
@ -83,6 +83,7 @@ class CoverComponent(ReportComponent):
'<p class="cover-subtitle">Funktions- und Leistungsqualifikation Klein-Sterilisator</p>'
f'<p class="cover-subtitle">{text(context.customer.name)}</p>'
f"{rows}"
f"{validation_result_box(validation.result)}"
'<div class="signature-grid"><div>Unterschrift technische Validierung</div><div>Unterschrift Auftraggeber</div></div>'
"</section>"
)
@ -121,7 +122,8 @@ class SummaryComponent(ReportComponent):
def render(self, context: ReportContext) -> str:
validation = context.validation
block = context.text_blocks.get("summary")
body = f"<p>{paragraph(render_template_text(block.content, context) if block else 'nicht erfasst')}</p>"
body = validation_result_box(validation.result, compact=True)
body += f"<p>{paragraph(render_template_text(block.content, context) if block else 'nicht erfasst')}</p>"
body += definition_list(
[
("Kunde", context.customer.name),
@ -135,7 +137,7 @@ class SummaryComponent(ReportComponent):
),
),
("Pruefmittel", len(context.equipment)),
("Ergebnis", validation.result),
("Ergebnis", validation_result_label(validation.result)),
("Mitwirkende Personen", validation.participants),
(
"Hinweis auf naechste Leistungsbeurteilung",
@ -166,6 +168,10 @@ class StaticTextComponent(ReportComponent):
return f"{self.number} {self.title}" if self.number else self.title
def render(self, context: ReportContext) -> str:
if self.anchor == "results":
body = validation_result_box(context.validation.result, compact=True)
body += f"<p>{paragraph(self.body)}</p>"
return section(self.anchor, self.title, body, self.bookmark_label)
if self.block_key and self.block_key in context.text_blocks:
content = render_template_text(context.text_blocks[self.block_key].content, context)
return section(self.anchor, self.title, f"<p>{paragraph(content)}</p>", self.bookmark_label)