""" 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 """ {{ data.subject }}
{% if data.school_info %}
{{ data.school_info.name }}
{{ data.school_info.address }}
Tel: {{ data.school_info.phone }} | E-Mail: {{ data.school_info.email }} {% if data.school_info.website %} | {{ data.school_info.website }}{% endif %}
{% else %}
Schule
{% endif %}
{{ data.date }}
{{ data.recipient_name }}
{{ data.recipient_address | replace('\\n', '
') | safe }}
Betreff: {{ data.subject }}
Schüler/in: {{ data.student_name }} | Klasse: {{ data.student_class }}
{{ data.content | replace('\\n', '
') | safe }}
{% if data.gfk_principles_applied %}
{% for principle in data.gfk_principles_applied %} ✓ {{ principle }} {% endfor %}
{% endif %}

Mit freundlichen Grüßen

{{ data.teacher_name }} {% if data.teacher_title %}
{{ data.teacher_title }}{% endif %}

{% if data.legal_references %} {% endif %}
Erstellt mit BreakPilot | {{ generated_at }}
""" def get_certificate_template_html() -> str: """Inline HTML-Template fuer Zeugnisse.""" return """ Zeugnis - {{ data.student_name }}
{% if data.school_info %}
{{ data.school_info.name }}
{% endif %}
{% if data.certificate_type == 'halbjahr' %} Halbjahreszeugnis {% elif data.certificate_type == 'jahres' %} Jahreszeugnis {% else %} Abschlusszeugnis {% endif %}
Schuljahr {{ data.school_year }}
Name: {{ data.student_name }} Geburtsdatum: {{ data.student_birthdate }}
Klasse: {{ data.student_class }}  

Leistungen

{% for subject in data.subjects %} {% endfor %}
Fach Note Punkte
{{ subject.name }} {{ subject.grade }} {{ subject.points | default('-') }}
{% if data.social_behavior or data.work_behavior %}

Verhalten

{% if data.social_behavior %} {% endif %} {% if data.work_behavior %} {% endif %}
Sozialverhalten {{ data.social_behavior }}
Arbeitsverhalten {{ data.work_behavior }}
{% endif %}
Versäumte Tage: {{ data.attendance.days_absent | default(0) }} (davon entschuldigt: {{ data.attendance.days_excused | default(0) }}, unentschuldigt: {{ data.attendance.days_unexcused | default(0) }})
{% if data.remarks %}
Bemerkungen:
{{ data.remarks }}
{% endif %}
Ausgestellt am: {{ data.issue_date }}
{{ data.class_teacher }}
Klassenlehrer/in
{{ data.principal }}
Schulleiter/in
Siegel der Schule
""" def get_correction_template_html() -> str: """Inline HTML-Template fuer Korrektur-Uebersichten.""" return """ Korrektur - {{ data.exam_title }}

{{ data.exam_title }}

{{ data.subject }} | {{ data.date }}
{{ data.student.name }} | Klasse {{ data.student.class_name }}
Note: {{ data.grade }}
{{ data.achieved_points }} von {{ data.max_points }} Punkten ({{ data.percentage | round(1) }}%)

Detaillierte Auswertung

{% for item in data.corrections %}
{{ item.question }}
{% if item.answer %}
Antwort: {{ item.answer }}
{% endif %}
Punkte: {{ item.points }}
{% if item.feedback %}
{{ item.feedback }}
{% endif %}
{% endfor %}
{% if data.teacher_notes %}
Lehrerkommentar:
{{ data.teacher_notes }}
{% endif %} {% if data.ai_feedback %}
KI-Feedback:
{{ data.ai_feedback }}
{% endif %} {% if data.class_average or data.grade_distribution %}

Klassenstatistik

{% if data.class_average %} {% endif %} {% if data.grade_distribution %} {% endif %}
Klassendurchschnitt: {{ data.class_average }}
Notenverteilung: {% for grade, count in data.grade_distribution.items() %} Note {{ grade }}: {{ count }}x{% if not loop.last %}, {% endif %} {% endfor %}
{% endif %}

Datum: {{ data.date }}

Erstellt mit BreakPilot | {{ generated_at }}
"""