Reequilibrer rapport de rencontre

This commit is contained in:
Daniel Allaire 2026-06-02 00:44:36 -04:00
parent 968079c671
commit 4538d04972
2 changed files with 25 additions and 23 deletions

View file

@ -141,13 +141,15 @@ async def _html_rapport_rencontre(reunion: Reunion, membre, db: AsyncSession) ->
css = """
@page { size: letter; margin: 0.55in 0.65in; }
body { font-family: Arial, 'DejaVu Sans', sans-serif; color: #111; font-size: 10pt; }
.header { text-align: center; margin: 12pt 0 40pt; }
.groupe { font-size: 21pt; font-weight: 400; margin-bottom: 16pt; }
.district { font-size: 16pt; margin-bottom: 18pt; }
.header { text-align: center; margin: 8pt 0 28pt; }
.groupe { font-size: 20pt; font-weight: 400; margin-bottom: 8pt; }
.district { font-size: 14pt; margin-bottom: 6pt; }
.adresse { font-size: 9.5pt; margin-bottom: 16pt; color: #333; }
h1 { font-size: 14pt; font-weight: 500; letter-spacing: 0; margin: 0; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18pt 18pt; }
.grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14pt 16pt; }
.field { break-inside: avoid; }
.field.full { grid-column: 1 / -1; }
.field.span2 { grid-column: span 2; }
.box {
border: 1pt solid #222;
min-height: 27pt;
@ -157,33 +159,34 @@ async def _html_rapport_rencontre(reunion: Reunion, membre, db: AsyncSession) ->
overflow: hidden;
}
.label { font-style: italic; font-size: 8.5pt; margin: 4pt 0 0 1pt; }
.short .box { min-height: 24pt; }
.theme .box { min-height: 58pt; }
.medium .box { min-height: 58pt; }
.deep .box { min-height: 95pt; }
.notes .box { min-height: 150pt; }
.short .box { min-height: 23pt; }
.theme .box { min-height: 54pt; }
.medium .box { min-height: 70pt; }
.tall .box { min-height: 86pt; }
.notes .box { min-height: 132pt; }
.footer { margin-top: 10pt; color: #777; font-size: 7.5pt; text-align: center; }
"""
groupe_nom = groupe.nom if groupe and groupe.nom else "Groupe"
district = f"District {groupe.district}" if groupe and groupe.district else "District"
adresse = groupe.adresse_local if groupe and groupe.adresse_local else ""
nouveaux_jetons = "\n\n".join([texte for texte in ["Nouveau(x):", jetons_texte] if texte])
html = f"""<!doctype html><html><head><meta charset="utf-8"><style>{css}</style></head><body>
<div class="header">
<div class="groupe">{escape(groupe_nom)}</div>
<div class="district">{escape(district)}</div>
<div class="adresse">{escape(adresse)}</div>
<h1>RÉUNION HEBDOMADAIRE</h1>
</div>
<div class="grid">
{bloc("DATE ( AAAA / MM / JJ)", reunion.date_reunion.date().isoformat(), "short")}
{bloc("PRÉSENCES", "", "short")}
{bloc("SALLE & CAFÉ", groupe.adresse_local if groupe else "", "short")}
{bloc("ANIMATION", animateur.prenom if animateur else "", "short")}
{bloc("THÈME DE LA DISCUSSION", reunion.theme or "", "full theme")}
{bloc("NOUVEAU(X)", "", "medium")}
{bloc("ANNIVERSAIRES / JETONS", jetons_texte, "medium")}
{bloc("NOUVEAU(X) / ANNIVERSAIRES / JETONS", nouveaux_jetons, "span2 medium")}
{bloc("COLLECTE", collecte_texte, "short")}
{bloc("DÉPENSES", "", "deep")}
{bloc("VENTES (Littérature)", ventes_lit_texte, "short")}
{bloc("VENTES (Littérature)", ventes_lit_texte, "span2 short")}
{bloc("VENTES (Jetons)", ventes_jetons_texte, "short")}
{bloc("DÉPENSES", "", "full tall")}
{bloc("NOTES", notes_texte, "full notes")}
</div>
<div class="footer">Rapport généré automatiquement · {datetime.now().strftime('%Y-%m-%d %H:%M')}</div>

View file

@ -34,6 +34,7 @@ function htmlFormulaire(type, groupe) {
<div class="head">
<h1>${nomGroupe}</h1>
<p>${district}</p>
${lieu ? `<div class="adresse">${lieu}</div>` : ''}
<h2>${titre}</h2>
</div>`;
const sections = {
@ -42,15 +43,13 @@ function htmlFormulaire(type, groupe) {
<div class="form-grid">
${bloc('DATE ( AAAA / MM / JJ)', '', 'short')}
${bloc('PRÉSENCES', '', 'short')}
${bloc('SALLE & CAFÉ', lieu, 'short')}
${bloc('ANIMATION', '', 'short')}
${bloc('THÈME DE LA DISCUSSION', '', 'full theme')}
${bloc('NOUVEAU(X)', '', 'medium')}
${bloc('ANNIVERSAIRES / JETONS', '', 'medium')}
${bloc('NOUVEAU(X) / ANNIVERSAIRES / JETONS', '', 'span2 medium')}
${bloc('COLLECTE', '', 'short')}
${bloc('DÉPENSES', '', 'deep')}
${bloc('VENTES (Littérature)', '', 'short')}
${bloc('VENTES (Littérature)', '', 'span2 short')}
${bloc('VENTES (Jetons)', '', 'short')}
${bloc('DÉPENSES', '', 'full tall')}
${bloc('NOTES', '', 'full notes')}
</div>`,
assemblee: `
@ -70,10 +69,10 @@ function htmlFormulaire(type, groupe) {
return `<!doctype html><html lang="fr"><head><meta charset="utf-8"><title>${nomGroupe} - ${type}</title>
<style>
@page{size:letter;margin:0.55in 0.65in} body{font-family:Arial,sans-serif;color:#111;line-height:1.35}
.head{text-align:center;margin:12pt 0 40pt}.head h1{margin:0 0 16pt;font-size:21pt;font-weight:400}.head p{margin:0 0 18pt;font-size:16pt}.head h2{font-size:14pt;font-weight:500;margin:0}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:18pt}
.field{break-inside:avoid}.field.full{grid-column:1 / -1}.box{min-height:27pt;border:1pt solid #222;padding:6pt 8pt;white-space:pre-wrap}.label{font-style:italic;font-size:8.5pt;margin:4pt 0 0 1pt}
.short .box{min-height:24pt}.theme .box{min-height:58pt}.medium .box{min-height:58pt}.deep .box{min-height:95pt}.notes .box{min-height:150pt}
.head{text-align:center;margin:8pt 0 28pt}.head h1{margin:0 0 8pt;font-size:20pt;font-weight:400}.head p{margin:0 0 6pt;font-size:14pt}.head .adresse{font-size:9.5pt;margin-bottom:16pt;color:#333}.head h2{font-size:14pt;font-weight:500;margin:0}
.form-grid{display:grid;grid-template-columns:1fr 1fr 1fr;gap:14pt 16pt}
.field{break-inside:avoid}.field.full{grid-column:1 / -1}.field.span2{grid-column:span 2}.box{min-height:27pt;border:1pt solid #222;padding:6pt 8pt;white-space:pre-wrap}.label{font-style:italic;font-size:8.5pt;margin:4pt 0 0 1pt}
.short .box{min-height:23pt}.theme .box{min-height:54pt}.medium .box{min-height:70pt}.tall .box{min-height:86pt}.notes .box{min-height:132pt}
label{display:block;font-weight:bold;margin-top:14px}.big{height:120px;border:1px solid #999;margin-top:6px}
.line{height:28px;border-bottom:1px solid #bbb;padding-top:6px}
</style></head><body>${sections[type]}<script>window.print()</script></body></html>`;