[aur-dev] [PATCH 4/5] pkg_details.php: Sync package actions layout with archweb

Lukas Fleischer archlinux at cryptocrack.de
Fri Nov 4 09:42:56 EDT 2011


Also, relabel the "Tarball" link to "Download tarball" and "PKGBUILD" to
"Preview PKGBUILD" to clarify that your shouldn't use the PKGBUILD to
build a package.

Signed-off-by: Lukas Fleischer <archlinux at cryptocrack.de>
---
 web/html/css/containers.css  |   34 ++++++++++++++++++++++++++++++++++
 web/template/pkg_details.php |   27 +++++++++++++++------------
 2 files changed, 49 insertions(+), 12 deletions(-)

diff --git a/web/html/css/containers.css b/web/html/css/containers.css
index 70ffd5c..977e215 100644
--- a/web/html/css/containers.css
+++ b/web/html/css/containers.css
@@ -233,3 +233,37 @@ input[type=image] {
   clear: left;
   padding-top: 1em;
 }
+
+/* Details links */
+#detailslinks {
+  float: right;
+}
+
+#detailslinks h4 {
+  color: black;
+  background: transparent;
+  font-size: 1.15em;
+  margin-top: 0;
+  margin-bottom: 0.25em;
+  padding: 0;
+}
+
+#detailslinks ul {
+  list-style: none;
+  padding: 0;
+  margin-bottom: 0;
+  font-size: 0.846em;
+}
+
+#detailslinks > div {
+  padding: 0.5em;
+  margin-bottom: 1em;
+  background: #eee;
+  border: 1px solid #bbb;
+}
+
+#actionlist .flagged {
+  color: red;
+  font-size: 0.9em;
+  font-style: italic;
+}
diff --git a/web/template/pkg_details.php b/web/template/pkg_details.php
index e117e2a..de398d8 100644
--- a/web/template/pkg_details.php
+++ b/web/template/pkg_details.php
@@ -54,7 +54,9 @@ if ($atype == "Developer" or $atype == "Trusted User") {
 
 # In case of wanting to put a custom message
 $msg = __('unknown');
+
 $license = empty($row['License']) ? $msg : $row['License'];
+$urlpath = URL_DIR . substr($row['Name'], 0, 2) . "/" . $row['Name'];
 
 # Print the timestamps for last updates
 $updated_time = ($row["ModifiedTS"] == 0) ? $msg : gmdate("r", intval($row["ModifiedTS"]));
@@ -71,6 +73,19 @@ $sources = package_sources($row["ID"]);
 	<div class="pgboxtitle"><span class="f3"><?php echo __("Package Details") . ': ' . htmlspecialchars($row['Name']) . ' ' . htmlspecialchars($row['Version']) ?></span></div>
 	<div class="pgboxbody">
 
+	<div id="detailslinks" class="listing">
+		<div id="actionlist">
+			<h4>Package Actions</h4>
+			<ul class="small">
+				<li><a href="<?php echo $urlpath ?>/PKGBUILD"><?php echo __("Preview PKGBUILD") ?></a></li>
+				<li><a href="<?php echo $urlpath . '/' . $row['Name'] ?>.tar.gz"><?php echo __("Download tarball") ?></a></li>
+				<?php if ($row["OutOfDateTS"] !== NULL): ?>
+				<li><span class="flagged"><?php echo __("Flagged out-of-date on") . ' ' . $out_of_date_time ?></span></li>
+				<?php endif; ?>
+			</ul>
+		</div>
+	</div>
+
 	<table id="pkginfo">
 		<tr>
 			<th><?php echo __('Category') . ':' ?></th>
@@ -110,18 +125,6 @@ $sources = package_sources($row["ID"]);
 		</tr>
 	</table>
 
-	<p><span class='f3'>
-<?php
-		$urlpath = URL_DIR . substr($row['Name'], 0, 2) . "/" . $row['Name'];
-		print "<a href='$urlpath/" . $row['Name'] . ".tar.gz'>".__("Tarball")."</a> :: ";
-		print "<a href='$urlpath/PKGBUILD'>".__("PKGBUILD")."</a></span>";
-
-		if ($row["OutOfDateTS"] !== NULL) {
-			echo "<br /><span class='f6'>".__("This package has been flagged out of date.")." (${out_of_date_time})</span>";
-		}
-?>
-	</p>
-
 	<div id="metadata">
 		<div id="pkgdeps" class="listing">
 			<h3><?php echo __("Dependencies") . ' (' . count($deps) . ')' ?></h3>
-- 
1.7.7.2



More information about the aur-dev mailing list