fix(membership): nuclear print CSS + hide browser headers via empty title
Some checks are pending
NordaBiz Tests / Unit & Integration Tests (push) Waiting to run
NordaBiz Tests / E2E Tests (Playwright) (push) Blocked by required conditions
NordaBiz Tests / Smoke Tests (Production) (push) Blocked by required conditions
NordaBiz Tests / Send Failure Notification (push) Blocked by required conditions

This commit is contained in:
Maciej Pienczyn 2026-03-30 12:07:59 +02:00
parent 5fd5342a88
commit 9079610ea4

View File

@ -540,73 +540,66 @@
/* Print styles */
@media print {
/* Hide EVERYTHING except main content and print header */
nav, header, .admin-bar, .sidebar, .action-buttons, .action-help,
/* NUCLEAR: hide everything that isn't .print-header or .main-content */
body > *:not(.print-header):not(main):not(.container):not(.fluent-container) { display: none !important; }
nav, header, footer, .admin-bar, .sidebar, .action-buttons, .action-help,
.modal, .modal-overlay, .alert, .btn-action, .btn-back, .back-link,
footer, .notifications-menu, .user-menu, .breadcrumb,
.workflow-timeline, .detail-header .status-badge,
.staging-banner, .announcement-banner, .pwa-install-prompt,
.registry-lookup, .registry-info, .registry-panel, .registry-actions,
.registry-result, .registry-info-box, .lookup-status,
.fluent-command-bar, .fluent-header, .banner,
[class*="staging"], [class*="pwa"], [class*="install"],
.info-section .registry-lookup-widget,
.info-section .registry-help,
.registry-section { display: none !important; }
.notifications-menu, .user-menu, .breadcrumb,
.workflow-timeline, .detail-header,
.dev-notice, .staging-banner, .announcement-banner, .pwa-install-prompt,
.registry-actions, .registry-result, .registry-info-box, .lookup-status,
.fluent-command-bar, .fluent-header, .banner, .flash-messages,
[class*="staging"], [class*="pwa"], [class*="install"], [class*="dev-notice"],
#devNotice, .status-badge { display: none !important; }
/* Full width, no padding */
/* Full width, zero padding everywhere */
.content-grid { display: block !important; }
.main-content { width: 100% !important; max-width: 100% !important; padding: 0 !important; }
.container, .fluent-container { max-width: 100% !important; padding: 0 !important; margin: 0 !important; }
.main-content, .container, .fluent-container {
width: 100% !important; max-width: 100% !important;
padding: 0 !important; margin: 0 !important;
}
/* Compact base styles */
body { font-size: 10pt; color: #000; background: #fff !important; margin: 0; padding: 0; }
* { box-shadow: none !important; }
/* Compact base — kill ALL whitespace */
body { font-size: 9pt !important; color: #000 !important; background: #fff !important; margin: 0 !important; padding: 0 !important; }
* { box-shadow: none !important; text-shadow: none !important; }
/* Hide redundant detail header (print-header replaces it) */
.detail-header { display: none !important; }
/* Print header — compact */
/* Print header */
.print-header {
display: block !important;
text-align: center;
margin-bottom: 8pt;
padding-bottom: 6pt;
border-bottom: 2px solid #2E4872;
margin: 0 0 6pt 0 !important;
padding: 0 0 4pt 0 !important;
border-bottom: 1.5pt solid #2E4872;
}
.print-header h2 { font-size: 13pt; color: #2E4872; margin: 0; }
.print-header p { font-size: 9pt; color: #444; margin: 2pt 0 0; }
.print-header h2 { font-size: 12pt; color: #2E4872; margin: 0 !important; }
.print-header p { font-size: 8pt; color: #444; margin: 1pt 0 0 0 !important; }
/* Compact data sections */
/* Compact data sections — minimal spacing */
.info-section {
break-inside: avoid;
margin-bottom: 4pt !important;
margin-top: 0 !important;
border: 1px solid #ccc;
padding: 4pt 8pt !important;
margin: 3pt 0 !important;
border: 0.5pt solid #bbb;
padding: 3pt 6pt !important;
border-radius: 0 !important;
}
.info-section h2 {
font-size: 11pt;
font-size: 10pt !important;
color: #2E4872;
border-bottom: 1px solid #2E4872;
padding-bottom: 2pt;
margin-bottom: 4pt !important;
margin-top: 0 !important;
border-bottom: 0.5pt solid #2E4872;
padding: 0 0 1pt 0 !important;
margin: 0 0 3pt 0 !important;
}
.info-row, .info-grid > div, .info-value, .info-label {
padding: 0 !important; margin: 0 !important; font-size: 8.5pt !important; line-height: 1.3 !important;
}
.info-row, .info-grid > div { padding: 1pt 0 !important; margin: 0 !important; font-size: 9pt; }
.info-label { font-weight: bold; }
.info-grid { gap: 2pt !important; }
.info-grid { gap: 1pt !important; row-gap: 2pt !important; }
p, div, span, li { margin: 0 !important; padding: 0 !important; }
ul, ol { margin: 0 !important; padding-left: 12pt !important; }
h1, h2, h3, h4 { margin: 0 !important; }
/* Remove all extra spacing */
.info-section + .info-section { margin-top: 4pt !important; }
p, div { margin-top: 0 !important; margin-bottom: 0 !important; }
/* Page setup — no URL, no date */
@page {
margin: 12mm;
size: A4;
}
/* Page: tight margins, A4 */
@page { margin: 10mm; size: A4; }
}
/* Hidden in screen, visible in print */
@ -857,7 +850,7 @@
<button class="btn-action btn-review" onclick="startReview()">
Rozpocznij rozpatrywanie
</button>
<button class="btn-action" onclick="window.print()" style="background: var(--primary); color: white; margin-top: 8px;">
<button class="btn-action" onclick="printDeclaration()" style="background: var(--primary); color: white; margin-top: 8px;">
🖨 Drukuj deklarację
</button>
</div>
@ -905,7 +898,7 @@
<button class="btn-action btn-reject" onclick="openRejectModal()">
✗ Odrzuć
</button>
<button class="btn-action" onclick="window.print()" style="background: var(--primary); color: white; margin-top: 8px;">
<button class="btn-action" onclick="printDeclaration()" style="background: var(--primary); color: white; margin-top: 8px;">
🖨 Drukuj deklarację
</button>
</div>
@ -1382,6 +1375,18 @@ async function proposeChanges() {
}
}
function printDeclaration() {
// Hide browser headers/footers by temporarily clearing title
var origTitle = document.title;
document.title = ' ';
// Also hide dev-notice via JS in case CSS didn't catch it
var devNotice = document.getElementById('devNotice');
if (devNotice) devNotice.style.display = 'none';
window.print();
// Restore after print dialog closes
setTimeout(function() { document.title = origTitle; }, 1000);
}
function openApproveModal() {
document.getElementById('approveModal').classList.add('active');
}