aboutsummaryrefslogtreecommitdiffhomepage
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/note.php49
1 files changed, 25 insertions, 24 deletions
diff --git a/templates/note.php b/templates/note.php
index f0f289c..f9eef45 100644
--- a/templates/note.php
+++ b/templates/note.php
@@ -66,33 +66,34 @@ if ($user != null) {
</div>
<?php endif; ?>
- <div class="content">
- <?php if (isset($note->summary)): ?>
- <details>
- <summary><?= htmlspecialchars($note->summary) ?></summary>
- <?php endif; ?>
+ <?php if (isset($note->summary)): ?>
+ <details>
+ <summary><?= htmlspecialchars($note->summary) ?></summary>
+ <?php endif; ?>
+ <div class="content">
<?= $note->getFormattedContent('text/html') ?? htmlspecialchars($note->plainContent) ?>
- <?php if (isset($note->summary)): ?>
- </details>
+ </div>
+
+ <?php if (count($note->attachments) > 0): ?>
+ <div class="attachments">
+ <?php foreach ($note->attachments as $attachment): ?>
+ <div>
+ <?php if (str_starts_with($attachment->type, 'image/')): ?>
+ <img src="<?= $attachment->href ?>" alt="<?= $attachment->description ?? '' ?>"
+ title="<?= $attachment->description ?? '' ?>">
+ <?php else: ?>
+ <a class="file" href="<?= $attachment->href ?>" target="_blank">
+ <span class="material-symbols attach-file"></span>
+ <span><?= $attachment->description ?? basename($attachment->href) ?></span>
+ </a>
+ <?php endif; ?>
+ </div>
+ <?php endforeach; ?>
+ </div>
<?php endif; ?>
- </div>
- <?php if (count($note->attachments) > 0): ?>
- <div class="attachments">
- <?php foreach ($note->attachments as $attachment): ?>
- <div>
- <?php if (str_starts_with($attachment->type, 'image/')): ?>
- <img src="<?= $attachment->href ?>" alt="<?= $attachment->description ?? '' ?>"
- title="<?= $attachment->description ?? '' ?>">
- <?php else: ?>
- <a class="file" href="<?= $attachment->href ?>" target="_blank">
- <span class="material-symbols attach-file"></span>
- <span><?= $attachment->description ?? basename($attachment->href) ?></span>
- </a>
- <?php endif; ?>
- </div>
- <?php endforeach; ?>
- </div>
+ <?php if (isset($note->summary)): ?>
+ </details>
<?php endif; ?>
<div class="buttons">