diff options
author | Lukas Fleischer <archlinux@cryptocrack.de> | 2013-09-03 12:58:54 +0200 |
---|---|---|
committer | Lukas Fleischer <archlinux@cryptocrack.de> | 2013-09-03 12:58:54 +0200 |
commit | 54ad28369a3e6a701b26e7eb8fe608babfbd7a76 (patch) | |
tree | 2aeb37286d247fc3b3f0ebb8a3c75b1cdc32dc60 | |
parent | 3130a887e899a34ee826d5c2daf1bfbe1ba93351 (diff) |
tu_list.php: Hide table if no results are found
Instead of showing a table with a single "No results found." entry, do
not show the table at all and display the text "No results found." in a
<p></p> container.
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
-rw-r--r-- | web/template/tu_list.php | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/web/template/tu_list.php b/web/template/tu_list.php index c2e2d39..6ad9f90 100644 --- a/web/template/tu_list.php +++ b/web/template/tu_list.php @@ -7,6 +7,9 @@ </ul> <?php endif; ?> + <?php if (empty($result)): ?> + <p><?= __("No results found.") ?></p> + <?php else: ?> <table class="results"> <thead> <tr> @@ -21,14 +24,13 @@ </thead> <tbody> - <?php if (empty($result)): ?> - <tr><td align="center" colspan="0"><?= __("No results found.") ?></td></tr> - <?php else: while (list($indx, $row) = each($result)): - if ($indx % 2): - $c = "even"; - else: - $c = "odd"; - endif; + <?php while (list($indx, $row) = each($result)): ?> + <?php + if ($indx % 2) { + $c = "even"; + } else { + $c = "odd"; + } ?> <tr class="<?= $c ?>"> <td><?php $row["Agenda"] = htmlspecialchars(substr($row["Agenda"], 0, $prev_Len)); ?> @@ -54,12 +56,10 @@ <?php endif; ?> </td> </tr> - <?php - endwhile; - endif; - ?> + <?php endwhile; ?> </tbody> </table> + <div class="pkglist-stats"> <p class="pkglist-nav"> <?php if ($result): @@ -74,4 +74,5 @@ <?php endif; ?> <?php endif; ?> </div> + <?php endif; ?> </div> |