""" PDF Templates - Inline HTML-Templates und CSS fuer PDF-Generierung. Fallback-Templates die verwendet werden wenn keine externen HTML-Dateien im templates/pdf/ Verzeichnis vorhanden sind. """ def get_base_css() -> str: """Basis-CSS fuer alle PDFs (A4, Typografie, Komponenten-Styles).""" return """ @page { size: A4; margin: 2cm 2.5cm; @top-right { content: counter(page) " / " counter(pages); font-size: 9pt; color: #666; } } body { font-family: 'DejaVu Sans', 'Liberation Sans', Arial, sans-serif; font-size: 11pt; line-height: 1.5; color: #333; } h1, h2, h3 { font-weight: bold; margin-top: 1em; margin-bottom: 0.5em; } h1 { font-size: 16pt; } h2 { font-size: 14pt; } h3 { font-size: 12pt; } .header { border-bottom: 2px solid #2c3e50; padding-bottom: 15px; margin-bottom: 20px; } .school-name { font-size: 18pt; font-weight: bold; color: #2c3e50; } .school-info { font-size: 9pt; color: #666; } .letter-date { text-align: right; margin-bottom: 20px; } .recipient { margin-bottom: 30px; } .subject { font-weight: bold; margin-bottom: 20px; } .content { text-align: justify; margin-bottom: 30px; } .signature { margin-top: 40px; } .legal-references { font-size: 9pt; color: #666; border-top: 1px solid #ddd; margin-top: 30px; padding-top: 10px; } .gfk-badge { display: inline-block; background: #e8f5e9; color: #27ae60; font-size: 8pt; padding: 2px 8px; border-radius: 10px; margin-right: 5px; } /* Zeugnis-Styles */ .certificate-header { text-align: center; margin-bottom: 30px; } .certificate-title { font-size: 20pt; font-weight: bold; margin-bottom: 10px; } .student-info { margin-bottom: 20px; padding: 15px; background: #f9f9f9; border-radius: 5px; } .grades-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; } .grades-table th, .grades-table td { border: 1px solid #ddd; padding: 8px 12px; text-align: left; } .grades-table th { background: #2c3e50; color: white; } .grades-table tr:nth-child(even) { background: #f9f9f9; } .grade-cell { text-align: center; font-weight: bold; font-size: 12pt; } .attendance-box { background: #fff3cd; padding: 15px; border-radius: 5px; margin-bottom: 20px; } .signatures-row { display: flex; justify-content: space-between; margin-top: 50px; } .signature-block { text-align: center; width: 40%; } .signature-line { border-top: 1px solid #333; margin-top: 40px; padding-top: 5px; } /* Korrektur-Styles */ .exam-header { background: #2c3e50; color: white; padding: 15px; margin-bottom: 20px; } .result-box { background: #e8f5e9; padding: 20px; text-align: center; margin-bottom: 20px; border-radius: 5px; } .result-grade { font-size: 36pt; font-weight: bold; } .result-points { font-size: 14pt; color: #666; } .corrections-list { margin-bottom: 20px; } .correction-item { border: 1px solid #ddd; padding: 15px; margin-bottom: 10px; border-radius: 5px; } .correction-question { font-weight: bold; margin-bottom: 5px; } .correction-feedback { background: #fff8e1; padding: 10px; margin-top: 10px; border-left: 3px solid #ffc107; font-size: 10pt; } .stats-table { width: 100%; margin-top: 20px; } .stats-table td { padding: 5px 10px; } """ def get_letter_template_html() -> str: """Inline HTML-Template fuer Elternbriefe.""" return """
Mit freundlichen Grüßen
{{ data.teacher_name }}
{% if data.teacher_title %}
{{ data.teacher_title }}{% endif %}
| Name: {{ data.student_name }} | Geburtsdatum: {{ data.student_birthdate }} |
| Klasse: {{ data.student_class }} |
| Fach | Note | Punkte |
|---|---|---|
| {{ subject.name }} | {{ subject.grade }} | {{ subject.points | default('-') }} |
| Sozialverhalten | {{ data.social_behavior }} |
| Arbeitsverhalten | {{ data.work_behavior }} |
| Klassendurchschnitt: | {{ data.class_average }} |
| Notenverteilung: | {% for grade, count in data.grade_distribution.items() %} Note {{ grade }}: {{ count }}x{% if not loop.last %}, {% endif %} {% endfor %} |
Datum: {{ data.date }}