mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
Use virtual paths for voters page
Link to "/packages/$pkgname/voters/" instead of using "/voters/" and a get parameter to request a specific package by ID. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
This commit is contained in:
parent
51b8213ff1
commit
7ad4bc352d
3 changed files with 12 additions and 5 deletions
|
@ -13,6 +13,12 @@ if (isset($tokens[1]) && '/' . $tokens[1] == get_pkg_route()) {
|
|||
$_GET['N'] = $tokens[2];
|
||||
|
||||
if (isset($tokens[3])) {
|
||||
if ($tokens[3] == 'voters') {
|
||||
$_GET['ID'] = pkgid_from_name($tokens[2]);
|
||||
include('voters.php');
|
||||
return;
|
||||
}
|
||||
|
||||
/* TODO: Remove support for legacy URIs and move these
|
||||
* actions to separate modules. */
|
||||
switch ($tokens[3]) {
|
||||
|
|
|
@ -14,7 +14,6 @@ $ROUTES = array(
|
|||
'/rss' => 'rss.php',
|
||||
'/submit' => 'pkgsubmit.php',
|
||||
'/tu' => 'tu.php',
|
||||
'/voters' => 'voters.php',
|
||||
'/addvote' => 'addvote.php',
|
||||
);
|
||||
|
||||
|
|
|
@ -143,10 +143,12 @@ if ($row["MaintainerUID"]):
|
|||
</tr>
|
||||
<tr>
|
||||
<th><?php echo __('Votes') . ': ' ?></th>
|
||||
<?php
|
||||
if ($atype == "Developer" || $atype == "Trusted User"):
|
||||
?>
|
||||
<?php if ($atype == "Developer" || $atype == "Trusted User"): ?>
|
||||
<?php if ($USE_VIRTUAL_URLS): ?>
|
||||
<td><a href="<?php echo get_pkg_uri($row['Name']); ?>voters/"><?php echo $votes ?></a>
|
||||
<?php else: ?>
|
||||
<td><a href="<?php echo get_uri('/voters/'); ?>?ID=<?php echo $pkgid ?>"><?php echo $votes ?></a>
|
||||
<?php endif; ?>
|
||||
<?php else: ?>
|
||||
<td><?php echo $votes ?></td>
|
||||
<?php endif; ?>
|
||||
|
|
Loading…
Add table
Reference in a new issue