diff options
| author | Syndamia <kamen@syndamia.com> | 2025-01-26 22:21:23 +0200 |
|---|---|---|
| committer | Syndamia <kamen@syndamia.com> | 2025-01-26 22:24:48 +0200 |
| commit | 0aea820222aa3fd30f54a219451bd7467e810d03 (patch) | |
| tree | 014e8ea10cf9582fbc3297e383537c298331a78f | |
| parent | cc16ebc3927fa19c86d970067bcb9a16be94e40a (diff) | |
| download | nowayforward_human-0aea820222aa3fd30f54a219451bd7467e810d03.tar nowayforward_human-0aea820222aa3fd30f54a219451bd7467e810d03.tar.gz nowayforward_human-0aea820222aa3fd30f54a219451bd7467e810d03.zip | |
feat(views): Add list update buttons to profile archives
| -rw-r--r-- | views/profile/index.php | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/views/profile/index.php b/views/profile/index.php index e4015e9..2c3cb5e 100644 --- a/views/profile/index.php +++ b/views/profile/index.php @@ -29,14 +29,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 else: ?> <h2>User "<?= $username ?>" doesn't exist!</h2> <?php endif; ?> |
