diff --git a/pdf/template.js b/pdf/template.js index 16fdc4e..76da038 100755 --- a/pdf/template.js +++ b/pdf/template.js @@ -1,281 +1,274 @@ -/** - * Builds the full HTML string for a CPAS violation PDF document. - * Matches the styling of the original HTML violation form. - */ +/** PDF template with MPM logo from /static/mpm-logo.png */ const TIERS = [ - { min: 0, max: 4, label: 'Tier 0-1 — Elite Standing', color: '#28a745' }, - { min: 5, max: 9, label: 'Tier 1 — Realignment', color: '#856404' }, - { min: 10, max: 14, label: 'Tier 2 — Administrative Lockdown', color: '#d9534f' }, - { min: 15, max: 19, label: 'Tier 3 — Verification', color: '#d9534f' }, - { min: 20, max: 24, label: 'Tier 4 — Risk Mitigation', color: '#c0392b' }, - { min: 25, max: 29, label: 'Tier 5 — Final Decision', color: '#c0392b' }, - { min: 30, max: 999,label: 'Tier 6 — Separation', color: '#721c24' }, + { min: 0, max: 4, label: 'Tier 0-1 — Elite Standing', color: '#28a745' }, + { min: 5, max: 9, label: 'Tier 1 — Realignment', color: '#856404' }, + { min: 10, max: 14, label: 'Tier 2 — Administrative Lockdown', color: '#d9534f' }, + { min: 15, max: 19, label: 'Tier 3 — Verification', color: '#d9534f' }, + { min: 20, max: 24, label: 'Tier 4 — Risk Mitigation', color: '#c0392b' }, + { min: 25, max: 29, label: 'Tier 5 — Final Decision', color: '#c0392b' }, + { min: 30, max: 999,label: 'Tier 6 — Separation', color: '#721c24' }, ]; function getTier(points) { - return TIERS.find(t => points >= t.min && points <= t.max) || TIERS[0]; + return TIERS.find(t => points >= t.min && points <= t.max) || TIERS[0]; } function formatDate(d) { - if (!d) return '—'; - const dt = new Date(d + 'T12:00:00'); - return dt.toLocaleDateString('en-US', { - weekday: 'long', year: 'numeric', month: 'long', day: 'numeric', - timeZone: 'America/Chicago' - }); + if (!d) return '—'; + const dt = new Date(d + 'T12:00:00'); + return dt.toLocaleDateString('en-US', { + weekday: 'long', year: 'numeric', month: 'long', day: 'numeric', + timeZone: 'America/Chicago' + }); } function formatDateTime(d, t) { - const date = formatDate(d); - return t ? `${date} at ${t}` : date; + const date = formatDate(d); + return t ? `${date} at ${t}` : date; } function row(label, value) { - return ` -
+ Message Point Media — Comprehensive Professional Accountability System
Message Point Media — Confidential HR Document
+| Points | -Tier | -
|---|---|
| ${t.min === 30 ? '30+' : t.min + '–' + t.max} | -${t.label} | -
| Points | +Tier | +
|---|---|
| ${t.min === 30 ? '30+' : t.min + '–' + t.max} | +${t.label} | +
- By signing below, the employee acknowledges receipt of this violation record. - Acknowledgement does not imply agreement. The employee may submit a written - response within 5 business days. -
-+ By signing below, the employee acknowledges receipt of this violation record. + Acknowledgement does not imply agreement. The employee may submit a written + response within 5 business days. +
+