diff options
| author | winter | 2025-01-27 19:45:39 +0000 |
|---|---|---|
| committer | winter | 2025-01-27 19:45:39 +0000 |
| commit | 5a6300f473b8be0e90a16e2b5992299b0ea1ddff (patch) | |
| tree | 844d3422a1c9575a4cecd56f32c1c7eba0358efd /templates/note.php | |
| parent | 9d59fd65b70b5b7588e4786f52f9cff1c3807426 (diff) | |
context menus and note deletion
Diffstat (limited to 'templates/note.php')
| -rw-r--r-- | templates/note.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/templates/note.php b/templates/note.php index e5c2942..74ce566 100644 --- a/templates/note.php +++ b/templates/note.php @@ -94,6 +94,23 @@ if ($user != null) { 'disabled' => $actionsDisabled ]); ?> + <div class="right"> + <?php call_template('menu_button', [], function () { + global $note; + $user = UserAccount::findByCurrentSession(); + ?> + <?php if ($note->author == $user?->actor || $user?->isAdmin): ?> + <li> + <button hx-delete="/fragment/note/<?= $note->id ?>" + hx-confirm="<?= __('note.action.delete.confirmation') ?>" hx-target="closest .note" + hx-swap="delete"> + <span class="material-symbols delete-outline"></span> + <span><?= __('note.action.delete') ?></span> + </button> + </li> + <?php endif; ?> + <?php }); ?> + </div> </div> <?php call_template('reply_form', ['note' => $note]); ?> |
