diff options
| author | Syndamia <kamen@syndamia.com> | 2025-02-09 20:58:58 +0200 |
|---|---|---|
| committer | Syndamia <kamen@syndamia.com> | 2025-02-09 20:58:58 +0200 |
| commit | ea25300ad04cda0b9b20393e174672fcca59d3ec (patch) | |
| tree | cdc74603bf9094978815c8c150c371709fc4709f | |
| parent | 90afdc23822045f36026ddecb36c01c9740b002f (diff) | |
| download | nowayforward_human-ea25300ad04cda0b9b20393e174672fcca59d3ec.tar nowayforward_human-ea25300ad04cda0b9b20393e174672fcca59d3ec.tar.gz nowayforward_human-ea25300ad04cda0b9b20393e174672fcca59d3ec.zip | |
feat(views/user): Show proper empty messages
| -rw-r--r-- | views/user/index.php | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/views/user/index.php b/views/user/index.php index ef888c7..a674839 100644 --- a/views/user/index.php +++ b/views/user/index.php @@ -44,22 +44,33 @@ </nav> <section id="userArchives"> <?php - foreach ($user->archives() as $page) { + $archives = $user->archives(); + foreach ($archives as $page) { include $VIEWS_DIR . '/archive/item.php'; } include_once $VIEWS_DIR . '/archive/item_show.php'; ?> + + <?php if (count($archives) === 0): ?> + <h1>No archives</h1> + <?php endif; ?> </section> <section id="userLists" hidden> <?php - foreach ($user->archiveLists() as $list) { + $archiveLists = $user->archiveLists(); + foreach ($archiveLists as $list) { include $VIEWS_DIR . '/list/item.php'; } include_once $VIEWS_DIR . '/list/item_show.php'; ?> + + <?php if (count($archiveLists) === 0): ?> + <h1>No lists</h1> + <?php endif; ?> </section> + <script type="text/javascript"> const elemOpenArchives = document.getElementById('openArchives'); const elemOpenLists = document.getElementById('openLists'); |
