aboutsummaryrefslogtreecommitdiff
path: root/views/list/item.php
diff options
context:
space:
mode:
authorSyndamia <kamen@syndamia.com>2025-02-09 19:59:10 +0200
committerSyndamia <kamen@syndamia.com>2025-02-09 19:59:10 +0200
commitaa600d9b16f73ba3af5e42fc1558e710ae955b5b (patch)
tree042fb25832780ba6ff06a88016f6be734ae1dd94 /views/list/item.php
parentd081c605227d9210e5b02a308272452283cf47d7 (diff)
downloadnowayforward_human-aa600d9b16f73ba3af5e42fc1558e710ae955b5b.tar
nowayforward_human-aa600d9b16f73ba3af5e42fc1558e710ae955b5b.tar.gz
nowayforward_human-aa600d9b16f73ba3af5e42fc1558e710ae955b5b.zip
feat(views/list): Add buttons to items
Diffstat (limited to 'views/list/item.php')
-rw-r--r--views/list/item.php14
1 files changed, 12 insertions, 2 deletions
diff --git a/views/list/item.php b/views/list/item.php
index 17a6a59..0146dbe 100644
--- a/views/list/item.php
+++ b/views/list/item.php
@@ -13,7 +13,17 @@
</p>
</section>
<section name="itemButton" hidden>
- <span><!-- Edit button --></span>
- <span><!-- Delete button --></span>
+ <?php if ($user !== null && $user->UID === $list->AuthorUID): ?>
+ <form action="/list/update" method="GET">
+ <input type="hidden" name="lid" value="<?= $list->LID ?>">
+ <button><?php include $VIEWS_DIR . '/img/edit.svg' ?></button>
+ </form>
+ <?php endif; ?>
+ <?php if ($user !== null && ($user->UID === $list->AuthorUID || $user->Role === 'Admin')): ?>
+ <form action="/list/delete" method="GET">
+ <input type="hidden" name="lid" value="<?= $list->LID ?>">
+ <button><?php include $VIEWS_DIR . '/img/delete.svg' ?></button>
+ </form>
+ <?php endif; ?>
</section>
</section>