diff options
| author | Syndamia <kamen@syndamia.com> | 2025-02-01 09:13:53 +0200 |
|---|---|---|
| committer | Syndamia <kamen@syndamia.com> | 2025-02-01 09:13:53 +0200 |
| commit | d6212a96b01d855c49da58a085c07cf540654db7 (patch) | |
| tree | 50b1ec2ae8fe21e9201cf0600fb1f5f708f8f1ba | |
| parent | d0c76376fd736a84c7824d8521c5792060f69086 (diff) | |
| download | nowayforward_human-d6212a96b01d855c49da58a085c07cf540654db7.tar nowayforward_human-d6212a96b01d855c49da58a085c07cf540654db7.tar.gz nowayforward_human-d6212a96b01d855c49da58a085c07cf540654db7.zip | |
feat(views/profile): Show all lists by a user
| -rw-r--r-- | views/profile/index.php | 39 |
1 files changed, 33 insertions, 6 deletions
diff --git a/views/profile/index.php b/views/profile/index.php index 2c3cb5e..dad2070 100644 --- a/views/profile/index.php +++ b/views/profile/index.php @@ -15,7 +15,9 @@ <div class="card-blank-afterspace"></div> - <h2>Archives</h2> + <h2 onclick="openArchives()">Archives</h2> + <h2 onclick="openLists()">Lists</h2> + <section id="user-archives"> <?php foreach (Database\Webpage::allArchivesByUser($user->UID) as $page): ?> <section class="item"> <section> @@ -38,14 +40,39 @@ </section> </section> <?php endforeach; ?> - <script type="text/javascript"> - function showButtons() { - for (buttonset of document.getElementsByName('itemButton')) { - buttonset.hidden = false; + <script type="text/javascript"> + function showButtons() { + for (buttonset of document.getElementsByName('itemButton')) { + buttonset.hidden = false; + } } + authenticated(showButtons); + </script> + </section> + + <section id="user-lists" hidden> + <?php foreach(Database\ArchiveList::allListsByUser($user->UID) as $list): ?> + <section> + <?= $list->Name ?> + <?= $list->Description ?> + </section> + <?php endforeach; ?> + </section> + + <script type="text/javascript"> + const userArchives = document.getElementById('user-archives'); + const userLists = document.getElementById('user-lists'); + + function openArchives() { + userArchives.hidden = false; + userLists.hidden = true; + } + function openLists() { + userArchives.hidden = true; + userLists.hidden = false; } - authenticated(showButtons); </script> + <?php else: ?> <h2>User "<?= $username ?>" doesn't exist!</h2> <?php endif; ?> |
