Added printing

This commit is contained in:
2025-11-27 00:17:29 +00:00
parent 74009324a5
commit 44b57f91a8

22
app.py
View File

@@ -495,6 +495,20 @@ TPL_BASE = """
</script>
<style>
/* Every box prints on its own page */
@media print {
.print-block {
page-break-before: always !important;
break-before: page !important;
}
/* remove first blank page */
.print-block:first-child {
page-break-before: avoid !important;
break-before: avoid !important;
}
}
/* Base print reset */
@media print {
html, body {
@@ -839,7 +853,7 @@ TPL_INFO_PAGE = """
</header>
<!-- Quick Contacts -->
<div class="rounded-2xl border border-slate-800 bg-slate-900/60">
<div class="rounded-2xl border border-slate-800 bg-slate-900/60 print-block">
<div class="flex items-center justify-between p-4 border-b border-slate-800">
<h2 class="text-lg font-semibold">Quick Contacts</h2>
<input id="q" placeholder="Filter by name…" class="px-3 py-2 rounded-lg bg-slate-950 border border-slate-700 text-sm" oninput="filterContacts(this.value)">
@@ -859,7 +873,7 @@ TPL_INFO_PAGE = """
</div>
<!-- Department Extensions -->
<div class="rounded-2xl border border-slate-800 bg-slate-900/60 overflow-x-auto">
<div class="rounded-2xl border border-slate-800 bg-slate-900/60 overflow-x-auto print-block">
<div class="p-4 border-b border-slate-800">
<h2 class="text-lg font-semibold">Department Extensions</h2>
</div>
@@ -874,7 +888,7 @@ TPL_INFO_PAGE = """
</div>
<!-- Support Items -->
<div class="rounded-2xl border border-slate-800 bg-slate-900/60">
<div class="rounded-2xl border border-slate-800 bg-slate-900/60 print-block">
<div class="p-4 border-b border-slate-800"><h2 class="text-lg font-semibold">Support & Escalation</h2></div>
<div class="p-4 grid gap-3" style="grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));">
{% for s in supports %}
@@ -895,7 +909,7 @@ TPL_INFO_PAGE = """
{% if admin_secrets %}
<div class="rounded-2xl border border-slate-800 bg-slate-900/60">
<div class="p-4 border-b border-slate-800 flex items-center justify-between">
<div class="p-4 border-b border-slate-800 flex items-center justify-between print-block">
<h2 class="text-lg font-semibold">Admin Quick Notes</h2>
<span class="text-xs text-slate-400">Visible to admins only</span>
</div>