From b31b4ec03edd60820b8e4a8d596de9bc2e14d21b Mon Sep 17 00:00:00 2001 From: Loui Chang Date: Sat, 24 Jan 2009 01:22:19 -0500 Subject: Add package details template (pkg_details.php) Signed-off-by: Loui Chang --- web/html/css/arch.css | 3 - web/html/css/containers.css | 2 +- web/lib/pkgfuncs.inc | 182 +------------------------------------------ web/template/pkg_details.php | 174 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 178 insertions(+), 183 deletions(-) create mode 100644 web/template/pkg_details.php (limited to 'web') diff --git a/web/html/css/arch.css b/web/html/css/arch.css index 42a6627..ffe713e 100644 --- a/web/html/css/arch.css +++ b/web/html/css/arch.css @@ -431,9 +431,6 @@ textarea.vLargeTextField { .frontpgboxbody > table { width: 100%; } -.boxSoftTitle { - text-align: right; -} .pgboxtitle { border: 2px solid #ddd; border-top: 1px solid #fff; diff --git a/web/html/css/containers.css b/web/html/css/containers.css index c0fb877..c7a9973 100644 --- a/web/html/css/containers.css +++ b/web/html/css/containers.css @@ -95,7 +95,7 @@ td.div { background-color: #eee; width: 3px; } -td.boxSoftTitle { +.boxSoftTitle { border-bottom: 1px solid #fff; border-top: 1px solid #fff; background-color: #f1f2f4; diff --git a/web/lib/pkgfuncs.inc b/web/lib/pkgfuncs.inc index e328c30..b6f32e6 100644 --- a/web/lib/pkgfuncs.inc +++ b/web/lib/pkgfuncs.inc @@ -287,187 +287,11 @@ function package_details($id=0, $SID="") { if (empty($row)) { print __("Package details could not be found.")."
\n"; - } else { - - # print out package details - # - echo "
\n"; - echo "
".__("Package Details")."
\n"; - echo "
\n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " "; - } else { - echo $maintainer . ""; - } - } else { - $maintainer = "None"; - echo $maintainer . ""; - } - echo " \n"; - echo " \n"; - - # In case of wanting to put a custom message - $msg = __("unknown"); - $license = $row["License"] == "" ? $msg : $row["License"]; - - echo " \n"; - echo " \n"; - - # Print the timestamps for last updates - $updated_time = ($row["ModifiedTS"] == 0) ? "(unknown)" : gmdate("r", intval($row["ModifiedTS"])); - $submitted_time = ($row["SubmittedTS"] == 0) ? "(unknown)" : gmdate("r", intval($row["SubmittedTS"])); - echo " \n"; - echo " \n"; - echo " "; - } elseif ($row["LocationID"] == 3) { - echo "CVS"; - } - echo "\n"; - if ($row["OutOfDate"] == 1) { - echo "\n"; - } - echo " \n"; - - $deps = package_dependencies($row["ID"]); # $deps[0] = array('id','name', 'dummy'); - if (count($deps) > 0) { - - echo " \n"; - echo " "; - - } - - $deps = package_required($row["ID"]); - if (count($deps) > 0) { - - echo " \n"; - - } - - $sources = package_sources($row["ID"]); # $sources[0] = 'src'; - if (count($sources) > 0) { - - echo " \n"; - - } - - echo " \n"; - echo "
"; - echo $row["Name"] . " " . $row["Version"]."
"; - echo "".$row["URL"]."
".$row["Description"]; - echo "
"; - if ($row["Location"] == "unsupported" and ( - $uid == $row["MaintainerUID"] or - ($atype == "Developer" or - $atype == "Trusted User"))) { - $edit_cat = "".$row["Category"].""; - $edit_cat .= "  ("; - $edit_cat .= __("change category").")"; - } else { - $edit_cat = $row["Category"]; - } - echo $row["Location"]." :: ".$edit_cat."
".__("Maintainer").": "; - if ($row["MaintainerUID"]) { - $maintainer = username_from_id($row["MaintainerUID"]); - if ($SID) { - echo ""; - echo $maintainer . "
".__("Votes").": "; - echo $row["NumVotes"] . "

".__("License").": ".$license; - echo "
"; - echo __("Last Updated").": ".$updated_time."
"; - echo __("First Submitted").": ".$submitted_time."
"; - if ($row["LocationID"] == 2) { - $urlpath = URL_DIR.$row["Name"]."/".$row["Name"]; - print "".__("Tarball")." :: ".__("Files")." :: PKGBUILD
"; - echo "".__("This package has been flagged out of date.")."
\n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo "
"; - echo __("Dependencies")."
"; - - while (list($k, $darr) = each($deps)) { - $url = "".$darr[1].$darr[3]."
\n"; - else echo "".$darr[1].$darr[3]."
\n"; - } - - echo "
"; - echo ""; - echo "\n"; - echo "\n"; - echo "
"; - echo __("Required by")."
"; - - while (list($k, $darr) = each($deps)) { - $url = "".$darr[1].$darr[3]."
\n"; - else print "".$darr[1].$darr[3]."
\n"; - } - - echo "
\n"; - echo "
\n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo "
"; - echo __("Sources")."
"; - - while (list($k, $src) = each($sources)) { - $parsed_url = parse_url($src); - if ($parsed_url['scheme']) - { - //It is an external source - echo "".$src."
\n"; - } - else - { - //It is presumably an internal source - if ($row["LocationID"] == 2) { - echo "".$src."
\n"; - } elseif ($row["LocationID"] == 3) { - echo ""; - echo $src."
\n"; - } - } - } - - echo "
\n"; - echo "
\n"; - echo "
\n"; - echo "
\n\n"; + } + else { + include('pkg_details.php'); # Actions Bar - # if ($SID) { include('actions_form.php'); } diff --git a/web/template/pkg_details.php b/web/template/pkg_details.php new file mode 100644 index 0000000..ffe735c --- /dev/null +++ b/web/template/pkg_details.php @@ -0,0 +1,174 @@ +".$row["Category"].""; + $edit_cat .= "  ("; + $edit_cat .= __("change category").")"; +} +else { + $edit_cat = $row['Category']; +} + +if ($row["MaintainerUID"]) { + $maintainer = username_from_id($row["MaintainerUID"]); + if ($SID) { + $maintainer = '' . $maintainer . ''; + } + +} else { + $maintainer = "None"; +} + +# In case of wanting to put a custom message +$msg = __('unknown'); +$license = empty($row['License']) ? $msg : $row['License']; + +# Print the timestamps for last updates +$updated_time = ($row["ModifiedTS"] == 0) ? "(unknown)" : gmdate("r", intval($row["ModifiedTS"])); +$submitted_time = ($row["SubmittedTS"] == 0) ? "(unknown)" : gmdate("r", intval($row["SubmittedTS"])); + +?> +
+
+
+ +

+
+ ' . $row['URL'] ?>
+ +

+ +

+
+
+ +

+ +

+ +

+ +
+ +
+

+ +

+".__("Tarball")." :: ".__("Files")." :: PKGBUILD"; + } + elseif ($row['LocationID'] == 3) { + echo "CVS"; + } + + if ($row["OutOfDate"] == 1) { + echo "
".__("This package has been flagged out of date.").""; + } +?> +

+ 0 || count($requiredby) > 0) { + echo '

'; + } + + if (count($deps) > 0) { + + echo "". __("Dependencies").""; + + while (list($k, $darr) = each($deps)) { + $url = " ".$darr[1].$darr[3].""; + else echo " ".$darr[1].$darr[3].""; + } + + if (count($requiredby) > 0) { + echo '
'; + } + } + + if (count($requiredby) > 0) { + + echo "". __("Required by").""; + + while (list($k, $darr) = each($requiredby)) { + $url = " " . $darr[1] . $darr[3] . ""; + } + else { + print "".$darr[1].$darr[3].""; + } + } + + } + + if (count($deps) > 0 || count($requiredby) > 0) { + echo '

'; + } + + + # $sources[0] = 'src'; + $sources = package_sources($row["ID"]); + + if (count($sources) > 0) { + +?> +
+
+".$src."
\n"; + } + else + { + # It is presumably an internal source + if ($row["LocationID"] == 2) { + echo "".$src."
\n"; + } elseif ($row["LocationID"] == 3) { + echo ""; + echo $src."
\n"; + } + } + } +?> +
+ + +
+
-- cgit v1.2.3-70-g09d2