[aur-dev] [PATCH 1/2] Move "Add Proposal" link to "Current Votes"
The page this links to allows for adding an item to the list of current votes. Move the link accordingly. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de> --- web/html/tu.php | 10 +--------- web/template/tu_list.php | 7 +++++++ 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/web/html/tu.php b/web/html/tu.php index fdccdb4..a6aa292 100644 --- a/web/html/tu.php +++ b/web/html/tu.php @@ -109,20 +109,12 @@ if ($atype == "Trusted User" || $atype == "Developer") { $type = __("Current Votes"); $nextresult = 0; include("tu_list.php"); -?> -<?php $result = past_proposal_list($order, $lim); - $type = __("Past Votes"); $nextresult = proposal_count(); include("tu_list.php"); -?> -<div class="box"> - <p><a href="<?= get_uri('/addvote/'); ?>"><?= __("Add Proposal") ?></a></p> -</div> - </p> -<?php + $result = last_votes_list(); include("tu_last_votes_list.php"); } diff --git a/web/template/tu_list.php b/web/template/tu_list.php index 1f7280a..c2e2d39 100644 --- a/web/template/tu_list.php +++ b/web/template/tu_list.php @@ -1,5 +1,12 @@ <div class="box"> <h2><?= $type ?></h2> + + <?php if ($type == __("Current Votes")): ?> + <ul class="admin-actions"> + <li><a href="<?= get_uri('/addvote/'); ?>"><?= __("Add Proposal") ?></a></li> + </ul> + <?php endif; ?> + <table class="results"> <thead> <tr> -- 1.8.4.rc3.500.gc3113b0
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> --- web/template/tu_list.php | 25 +++++++++++++------------ 1 file 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> -- 1.8.4.rc3.500.gc3113b0
participants (1)
-
Lukas Fleischer