From 789a7fa2bbdf50cd7c4d895cee20e445a45b57b6 Mon Sep 17 00:00:00 2001 From: MathiasDPX Date: Thu, 17 Apr 2025 18:34:04 +0200 Subject: [PATCH] Add attachments to scrapbook --- templates/scrapbook.html | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/templates/scrapbook.html b/templates/scrapbook.html index 26bb95d..25c4b7a 100644 --- a/templates/scrapbook.html +++ b/templates/scrapbook.html @@ -2,6 +2,15 @@ {% block head %} Scrapbook + + {% endblock %} @@ -20,6 +29,19 @@ {% endif %} {{ moment(post.postedAt).format('DD/MM/YYYY @ HH[h]mm') }}
{{ post.text | formatContent |safe }}
+ {% for attachment in post.attachments %} +
+ {% if attachment.endswith(('.jpg', '.jpeg', '.png', '.gif', '.webp', '.svg', '.bmp')) %} + Image + {% elif attachment.endswith(('.mp4', '.webm', '.ogg', '.mov', '.avi')) %} + + {% else %} +

URL does not appear to be an image or video: {{ attachment }}

+ {% endif %} + {% endfor %} {% endfor %}