diff options
| author | Syndamia <kamen@syndamia.com> | 2025-02-02 11:08:50 +0200 |
|---|---|---|
| committer | Syndamia <kamen@syndamia.com> | 2025-02-02 11:08:50 +0200 |
| commit | 14c84a83bcad285219539821647ee2d988eabaa8 (patch) | |
| tree | f9d6da6b32892544529bc7b5e83fb29149659635 /views/list | |
| parent | 0f54da2c648a5913f6ed282f39dc7d6a62ef37da (diff) | |
| download | nowayforward_human-14c84a83bcad285219539821647ee2d988eabaa8.tar nowayforward_human-14c84a83bcad285219539821647ee2d988eabaa8.tar.gz nowayforward_human-14c84a83bcad285219539821647ee2d988eabaa8.zip | |
feat(views/list): Show a message when list is empty
Diffstat (limited to 'views/list')
| -rw-r--r-- | views/list/index.php | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/views/list/index.php b/views/list/index.php index 4a84f78..d422630 100644 --- a/views/list/index.php +++ b/views/list/index.php @@ -38,10 +38,16 @@ </section> <section> <?php - foreach ($list->allItems() as $page) { - include $VIEWS_DIR . '/archive/item.php'; + $items = $list->allItems(); + if (!$items) { + echo '<h1>No archives</h1>'; + } + else { + foreach ($list->allItems() as $page) { + include $VIEWS_DIR . '/archive/item.php'; + } + include_once $VIEWS_DIR . '/archive/item_show.php'; } - include_once $VIEWS_DIR . '/archive/item_show.php'; ?> </section> </section> |
