diff options
| author | winter | 2025-01-28 20:34:49 +0000 |
|---|---|---|
| committer | winter | 2025-01-28 20:34:49 +0000 |
| commit | e591374bb4b7d231fadf99d2e278806e53971919 (patch) | |
| tree | 146bc3eeca58fb298dc204341734f55680509c00 /templates | |
| parent | 09a42d23cd067dc5c2a7d4f03e8f074a9317f6c8 (diff) | |
display attachments on notes
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/note.php | 17 | ||||
| -rw-r--r-- | templates/write_note_form.php | 11 |
2 files changed, 22 insertions, 6 deletions
diff --git a/templates/note.php b/templates/note.php index 4d05554..c69531b 100644 --- a/templates/note.php +++ b/templates/note.php @@ -77,6 +77,23 @@ if ($user != null) { <?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 ?>"> + <?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 class="buttons"> <?php foreach (['like', 'dislike', 'reshare'] as $action) { $kind = InteractionKind::from($action); diff --git a/templates/write_note_form.php b/templates/write_note_form.php index d2dae61..b86e825 100644 --- a/templates/write_note_form.php +++ b/templates/write_note_form.php @@ -9,13 +9,12 @@ <div class="handle">@<?= $actor->handle ?></div> </div> </div> - <div class="row"> + <div class="row summaryAndContent"> <label for="noteContent"><?= __('writeNote.label') ?></label> - <textarea name="content" id="noteContent" required autocomplete="off"></textarea> - </div> - <div class="row"> - <label for="noteSummary"><?= __('writeNote.summary.label') ?></label> - <input type="text" id="noteSummary" name="summary" autocomplete="off"> + <input type="text" id="noteSummary" name="summary" autocomplete="off" + placeholder="<?= __('writeNote.summary.label') ?>"> + <textarea name="content" id="noteContent" required autocomplete="off" + placeholder="<?= __('writeNote.placeholder') ?>"></textarea> </div> <div class="row"> <label class="standalone"><?= __('writeNote.mentions.label') ?></label> |
