React appropriately when there are no random list search results

This commit is contained in:
im-mi
2016-09-23 12:31:02 -04:00
parent 3bebe77add
commit f763fc1356
2 changed files with 15 additions and 7 deletions

View File

@ -17,13 +17,18 @@ class RandomListTheme extends Themelet {
public function display_page(Page $page, $images) {
$page->title = "Random Images";
$html = "<b>Refresh the page to view more images</b>
<div class='shm-image-list'>";
$html = "<b>Refresh the page to view more images</b>";
if (count($images)) {
$html .= "<div class='shm-image-list'>";
foreach ($images as $image)
$html .= $this->build_thumb_html($image);
foreach ($images as $image)
$html .= $this->build_thumb_html($image);
$html .= "</div>";
} else {
$html .= "<br/><br/>No images were found to match the search criteria";
}
$html .= "</div>";
$page->add_block(new Block("Random Images", $html));
$nav = $this->build_navigation($this->search_terms);