fix(orion): replace cover result box with compact status text

This commit is contained in:
Schubert Ferenc 2026-07-12 13:15:02 +02:00
parent 068d00513d
commit 85cd1c30ab
7 changed files with 75 additions and 7 deletions

View file

@ -8,7 +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
from app.modules.orion.result import validation_result_box, validation_result_cover_sentence, validation_result_label
def render_template_text(content: str, context: ReportContext) -> str:
@ -84,7 +84,10 @@ class CoverComponent(ReportComponent):
f'<p class="cover-subtitle">{text(context.customer.name)}</p>'
f"{rows}"
'<div class="cover-closing">'
f"{validation_result_box(validation.result)}"
'<div class="cover-result-text">'
"<h2>Ergebnis der Validierung</h2>"
f"<p>{text(validation_result_cover_sentence(validation.result))}</p>"
"</div>"
'<div class="signature-block"><div class="signature-line"></div><div class="signature-label">Unterschrift technische Validierung</div></div>'
"</div>"
"</section>"

View file

@ -55,6 +55,17 @@ def validation_result_label(value: str | None) -> str:
return validation_result_presentation(value).label
def validation_result_cover_sentence(value: str | None) -> str:
presentation = validation_result_presentation(value)
sentences = {
"BESTANDEN": "Die technische Validierung wurde erfolgreich bestanden.",
"BESTANDEN_MIT_AUFLAGEN": "Die technische Validierung wurde mit Auflagen bestanden.",
"NICHT_BESTANDEN": "Die technische Validierung wurde nicht bestanden.",
"OFFEN": "Die technische Validierung wurde noch nicht bewertet.",
}
return sentences[presentation.key]
def validation_result_box(value: str | None, *, compact: bool = False) -> str:
presentation = validation_result_presentation(value)
size_class = "result-box--compact" if compact else "result-box--cover"

View file

@ -204,6 +204,31 @@ h1 {
page-break-inside: avoid;
}
.cover-result-text {
border-top: .25mm solid #DCE3E3;
break-inside: avoid;
margin: 2mm 0 0 0;
page-break-inside: avoid;
padding-top: 2.2mm;
}
.cover-result-text h2 {
border: 0;
color: #4F6A74;
font-size: 10pt;
letter-spacing: .04em;
margin: 0 0 1mm 0;
padding: 0;
text-transform: uppercase;
}
.cover-result-text p {
color: #2E3B40;
font-size: 10.5pt;
font-weight: 700;
margin: 0;
}
.result-box {
border: .65mm solid #8A9498;
border-radius: 1.5mm;