Website Summary Files Commits Branches @commit @diff @stats
path: root / views / archive / index.php
diff options
context:
space:
mode:
Commitcc16ebc3927fa19c86d970067bcb9a16be94e40a (patch)
Author
 Syndamia <kamen@syndamia.com>
2025-01-26 22:19:25 +0200
Committer
 Syndamia <kamen@syndamia.com>
2025-01-26 22:24:48 +0200
Files04740380dd81fe2a0ccb6bacef00c972563eaa4c /views/archive/index.php
nowayforward_human-cc16ebc3927fa19c86d970067bcb9a16be94e40a.tar
nowayforward_human-cc16ebc3927fa19c86d970067bcb9a16be94e40a.tar.gz
nowayforward_human-cc16ebc3927fa19c86d970067bcb9a16be94e40a.zip
Parent32f3eadcc72a2c6ef3e732cecbc0706e7cbb267c (diff)
feat(views): Implement adding a list item
1 files changed, 15 insertions, 6 deletions
-rw-r--r--views/archive/index.php21
diff --git a/views/archive/index.php b/views/archive/index.php
index 7de2dff..085a033 100644
--- a/views/archive/index.php
+++ b/views/archive/index.php
@@ -37,14 +37,23 @@
<span class="float-right"><?= Database\User::fromDBuid($page->RequesterUID)->Username ?></span>
</div>
</section>
- <?php if (false): # If user logged-in ?>
- <section>
- <span><!-- Add to list button --></span>
- <span><!-- Delete (when admin) button --></span>
- <section>
- <?php endif; ?>
+ <section name="itemButton" hidden>
+ <form action="/list/update" method="GET">
+ <input type="hidden" name="wid" value="<?= $page->WID ?>">
+ <input type="submit" value="+">
+ </form>
+ <span><!-- Delete (when admin) button --></span>
+ </section>
</section>
<?php endforeach; ?>
+ <script type="text/javascript">
+ function showButtons() {
+ for (buttonset of document.getElementsByName('itemButton')) {
+ buttonset.hidden = false;
+ }
+ }
+ authenticated(showButtons);
+ </script>
<?php elseif(!$exists): ?>
<h2>"<?= $url ?>" Does not exist!</h2>