refactor notifications to MVC: extract templates, context, and renderer
- Move all email layout to Jinja2 templates (4 files: admin_new, admin_update, parent_confirmation html+txt) - Extract pure helper/context-builder functions to context.py (format_types, calculate_age, format_dob, calculate_monthly_fee, format_days, build_admin_new_context, build_admin_update_context, build_parent_context) - Move i18n label strings out of Python into YAML locale files (i18n/de.yaml, i18n/en.yaml) — admin-editable without code changes - Add renderer.py as thin Jinja2 wrapper (render_template) - Reduce notifier.py to routing + SMTP dispatch only - Update tests to call context functions directly and render templates via renderer instead of calling private builder methods - Add jinja2 and pyyaml as explicit dependencies in pyproject.toml https://claude.ai/code/session_01LjjK7RjKVnC8bETtccfgna
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
===============================================
|
||||
ANMELDUNGS-AKTUALISIERUNG
|
||||
===============================================
|
||||
|
||||
Aktualisiert: {{ updated_date }} um {{ updated_time }} Uhr (UTC)
|
||||
Anmelde-ID: {{ registration_id }} (Version {{ version }})
|
||||
Kind: {{ child_name }}
|
||||
Eltern-E-Mail: {{ parent_email }}
|
||||
|
||||
-----------------------------------------------
|
||||
WAS HAT SICH GEÄNDERT
|
||||
-----------------------------------------------
|
||||
{% for change in changes %}
|
||||
{{ change.field }}:
|
||||
Alt: {{ change.old }}
|
||||
Neu: {{ change.new }}
|
||||
{% else %}
|
||||
(keine Änderungen erkannt)
|
||||
{% endfor %}
|
||||
-----------------------------------------------
|
||||
AKTUELLE ANMELDUNG (nach Aktualisierung)
|
||||
-----------------------------------------------
|
||||
Spielgruppe: {{ playgroup_types }}
|
||||
Tage: {{ days }}
|
||||
Monatl. Beitrag: {{ monthly_fee }}
|
||||
|
||||
Elternteil: {{ parent_name }}
|
||||
Adresse: {{ parent_street }}, {{ parent_postal_code }} {{ parent_city }}
|
||||
Telefon: {{ parent_phone }}
|
||||
|
||||
===============================================
|
||||
|
||||
Diese Aktualisierung wurde über den automatischen Anmeldeassistenten eingereicht.
|
||||
Reference in New Issue
Block a user