From 99ffcfc98439056b7bbdfc60030d4e77985010e9 Mon Sep 17 00:00:00 2001 From: canyonknight Date: Wed, 23 May 2012 13:34:58 -0400 Subject: pkg_details.php: Overhaul to match archweb * Rearrange order of package details to a more logical order * Add widget box on right side of page that has package actions. Limited to viewing PKGBUILD, downloading tarball, and printing package flag date. Eventually should be able to support all AUR package actions. * Move "Dependencies" and "Required by" to new CSS to allow for them to be displayed as columns adjacent to one another, with one package per line. Signed-off-by: canyonknight Signed-off-by: Lukas Fleischer --- web/template/pkg_details.php | 307 ++++++++++++++++++++++--------------------- 1 file changed, 156 insertions(+), 151 deletions(-) (limited to 'web/template/pkg_details.php') diff --git a/web/template/pkg_details.php b/web/template/pkg_details.php index 6764bbf..05a20fe 100644 --- a/web/template/pkg_details.php +++ b/web/template/pkg_details.php @@ -2,62 +2,14 @@ $atype = account_from_sid($SID); $uid = uid_from_sid($SID); -if (isset($_REQUEST['ID'])) { - $pkgid = intval($_REQUEST['ID']); -} -else { - $pkgid = pkgid_from_name($_REQUEST['N']); -} +$pkgid = intval($_REQUEST['ID']); -if ($uid == $row["MaintainerUID"] || - ($atype == "Developer" || $atype == "Trusted User")) { +$catarr = pkgCategories(); - $catarr = pkgCategories(); - $edit_cat = "
\n"; - $edit_cat.= "

"; - $edit_cat.= ""; - $edit_cat.= "" . __("Category") . ": "; - $edit_cat.= " "; - $edit_cat.= "

"; - $edit_cat.= "
"; +$submitter = username_from_id($row["SubmitterUID"]); +$maintainer = username_from_id($row["MaintainerUID"]); -} -else { - $edit_cat = "" . __("Category") . ": " . $row['Category'] . ""; -} - -if ($row["SubmitterUID"]) { - $submitter = username_from_id($row["SubmitterUID"]); - if ($SID) { - $submitter = '' . htmlspecialchars($submitter) . ''; - } - -} else { - $submitter = "None"; -} - -if ($row["MaintainerUID"]) { - $maintainer = username_from_id($row["MaintainerUID"]); - if ($SID) { - $maintainer = '' . htmlspecialchars($maintainer) . ''; - } - -} else { - $maintainer = "None"; -} - -$votes = __('Votes') . ': ' . $row['NumVotes']; -if ($atype == "Developer" || $atype == "Trusted User") { - $votes = "$votes"; -} +$votes = $row['NumVotes']; # In case of wanting to put a custom message $msg = __('unknown'); @@ -68,115 +20,168 @@ $updated_time = ($row["ModifiedTS"] == 0) ? $msg : gmdate("Y-m-d H:i", intval($r $submitted_time = ($row["SubmittedTS"] == 0) ? $msg : gmdate("Y-m-d H:i", intval($row["SubmittedTS"])); $out_of_date_time = ($row["OutOfDateTS"] == 0) ? $msg : gmdate("Y-m-d", intval($row["OutOfDateTS"])); -?> -
-

-
- -

-
- ' . htmlspecialchars($row['URL']) ?>
- -

- - +$urlpath = URL_DIR . substr($row['Name'], 0, 2) . "/" . $row['Name']; -

-
-
- -

+$deps = package_dependencies($row["ID"]); +$requiredby = package_required($row["Name"]); -

- -

- -
- -
-

+# $sources[0] = 'src'; +$sources = package_sources($row["ID"]); +?> +
+

+ -

+ + + + + + + + + + + ".__("Tarball")." :: "; - print "".__("PKGBUILD").""; - - if ($row["OutOfDateTS"] !== NULL) { - echo "
".__("This package has been flagged out of date.")." (${out_of_date_time})"; - } +if ($SID && ($uid == $row["MaintainerUID"] || + ($atype == "Developer" || $atype == "Trusted User"))): ?> -

+ + + + + + + " . htmlspecialchars($src[0]) . "
\n"; - } - else { - $src = $src[0]; - # It is presumably an internal source - echo "" . htmlspecialchars($src) . ""; - echo "
\n"; - } - } +if ($row["SubmitterUID"]): + if ($SID): ?> - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Upstream URL:
+
+
+ + + +
+
+ +
+ + +
None
None
+ +
+ +

+
+

+ 0): ?> + +
+ +
+

+ 0): ?> +
    + +
  • + +
+ +
+
+

+
+
+ 0): ?> +
    + +
  • + +
  • + + +
+
+
-- cgit v1.2.3-70-g09d2