From 14c84a83bcad285219539821647ee2d988eabaa8 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sun, 2 Feb 2025 11:08:50 +0200 Subject: feat(views/list): Show a message when list is empty --- views/list/index.php | 12 +++++++++--- 1 file 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 @@
allItems() as $page) { - include $VIEWS_DIR . '/archive/item.php'; + $items = $list->allItems(); + if (!$items) { + echo '

No archives

'; + } + 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'; ?>
-- cgit v1.2.3