Erase login IP addresses after seven days
[aur.git] / web / template / pkgreq_results.php
blobfb49dfae94581484bacd354fd5b184de4a8b0b03
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 while (list($indx, $row) = each($results)): ?>
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 <br/ >
81 <?php elseif ($row['Type'] == 'merge'): ?>
82 <a href="<?= get_pkgbase_uri($row['Name']) ?>merge/?into=<?= urlencode($row['MergeInto']) ?>&via=<?= intval($row['ID']) ?>"><?= __('Accept') ?></a>
83 <br />
84 <?php elseif ($row['Type'] == 'orphan' && $due): ?>
85 <form action="<?= get_pkgbase_uri($row['Name']) . 'disown/'; ?>" method="post">
86 <input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
87 <input type="hidden" name="via" value="<?= intval($row['ID']) ?>" />
88 <input type="submit" class="button text-button" name="do_Disown" value="<?= __('Accept') ?>" />
89 </form>
90 <?php elseif ($row['Type'] == 'orphan' && !$due): ?>
91 <?= __('Locked') ?> (<?= $time_left_fmt ?>)
92 <br />
93 <?php endif; ?>
94 <?php endif; ?>
95 <a href="<?= get_pkgreq_route() . '/' . intval($row['ID']) ?>/close/"><?= __('Close') ?></a>
96 </td>
97 <?php elseif ($row['Open'] && !$show_headers): ?>
98 <td><?= __("Pending") ?></td>
99 <?php elseif ($row['Status'] == 1): ?>
100 <td><?= __("Closed") ?></td>
101 <?php elseif ($row['Status'] == 2): ?>
102 <td><?= __("Accepted") ?></td>
103 <?php elseif ($row['Status'] == 3): ?>
104 <td><?= __("Rejected") ?></td>
105 <?php else: ?>
106 <td><?= __("unknown") ?></td>
107 <?php endif; ?>
108 </tr>
109 <?php endwhile; ?>
111 </tbody>
112 </table>
114 <?php if ($show_headers): ?>
115 <div class="pkglist-stats">
117 <?= _n('%d package request found.', '%d package requests found.', $total) ?>
118 <?= __('Page %d of %d.', $current, $pages) ?>
119 </p>
120 <?php if (count($templ_pages) > 1): ?>
121 <p class="pkglist-nav">
122 <?php foreach ($templ_pages as $pagenr => $pagestart): ?>
123 <?php if ($pagestart === false): ?>
124 <span class="page"><?= $pagenr ?></span>
125 <?php elseif ($pagestart + 1 == $first): ?>
126 <span class="page"><?= $pagenr ?></span>
127 <?php else: ?>
128 <a class="page" href="<?= get_uri('/requests/'); ?>?<?= mkurl('O=' . $pagestart) ?>"><?= $pagenr ?></a>
129 <?php endif; ?>
130 <?php endforeach; ?>
131 </p>
132 <?php endif; ?>
133 </div>
134 <?php endif; ?>
135 <?php endif; ?>