Move preview button to per-slot in edit form, remove card dropdown
All checks were successful
Validate / Hassfest (push) Successful in 3s
All checks were successful
Validate / Hassfest (push) Successful in 3s
- Preview button always visible next to Variables for each template slot
- Remove \n\n prefix from video_warning default value
- Use conditional {% if video_warning %} with blank line in templates
- Fix all .jinja2 files and inline defaults to match
- Add SVG favicon (camera + notification dot)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,8 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||||
|
<title>Immich Watcher</title>
|
||||||
%sveltekit.head%
|
%sveltekit.head%
|
||||||
</head>
|
</head>
|
||||||
<body data-sveltekit-preload-data="hover">
|
<body data-sveltekit-preload-data="hover">
|
||||||
|
|||||||
@@ -189,6 +189,8 @@
|
|||||||
<div class="flex items-center justify-between mb-1">
|
<div class="flex items-center justify-between mb-1">
|
||||||
<label class="text-xs text-[var(--color-muted-foreground)]">{t(`templateConfig.${slot.label}`)}</label>
|
<label class="text-xs text-[var(--color-muted-foreground)]">{t(`templateConfig.${slot.label}`)}</label>
|
||||||
<div class="flex items-center gap-2">
|
<div class="flex items-center gap-2">
|
||||||
|
<button type="button" onclick={() => previewSlot(slot.key)}
|
||||||
|
class="text-xs text-[var(--color-muted-foreground)] hover:underline">{t('templateConfig.preview')}</button>
|
||||||
{#if varsRef[slot.key]}
|
{#if varsRef[slot.key]}
|
||||||
<button type="button" onclick={() => showVarsFor = slot.key}
|
<button type="button" onclick={() => showVarsFor = slot.key}
|
||||||
class="text-xs text-[var(--color-muted-foreground)] hover:underline">{t('templateConfig.variables')}</button>
|
class="text-xs text-[var(--color-muted-foreground)] hover:underline">{t('templateConfig.variables')}</button>
|
||||||
@@ -204,13 +206,10 @@
|
|||||||
<p class="mt-1 text-xs" style="color: var(--color-error-fg);">✕ {t('common.syntaxError')}: {slotErrors[slot.key]}{slotErrorLines[slot.key] ? ` (${t('common.line')} ${slotErrorLines[slot.key]})` : ''}</p>
|
<p class="mt-1 text-xs" style="color: var(--color-error-fg);">✕ {t('common.syntaxError')}: {slotErrors[slot.key]}{slotErrorLines[slot.key] ? ` (${t('common.line')} ${slotErrorLines[slot.key]})` : ''}</p>
|
||||||
{/if}
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
{#if slotPreview[slot.key] && !slotErrors[slot.key]}
|
{#if slotPreview[slot.key]}
|
||||||
<details class="mt-1">
|
<div class="mt-1 p-2 bg-[var(--color-muted)] rounded text-sm">
|
||||||
<summary class="text-xs text-[var(--color-muted-foreground)] cursor-pointer hover:underline">{t('templateConfig.preview')}</summary>
|
<pre class="whitespace-pre-wrap">{slotPreview[slot.key]}</pre>
|
||||||
<div class="mt-1 p-2 bg-[var(--color-muted)] rounded text-sm">
|
</div>
|
||||||
<pre class="whitespace-pre-wrap">{slotPreview[slot.key]}</pre>
|
|
||||||
</div>
|
|
||||||
</details>
|
|
||||||
{/if}
|
{/if}
|
||||||
{:else}
|
{:else}
|
||||||
<input bind:value={(form as any)[slot.key]}
|
<input bind:value={(form as any)[slot.key]}
|
||||||
|
|||||||
8
frontend/static/favicon.svg
Normal file
8
frontend/static/favicon.svg
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
|
||||||
|
<rect width="32" height="32" rx="6" fill="#4f46e5"/>
|
||||||
|
<circle cx="16" cy="15" r="7" fill="none" stroke="white" stroke-width="2"/>
|
||||||
|
<circle cx="16" cy="15" r="3" fill="white"/>
|
||||||
|
<rect x="11" y="6" width="10" height="3" rx="1" fill="white" opacity="0.7"/>
|
||||||
|
<circle cx="25" cy="8" r="5" fill="#ef4444"/>
|
||||||
|
<circle cx="25" cy="8" r="3" fill="#ef4444" stroke="white" stroke-width="1.5"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 457 B |
@@ -67,7 +67,7 @@ _SAMPLE_CONTEXT = {
|
|||||||
"removed_assets": ["asset-id-1", "asset-id-2"],
|
"removed_assets": ["asset-id-1", "asset-id-2"],
|
||||||
"people": ["Alice", "Bob"],
|
"people": ["Alice", "Bob"],
|
||||||
"shared": True,
|
"shared": True,
|
||||||
"video_warning": "\n\n⚠️ Note: Videos may not be sent due to Telegram's 50 MB file size limit.",
|
"video_warning": "⚠️ Note: Videos may not be sent due to Telegram's 50 MB file size limit.",
|
||||||
# Rename fields (always present, empty for non-rename events)
|
# Rename fields (always present, empty for non-rename events)
|
||||||
"old_name": "Old Album",
|
"old_name": "Old Album",
|
||||||
"new_name": "New Album",
|
"new_name": "New Album",
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ class TemplateConfig(SQLModel, table=True):
|
|||||||
# Settings
|
# Settings
|
||||||
date_format: str = Field(default="%d.%m.%Y, %H:%M UTC")
|
date_format: str = Field(default="%d.%m.%Y, %H:%M UTC")
|
||||||
video_warning: str = Field(
|
video_warning: str = Field(
|
||||||
default="\n\n⚠️ Note: Videos may not be sent due to Telegram's 50 MB file size limit."
|
default="⚠️ Note: Videos may not be sent due to Telegram's 50 MB file size limit."
|
||||||
)
|
)
|
||||||
|
|
||||||
created_at: datetime = Field(default_factory=_utcnow)
|
created_at: datetime = Field(default_factory=_utcnow)
|
||||||
@@ -204,7 +204,7 @@ _INLINE_TEMPLATES_REMOVED = {
|
|||||||
'{%- if asset.is_favorite %} ❤️{% endif %}\n'
|
'{%- if asset.is_favorite %} ❤️{% endif %}\n'
|
||||||
'{%- endfor %}'
|
'{%- endfor %}'
|
||||||
'{%- endif %}'
|
'{%- endif %}'
|
||||||
'{{ video_warning }}'
|
'{%- if video_warning %}\n\n{{ video_warning }}{%- endif %}'
|
||||||
),
|
),
|
||||||
|
|
||||||
"message_assets_removed": '🗑️ {{ removed_count }} photo(s) removed from album "{{ album_name }}".',
|
"message_assets_removed": '🗑️ {{ removed_count }} photo(s) removed from album "{{ album_name }}".',
|
||||||
@@ -254,7 +254,7 @@ DEFAULT_TEMPLATE_RU = {
|
|||||||
'{%- if asset.is_favorite %} ❤️{% endif %}\n'
|
'{%- if asset.is_favorite %} ❤️{% endif %}\n'
|
||||||
'{%- endfor %}'
|
'{%- endfor %}'
|
||||||
'{%- endif %}'
|
'{%- endif %}'
|
||||||
'{{ video_warning }}'
|
'{%- if video_warning %}\n\n{{ video_warning }}{%- endif %}'
|
||||||
),
|
),
|
||||||
|
|
||||||
"message_assets_removed": '🗑️ {{ removed_count }} фото удалено из альбома "{{ album_name }}".',
|
"message_assets_removed": '🗑️ {{ removed_count }} фото удалено из альбома "{{ album_name }}".',
|
||||||
|
|||||||
@@ -9,4 +9,7 @@
|
|||||||
{%- if asset.is_favorite %} ❤️{% endif %}
|
{%- if asset.is_favorite %} ❤️{% endif %}
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
{%- if video_warning %}
|
||||||
|
|
||||||
{{ video_warning }}
|
{{ video_warning }}
|
||||||
|
{%- endif %}
|
||||||
|
|||||||
@@ -9,4 +9,7 @@
|
|||||||
{%- if asset.is_favorite %} ❤️{% endif %}
|
{%- if asset.is_favorite %} ❤️{% endif %}
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
{%- if video_warning %}
|
||||||
|
|
||||||
{{ video_warning }}
|
{{ video_warning }}
|
||||||
|
{%- endif %}
|
||||||
|
|||||||
Reference in New Issue
Block a user