Add package base detail pages

This adds package base details pages, similar to the package details
pages. Each package base details page contains general information
(package base name, category, submitter, maintainer, ...) and links to
all the corresponding packages. As on the package details pages,
comments and links to several package actions are also provided.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
This commit is contained in:
Lukas Fleischer 2014-04-05 02:06:54 +02:00
parent fb81bfd8df
commit f7d13b5b36
5 changed files with 380 additions and 1 deletions

View file

@ -4,6 +4,7 @@ $ROUTES = array(
'' => 'home.php',
'/index.php' => 'home.php',
'/packages' => 'packages.php',
'/pkgbase' => 'pkgbase.php',
'/register' => 'account.php',
'/account' => 'account.php',
'/accounts' => 'account.php',
@ -18,6 +19,7 @@ $ROUTES = array(
);
$PKG_PATH = '/packages';
$PKGBASE_PATH = '/pkgbase';
$USER_PATH = '/account';
function get_route($path) {
@ -47,6 +49,11 @@ function get_pkg_route() {
return $PKG_PATH;
}
function get_pkgbase_route() {
global $PKGBASE_PATH;
return $PKGBASE_PATH;
}
function get_pkg_uri($pkgname) {
global $USE_VIRTUAL_URLS;
global $PKG_PATH;
@ -59,7 +66,14 @@ function get_pkg_uri($pkgname) {
}
function get_pkgbase_uri($pkgbase_name) {
return get_pkg_uri($pkgbase_name);
global $USE_VIRTUAL_URLS;
global $PKGBASE_PATH;
if ($USE_VIRTUAL_URLS) {
return $PKGBASE_PATH . '/' . urlencode($pkgbase_name) . '/';
} else {
return '/' . get_route($PKGBASE_PATH) . '?N=' . urlencode($pkgbase_name);
}
}
function get_user_route() {