summaryrefslogtreecommitdiffstats
path: root/web/template
diff options
context:
space:
mode:
authorLukas Fleischer <archlinux@cryptocrack.de>2014-06-24 23:22:08 +0200
committerLukas Fleischer <archlinux@cryptocrack.de>2014-06-25 11:33:29 +0200
commit8260111bcce49b73bd4973ae80296c913af2631d (patch)
treea3f7c8b2d4fe8005f632445d1b4c3b2d92b1533b /web/template
parent48cc8207bf88beaaedd21ef271b1d012f3e18686 (diff)
downloadaur-8260111bcce49b73bd4973ae80296c913af2631d.tar.gz
aur-8260111bcce49b73bd4973ae80296c913af2631d.tar.xz
Add a package request list
Introduce a new navigation point "Requests" that shows a list of pending package requests. This functionality is only available to Trusted Users. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Diffstat (limited to 'web/template')
-rw-r--r--web/template/header.php3
-rw-r--r--web/template/pkgreq_results.php66
2 files changed, 69 insertions, 0 deletions
diff --git a/web/template/header.php b/web/template/header.php
index df839950..03ce536c 100644
--- a/web/template/header.php
+++ b/web/template/header.php
@@ -57,6 +57,9 @@
<li><a href="<?= get_uri('/packages/'); ?>"><?= __("Packages"); ?></a></li>
<?php if (isset($_COOKIE['AURSID'])): ?>
<li><a href="<?= get_uri('/packages/'); ?>?SeB=m&amp;K=<?= username_from_sid($_COOKIE["AURSID"]); ?>"><?= __("My Packages"); ?></a></li>
+ <?php if (check_user_privileges()): ?>
+ <li><a href="<?= get_uri('/requests/') ; ?>"><?= __("Requests"); ?></a></li>
+ <?php endif; ?>
<li><a href="<?= get_uri('/submit/'); ?>"><?= __("Submit"); ?></a></li>
<?php if (check_user_privileges()): ?>
<li><a href="<?= get_uri('/accounts/') ; ?>"><?= __("Accounts"); ?></a></li>
diff --git a/web/template/pkgreq_results.php b/web/template/pkgreq_results.php
new file mode 100644
index 00000000..7cbdcc4b
--- /dev/null
+++ b/web/template/pkgreq_results.php
@@ -0,0 +1,66 @@
+<div id="pkglist-results" class="box">
+ <div class="pkglist-stats">
+ <p><?= __('%d package requests found. Page %d of %d.', $total, $current, $pages) ?></p>
+ <?php if (count($templ_pages) > 1): ?>
+ <p class="pkglist-nav">
+ <?php foreach ($templ_pages as $pagenr => $pagestart): ?>
+ <?php if ($pagestart === false): ?>
+ <span class="page"><?= $pagenr ?></span>
+ <?php elseif ($pagestart + 1 == $first): ?>
+ <span class="page"><?= $pagenr ?></span>
+ <?php else: ?>
+ <a class="page" href="<?= get_uri('/requests/'); ?>?<?= mkurl('O=' . $pagestart) ?>"><?= $pagenr ?></a>
+ <?php endif; ?>
+ <?php endforeach; ?>
+ </p>
+ <?php endif; ?>
+ </div>
+
+ <table class="results">
+ <thead>
+ <tr>
+ <th><?= __("Package") ?></th>
+ <th><?= __("Type") ?></th>
+ <th><?= __("Comments") ?></th>
+ <th><?= __("Filed by") ?></th>
+ <th><?= __("Date") ?></th>
+ </tr>
+ </thead>
+ <tbody>
+
+ <?php while (list($indx, $row) = each($results)): ?>
+ <tr class="<?= ($indx % 2 == 0) ? 'odd' : 'even' ?>">
+ <?php if ($row['BaseID']): ?>
+ <td><a href="<?= htmlspecialchars(get_pkgbase_uri($row["Name"]), ENT_QUOTES); ?>"><?= htmlspecialchars($row["Name"]) ?></a></td>
+ <?php else: ?>
+ <td><?= htmlspecialchars($row["Name"]) ?></td>
+ <?php endif; ?>
+ <td><?= htmlspecialchars(ucfirst($row['Type']), ENT_QUOTES); ?></td>
+ <td class="wrap"><?= htmlspecialchars($row['Comments'], ENT_QUOTES); ?></td>
+ <td>
+ <a href="<?= get_uri('/account/') . htmlspecialchars($row['User'], ENT_QUOTES) ?>" title="<?= __('View account information for %s', htmlspecialchars($row['User'])) ?>"><?= htmlspecialchars($row['User']) ?></a>
+ </td>
+ <td><?= gmdate("Y-m-d H:i", intval($row['RequestTS'])) ?></td>
+ </tr>
+ <?php endwhile; ?>
+
+ </tbody>
+ </table>
+
+ <div class="pkglist-stats">
+ <p><?= __('%d package requests found. Page %d of %d.', $total, $current, $pages) ?></p>
+ <?php if (count($templ_pages) > 1): ?>
+ <p class="pkglist-nav">
+ <?php foreach ($templ_pages as $pagenr => $pagestart): ?>
+ <?php if ($pagestart === false): ?>
+ <span class="page"><?= $pagenr ?></span>
+ <?php elseif ($pagestart + 1 == $first): ?>
+ <span class="page"><?= $pagenr ?></span>
+ <?php else: ?>
+ <a class="page" href="<?= get_uri('/requests/'); ?>?<?= mkurl('O=' . $pagestart) ?>"><?= $pagenr ?></a>
+ <?php endif; ?>
+ <?php endforeach; ?>
+ </p>
+ <?php endif; ?>
+ </div>
+</div>