mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
Use virtual paths for package details
Extend the routing front/back ends to allow for using "/package/$pkgname/" for individual packages. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
This commit is contained in:
parent
2425f963f8
commit
03486c3b6f
10 changed files with 40 additions and 15 deletions
|
@ -5,8 +5,16 @@ include_once("config.inc.php");
|
|||
include_once("routing.inc.php");
|
||||
|
||||
$path = rtrim($_SERVER['PATH_INFO'], '/');
|
||||
$tokens = explode('/', $path);
|
||||
|
||||
if (get_route($path) !== NULL) {
|
||||
if (isset($tokens[1]) &&'/' . $tokens[1] == get_pkg_route()) {
|
||||
if (isset($tokens[2])) {
|
||||
unset($_GET['ID']);
|
||||
$_GET['N'] = $tokens[2];
|
||||
}
|
||||
|
||||
include get_route('/' . $tokens[1]);
|
||||
} elseif (get_route($path) !== NULL) {
|
||||
include get_route($path);
|
||||
} else {
|
||||
switch ($path) {
|
||||
|
|
|
@ -400,7 +400,7 @@ if ($uid):
|
|||
# Entire package creation process is atomic
|
||||
end_atomic_commit($dbh);
|
||||
|
||||
header('Location: ' . get_uri('/packages/') . '?ID=' . $packageID);
|
||||
header('Location: ' . get_pkg_uri($pkg_name));
|
||||
}
|
||||
|
||||
chdir($cwd);
|
||||
|
|
|
@ -15,7 +15,7 @@ if ($atype == 'Trusted User' || $atype== 'Developer'):
|
|||
?>
|
||||
|
||||
<div class="box">
|
||||
<h2>Votes for <a href="<?php echo get_uri('/packages/'); ?>?ID=<?php echo $pkgid ?>"><?php echo pkgname_from_id($pkgid) ?></a></h2>
|
||||
<h2>Votes for <a href="<?php echo get_pkg_uri(pkgname_from_id($pkgid)); ?>"><?php echo pkgname_from_id($pkgid) ?></a></h2>
|
||||
<div class="boxbody">
|
||||
|
||||
<?php
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue