Show placeholder when a user does not have any saved wishlists

This commit is contained in:
grandeljay 2022-06-21 08:38:16 +02:00
parent 7840ee2cb7
commit 86e1457c82

View file

@ -12,32 +12,39 @@ $page = new Page(__FILE__, __('Remembered lists'));
$page->header(); $page->header();
$page->bodyStart(); $page->bodyStart();
$page->navigation(); $page->navigation();
$wishlists = $user->getSavedWishlists();
?> ?>
<main> <main>
<div class="ui container"> <div class="ui container">
<h1 class="ui header"><?= $page->title ?></h1> <h1 class="ui header"><?= $page->title ?></h1>
<div class="ui four column doubling stackable grid wishlists-saved"> <?php if (!empty($wishlists)) { ?>
<?php foreach ($user->getSavedWishlists() as $wishlist_saved) { ?> <div class="ui four column doubling stackable grid wishlists-saved">
<?php <?php foreach ($wishlists as $wishlist_saved) { ?>
$wishlist = new Wishlist($wishlist_saved['wishlist']); <?php
$wishlist_user = new User($wishlist_saved['user']); $wishlist = new Wishlist($wishlist_saved['wishlist']);
$wishlist_href = Page::PAGE_WISHLIST . '&hash=' . $wishlist->hash; $wishlist_user = new User($wishlist_saved['user']);
?> $wishlist_href = Page::PAGE_WISHLIST . '&hash=' . $wishlist->hash;
<div class="column"> ?>
<a class="header" href="<?= $wishlist_href ?>"> <div class="column">
<div class="ui rounded bordered fluid image"> <a class="header" href="<?= $wishlist_href ?>">
<?= file_get_contents(ROOT . '/' . Wish::NO_IMAGE) ?> <div class="ui rounded bordered fluid image">
</div> <?= file_get_contents(ROOT . '/' . Wish::NO_IMAGE) ?>
</a> </div>
</a>
<div class="content"> <div class="content">
<a class="header" href="<?= $wishlist_href ?>"><?= $wishlist->getTitle(); ?></a> <a class="header" href="<?= $wishlist_href ?>"><?= $wishlist->getTitle(); ?></a>
<div class="description"><?= $wishlist_user->getDisplayName(); ?></div> <div class="description"><?= $wishlist_user->getDisplayName(); ?></div>
</div>
</div> </div>
</div> <?php } ?>
<?php } ?> </div>
</div> <?php } else { ?>
<?= Page::info(__('Ask somebody to share their wishlist with you and hit the remember button for it to show up here!'), __('No lists')); ?>
<?php } ?>
</div> </div>
</main> </main>