Move default templates to .jinja2 files + add live preview + update CLAUDE.md
Some checks failed
Validate / Hassfest (push) Has been cancelled

Templates:
- Default EN/RU templates moved from inline Python strings to
  14 .jinja2 files in templates/{en,ru}/ directory
- Properly formatted with readable indentation and Jinja2
  whitespace control ({%- -%})
- load_default_templates(locale) loads from files on first access
- Seed function uses file loader instead of inline dicts

Preview:
- New POST /api/template-configs/preview-raw endpoint: renders
  arbitrary Jinja2 text with sample data (for live editing preview)
- Route ordering fixed: /variables before /{config_id}

CLAUDE.md:
- Added Frontend Architecture Notes (i18n, Svelte 5 runes, auth
  flow, Tailwind v4 quirks)
- Added Backend Architecture Notes (SQLAlchemy+aiohttp greenlet
  issue, SandboxedEnvironment import, system-owned entities,
  FastAPI route ordering, __pycache__)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-19 19:12:46 +03:00
parent aab29e253f
commit 5870ebd216
18 changed files with 214 additions and 55 deletions

View File

@@ -0,0 +1 @@
🗑️ Album "{{ album_name }}" was deleted.

View File

@@ -0,0 +1 @@
✏️ Album "{{ old_name }}" renamed to "{{ new_name }}".

View File

@@ -0,0 +1,12 @@
📷 {{ added_count }} new photo(s) added to album "{{ album_name }}".
{%- if people %}
👤 {{ people | join(", ") }}
{%- endif %}
{%- if added_assets %}
{%- for asset in added_assets %}
• {%- if asset.type == "VIDEO" %} 🎬{% else %} 🖼️{% endif %} {{ asset.filename }}
{%- if asset.city %} 📍 {{ asset.city }}{% if asset.country %}, {{ asset.country }}{% endif %}{% endif %}
{%- if asset.is_favorite %} ❤️{% endif %}
{%- endfor %}
{%- endif %}
{{ video_warning }}

View File

@@ -0,0 +1 @@
🗑️ {{ removed_count }} photo(s) removed from album "{{ album_name }}".

View File

@@ -0,0 +1,4 @@
📅 On this day:
{%- for asset in assets %}
• {%- if asset.type == "VIDEO" %} 🎬{% else %} 🖼️{% endif %} {{ asset.filename }} ({{ asset.created_at[:4] }})
{%- endfor %}

View File

@@ -0,0 +1,5 @@
📋 Tracked Albums Summary ({{ albums | length }} albums):
{%- for album in albums %}
• {{ album.name }}: {{ album.asset_count }} assets
{%- if album.url %} — {{ album.url }}{% endif %}
{%- endfor %}

View File

@@ -0,0 +1,4 @@
📸 Photos from "{{ album_name }}":
{%- for asset in assets %}
• {%- if asset.type == "VIDEO" %} 🎬{% else %} 🖼️{% endif %} {{ asset.filename }}
{%- endfor %}