Update wiki links to the new short URL
[aur.git] / web / template / pkgreq_results.php
blob1a565c3e583cbd75c468b160c2250679d5d9dba2
1 <?php if (count($results) == 0): ?>
2 <p><?= __("No requests matched your search criteria.") ?></p>
3 <?php else: ?>
4 <?php if ($show_headers): ?>
5 <div class="pkglist-stats">
6 <p>
7 <?= _n('%d package request found.', '%d package requests found.', $total) ?>
8 <?= __('Page %d of %d.', $current, $pages) ?>
9 </p>
10 <?php if (count($templ_pages) > 1): ?>
11 <p class="pkglist-nav">
12 <?php foreach ($templ_pages as $pagenr => $pagestart): ?>
13 <?php if ($pagestart === false): ?>
14 <span class="page"><?= $pagenr ?></span>
15 <?php elseif ($pagestart + 1 == $first): ?>
16 <span class="page"><?= $pagenr ?></span>
17 <?php else: ?>
18 <a class="page" href="<?= get_uri('/requests/'); ?>?<?= mkurl('O=' . $pagestart) ?>"><?= $pagenr ?></a>
19 <?php endif; ?>
20 <?php endforeach; ?>
21 </p>
22 <?php endif; ?>
23 </div>
24 <?php endif; ?>
26 <table class="results">
27 <thead>
28 <tr>
29 <th><?= __("Package") ?></th>
30 <th><?= __("Type") ?></th>
31 <th><?= __("Comments") ?></th>
32 <th><?= __("Filed by") ?></th>
33 <th><?= __("Date") ?></th>
34 <th><?= __("Status") ?></th>
35 </tr>
36 </thead>
37 <tbody>
39 <?php foreach ($results as $indx => $row): ?>
40 <?php
41 $idle_time = config_get_int('options', 'request_idle_time');
42 $due = ($row['Open'] && time() - intval($row['RequestTS']) > $idle_time);
43 if (!$due) {
44 $time_left = $idle_time - (time() - intval($row['RequestTS']));
45 if ($time_left > 48 * 3600) {
46 $time_left_fmt = _n("~%d day left", "~%d days left", round($time_left / (24 * 3600)));
47 } elseif ($time_left > 3600) {
48 $time_left_fmt = _n("~%d hour left", "~%d hours left", round($time_left / 3600));
49 } else {
50 $time_left_fmt = __("<1 hour left");
54 <tr class="<?= ($indx % 2 == 0) ? 'odd' : 'even' ?>">
55 <?php if ($row['BaseID']): ?>
56 <td><a href="<?= htmlspecialchars(get_pkgbase_uri($row["Name"]), ENT_QUOTES); ?>"><?= htmlspecialchars($row["Name"]) ?></a></td>
57 <?php else: ?>
58 <td><?= htmlspecialchars($row["Name"]) ?></td>
59 <?php endif; ?>
60 <?php if ($row['Type'] == 'merge'): ?>
61 <td>
62 <?= htmlspecialchars(ucfirst($row['Type']), ENT_QUOTES); ?>
63 <?php if (!empty($row['MergeInto'])): ?>
64 (<?= htmlspecialchars($row['MergeInto'], ENT_QUOTES); ?>)
65 <?php endif; ?>
66 </td>
67 <?php else: ?>
68 <td><?= htmlspecialchars(ucfirst($row['Type']), ENT_QUOTES); ?></td>
69 <?php endif; ?>
70 <td class="wrap"><?= htmlspecialchars($row['Comments'], ENT_QUOTES); ?></td>
71 <td>
72 <a href="<?= get_uri('/account/') . htmlspecialchars($row['User'], ENT_QUOTES) ?>" title="<?= __('View account information for %s', htmlspecialchars($row['User'])) ?>"><?= htmlspecialchars($row['User']) ?></a>
73 </td>
74 <td<?php if ($due): ?> class="flagged"<?php endif; ?>><?= date("Y-m-d H:i", intval($row['RequestTS'])) ?></td>
75 <?php if ($row['Open'] && $show_headers): ?>
76 <td>
77 <?php if ($row['BaseID']): ?>
78 <?php if ($row['Type'] == 'deletion'): ?>
79 <a href="<?= get_pkgbase_uri($row['Name']) ?>delete/?via=<?= intval($row['ID']) ?>"><?= __('Accept') ?></a>
80 <?php elseif ($row['Type'] == 'merge'): ?>
81 <a href="<?= get_pkgbase_uri($row['Name']) ?>merge/?into=<?= urlencode($row['MergeInto']) ?>&via=<?= intval($row['ID']) ?>"><?= __('Accept') ?></a>
82 <?php elseif ($row['Type'] == 'orphan' && $due): ?>
83 <a href="<?= get_pkgbase_uri($row['Name']) ?>disown/?via=<?= intval($row['ID']) ?>"><?= __('Accept') ?></a>
84 <?php elseif ($row['Type'] == 'orphan' && !$due): ?>
85 <?= __('Locked') ?> (<?= $time_left_fmt ?>)
86 <?php endif; ?>
87 <br/ >
88 <?php endif; ?>
89 <a href="<?= get_pkgreq_route() . '/' . intval($row['ID']) ?>/close/"><?= __('Close') ?></a>
90 </td>
91 <?php elseif ($row['Open'] && !$show_headers): ?>
92 <td><?= __("Pending") ?></td>
93 <?php elseif ($row['Status'] == 1): ?>
94 <td><?= __("Closed") ?></td>
95 <?php elseif ($row['Status'] == 2): ?>
96 <td><?= __("Accepted") ?></td>
97 <?php elseif ($row['Status'] == 3): ?>
98 <td><?= __("Rejected") ?></td>
99 <?php else: ?>
100 <td><?= __("unknown") ?></td>
101 <?php endif; ?>
102 </tr>
103 <?php endforeach; ?>
105 </tbody>
106 </table>
108 <?php if ($show_headers): ?>
109 <div class="pkglist-stats">
111 <?= _n('%d package request found.', '%d package requests found.', $total) ?>
112 <?= __('Page %d of %d.', $current, $pages) ?>
113 </p>
114 <?php if (count($templ_pages) > 1): ?>
115 <p class="pkglist-nav">
116 <?php foreach ($templ_pages as $pagenr => $pagestart): ?>
117 <?php if ($pagestart === false): ?>
118 <span class="page"><?= $pagenr ?></span>
119 <?php elseif ($pagestart + 1 == $first): ?>
120 <span class="page"><?= $pagenr ?></span>
121 <?php else: ?>
122 <a class="page" href="<?= get_uri('/requests/'); ?>?<?= mkurl('O=' . $pagestart) ?>"><?= $pagenr ?></a>
123 <?php endif; ?>
124 <?php endforeach; ?>
125 </p>
126 <?php endif; ?>
127 </div>
128 <?php endif; ?>
129 <?php endif; ?>