Replace video_warning with target_type + has_videos/has_photos
All checks were successful
Validate / Hassfest (push) Successful in 2s

Major template system improvements:
- Remove video_warning field from TemplateConfig model
- Add target_type, has_videos, has_photos to template context
- Templates use {% if target_type == "telegram" and has_videos %}
  for conditional Telegram warnings instead of a separate field
- date_format moved from "Telegram" to "Settings" group
- Add target type selector (Telegram/Webhook) in template editor
  to preview how templates render for each target type
- All template slots now use JinjaEditor (not plain <input>)
- Preview endpoint accepts target_type parameter
- Clean up TemplateConfigCreate schema (remove stale fields)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-19 21:11:38 +03:00
parent 510463cba6
commit 4babaddd87
9 changed files with 66 additions and 49 deletions

View File

@@ -263,8 +263,8 @@
"periodicAlbum": "Per-album item",
"scheduledAssets": "Scheduled assets",
"memoryMode": "Memory mode",
"telegramSettings": "Telegram",
"videoWarning": "Video warning",
"settings": "Settings",
"previewAs": "Preview as",
"preview": "Preview",
"variables": "Variables",
"assetFields": "Asset fields (in {% for asset in added_assets %})",
@@ -289,7 +289,9 @@
"added_assets": "List of asset dicts (use {% for asset in added_assets %})",
"removed_assets": "List of removed asset IDs (strings)",
"shared": "Whether album is shared (boolean)",
"video_warning": "Video size warning (from template config, only if videos present)",
"target_type": "Target type: 'telegram' or 'webhook'",
"has_videos": "Whether added assets contain videos (boolean)",
"has_photos": "Whether added assets contain photos (boolean)",
"old_name": "Previous album name (rename events)",
"new_name": "New album name (rename events)",
"old_shared": "Was album shared before rename (boolean)",