Added security check report field and variable

This commit is contained in:
2026-06-22 14:13:08 +02:00
parent 7a9f8e770a
commit 372ca5f66b
10 changed files with 74 additions and 4 deletions

View File

@@ -43,6 +43,7 @@ final class SecurityReportTemplateService
public function availableVariables(): array
{
return [
'customer_report' => t('Official customer report text (written by the owner on the report step)'),
'logo_src' => t('Logo image source (data URI) — use in <img src="{{logo_src}}">'),
'title' => t('Report title'),
'customer_name' => t('Customer name'),
@@ -93,6 +94,9 @@ final class SecurityReportTemplateService
$map['{{' . $key . '}}'] = $this->esc($value);
}
// Owner-authored prose: escape, then keep the author's line breaks.
$map['{{customer_report}}'] = nl2br($this->esc((string) ($context['customer_report'] ?? '')));
$map['{{checklist}}'] = $this->buildChecklistHtml(
is_array($context['tech_sections'] ?? null) ? $context['tech_sections'] : []
);
@@ -214,6 +218,9 @@ final class SecurityReportTemplateService
<div class="summary">{{checks_done}} / {{checks_total}} ({{percent}}%)</div>
<div class="bar"><div class="bar-fill" style="width: {{percent}}%;"></div></div>
<h2>Report</h2>
<div class="customer-report">{{customer_report}}</div>
<h2>Technical checklist</h2>
{{checklist}}