diff options
| author | Syndamia <kamen@syndamia.com> | 2025-02-01 11:38:54 +0200 |
|---|---|---|
| committer | Syndamia <kamen@syndamia.com> | 2025-02-01 11:38:54 +0200 |
| commit | 0d87935bfd38f0cabecfaff374bd5ead221a494c (patch) | |
| tree | 2d256a4f8f5acbe907533882ecdfd704d4c643b0 /views/list | |
| parent | 49fa0bf2aa19ca3a0fc151c68308ae7fd819710f (diff) | |
| download | nowayforward_human-0d87935bfd38f0cabecfaff374bd5ead221a494c.tar nowayforward_human-0d87935bfd38f0cabecfaff374bd5ead221a494c.tar.gz nowayforward_human-0d87935bfd38f0cabecfaff374bd5ead221a494c.zip | |
feat(views/profile): Proper list elements UI
Diffstat (limited to 'views/list')
| -rw-r--r-- | views/list/index.php | 11 | ||||
| -rw-r--r-- | views/list/item.php | 19 | ||||
| -rw-r--r-- | views/list/item_show.php | 8 |
3 files changed, 33 insertions, 5 deletions
diff --git a/views/list/index.php b/views/list/index.php index 9047fb3..9bc348d 100644 --- a/views/list/index.php +++ b/views/list/index.php @@ -15,11 +15,12 @@ <p><?= $list->Description ?></p> <p><?= $author->Username ?></p> </section> - <?php foreach($list->allItems() as $webpage): ?> - <section> - <?= $webpage->URL ?> - </section> - <?php endforeach; ?> + <?php + foreach ($list->allItems() as $page) { + include $VIEWS_DIR . '/archive/item.php'; + } + include_once $VIEWS_DIR . '/archive/item_show.php'; + ?> <?php else: ?> <p> diff --git a/views/list/item.php b/views/list/item.php new file mode 100644 index 0000000..6316669 --- /dev/null +++ b/views/list/item.php @@ -0,0 +1,19 @@ +<section class="list" onclick="window.location.href = '/list/<?= $list->LID ?>'"> + <section> + <div class="heading"> + <h2> + <?= $list->Name ?> + </h2> + <a href="<?= '/profile/' . $user->Username ?>" class="float-right"> + <?= $user->Username ?> + </a> + </div> + <p> + <?= $list->Description ?> + </p> + </section> + <section name="itemButton" hidden> + <span><!-- Edit button --></span> + <span><!-- Delete button --></span> + </section> +</section> diff --git a/views/list/item_show.php b/views/list/item_show.php new file mode 100644 index 0000000..1a31f4b --- /dev/null +++ b/views/list/item_show.php @@ -0,0 +1,8 @@ +<script type="text/javascript"> + function showButtons() { + for (buttonset of document.getElementsByName('itemButton')) { + buttonset.hidden = false; + } + } + authenticated(showButtons); +</script> |
