Added notifications, image preview generator

This commit is contained in:
Ultradesu
2026-08-08 11:02:56 +01:00
parent f7a89b431d
commit c4823b7e64
16 changed files with 1926 additions and 100 deletions
+1 -1
View File
@@ -28,7 +28,7 @@
<div class="media-card">
{% if item.media.file_type == "photo" %}
<a href="/admin/uploads/{{ item.media.id.unwrap() }}" data-lightbox="photo">
<img src="/admin/uploads/{{ item.media.id.unwrap() }}" alt="" loading="lazy">
<img src="/admin/uploads/{{ item.media.id.unwrap() }}/thumbnail" alt="" loading="lazy">
</a>
{% else %}
<a href="/admin/uploads/{{ item.media.id.unwrap() }}" data-lightbox="video">
+1 -1
View File
@@ -114,7 +114,7 @@
<div class="visit-media-item">
{% if m.file_type == "photo" %}
<a href="/admin/uploads/{{ m.id.unwrap() }}" data-lightbox="photo">
<img src="/admin/uploads/{{ m.id.unwrap() }}" alt="" loading="lazy">
<img src="/admin/uploads/{{ m.id.unwrap() }}/thumbnail" alt="" loading="lazy">
</a>
{% else %}
<a href="/admin/uploads/{{ m.id.unwrap() }}" data-lightbox="video">
+59
View File
@@ -59,6 +59,65 @@
</div>
<h3 class="subtitle is-6 mb-2 has-text-grey" style="margin-top:1.25rem;">{{ t.settings_section_notifications }}</h3>
<div class="field">
<label class="checkbox">
<input type="checkbox" name="client_notifications_enabled" value="true"{% if client_notifications_checked %} checked{% endif %}>
{{ t.settings_client_notifications_enabled }}
</label>
<p class="help">{{ t.settings_client_notifications_help }}</p>
</div>
<blockquote class="notification is-warning is-light" style="padding:0.8rem 1rem;font-size:0.85rem;margin:0.75rem 0;">
<p>{{ t.settings_vapid_warning }}</p>
<p style="margin-top:0.45rem;">{{ t.settings_vapid_generate }}</p>
<code style="display:inline-block;margin-top:0.2rem;user-select:all;">cargo run --bin generate_vapid</code>
</blockquote>
<div class="field">
<label class="label">{{ t.settings_vapid_public_key }}</label>
<div class="control">
<input class="input" type="text" name="vapid_public_key" autocomplete="off" value="{% for s in &settings %}{% if s.key == "vapid_public_key" %}{{ s.value }}{% endif %}{% endfor %}">
</div>
</div>
<div class="field">
<label class="label">{{ t.settings_vapid_private_key }}</label>
<div class="control">
<input class="input" type="password" name="vapid_private_key" autocomplete="new-password" value="{% for s in &settings %}{% if s.key == "vapid_private_key" %}{{ s.value }}{% endif %}{% endfor %}">
</div>
</div>
<div class="field">
<label class="label">{{ t.settings_vapid_subject }}</label>
<div class="control">
<input class="input" type="text" name="vapid_subject" placeholder="mailto:admin@example.com" value="{% for s in &settings %}{% if s.key == "vapid_subject" %}{{ s.value }}{% endif %}{% endfor %}">
</div>
</div>
<details style="margin:0.9rem 0 1.25rem;border:1px solid #e8e5f5;border-radius:8px;background:#faf9ff;">
<summary style="cursor:pointer;padding:0.7rem 0.85rem;font-weight:600;font-size:0.9rem;">
{{ t.settings_push_subscribers }} ({{ push_subscribers.len() }})
</summary>
<div style="padding:0 0.85rem 0.85rem;overflow-x:auto;">
{% if push_subscribers.is_empty() %}
<p class="help">{{ t.settings_push_no_subscribers }}</p>
{% else %}
<table class="table is-fullwidth is-striped is-narrow" style="font-size:0.8rem;background:transparent;">
<thead><tr>
<th>{{ t.settings_push_client }}</th>
<th>{{ t.settings_push_devices }}</th>
<th>{{ t.settings_push_language }}</th>
<th>{{ t.settings_push_updated }}</th>
</tr></thead>
<tbody>
{% for subscriber in &push_subscribers %}
<tr>
<td>{{ subscriber.client_name }}</td>
<td>{{ subscriber.device_count }}</td>
<td>{{ subscriber.languages }}</td>
<td style="white-space:nowrap;">{{ subscriber.last_updated }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
</div>
</details>
<div class="field">
<label class="label">{{ t.settings_telegram_bot_token }}</label>
<div class="control">