From d10aad87ddebd4857a90b6d638aac803d7373dc6 Mon Sep 17 00:00:00 2001 From: winter Date: Fri, 14 Feb 2025 20:53:17 +0000 Subject: make attachments nicer --- templates/note.php | 16 +++------------- templates/note_attachment.php | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 13 deletions(-) create mode 100644 templates/note_attachment.php (limited to 'templates') diff --git a/templates/note.php b/templates/note.php index b5b07df..736d5f9 100644 --- a/templates/note.php +++ b/templates/note.php @@ -78,19 +78,9 @@ if ($user != null) { attachments) > 0): ?>
- attachments as $attachment): ?> -
- isImage()): ?> - <?= htmlspecialchars($attachment->description ?? '') ?> - - - - description ?? basename($attachment->href)) ?> - - -
- + attachments as $attachment) { + call_template('note_attachment', ['attachment' => $attachment]); + } ?>
diff --git a/templates/note_attachment.php b/templates/note_attachment.php new file mode 100644 index 0000000..c139a00 --- /dev/null +++ b/templates/note_attachment.php @@ -0,0 +1,17 @@ +href); +if (!$attachment->isImage() && $attachment->description) { + $filename = $attachment->description; +} +?> +
+ isImage()): ?> + <?= htmlspecialchars($attachment->description ?? '') ?> + + + + + + +
\ No newline at end of file -- cgit v1.3