aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSyndamia <kamen@syndamia.com>2025-02-02 11:08:50 +0200
committerSyndamia <kamen@syndamia.com>2025-02-02 11:08:50 +0200
commit14c84a83bcad285219539821647ee2d988eabaa8 (patch)
treef9d6da6b32892544529bc7b5e83fb29149659635
parent0f54da2c648a5913f6ed282f39dc7d6a62ef37da (diff)
downloadnowayforward_human-14c84a83bcad285219539821647ee2d988eabaa8.tar
nowayforward_human-14c84a83bcad285219539821647ee2d988eabaa8.tar.gz
nowayforward_human-14c84a83bcad285219539821647ee2d988eabaa8.zip
feat(views/list): Show a message when list is empty
-rw-r--r--views/list/index.php12
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>