summaryrefslogtreecommitdiffstats
path: root/web/template/pkg_details.php
diff options
context:
space:
mode:
authorLukas Fleischer <archlinux@cryptocrack.de>2014-04-26 14:40:07 +0200
committerLukas Fleischer <archlinux@cryptocrack.de>2014-04-26 14:48:19 +0200
commit9553790cfc9a3bcb5c4bf2266565862082c26613 (patch)
treee3511cc1a1c23269867cabbdfeecc6b5db765a9c /web/template/pkg_details.php
parent38eb8d2a3ab0b7f35618d151613211d45f6ec4d8 (diff)
downloadaurweb-9553790cfc9a3bcb5c4bf2266565862082c26613.tar.xz
Support multiple licenses per package
Split out package licenses into two separate tables in order to support multiple licenses per package. The code on the package details page is adjusted accordingly. UPGRADING contains instructions on how to convert existing licenses in the database to the new layout. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Diffstat (limited to 'web/template/pkg_details.php')
-rw-r--r--web/template/pkg_details.php17
1 files changed, 15 insertions, 2 deletions
diff --git a/web/template/pkg_details.php b/web/template/pkg_details.php
index ff3f710..7836596 100644
--- a/web/template/pkg_details.php
+++ b/web/template/pkg_details.php
@@ -22,6 +22,7 @@ $out_of_date_time = ($row["OutOfDateTS"] == 0) ? $msg : gmdate("Y-m-d", intval($
$urlpath = URL_DIR . substr($row['BaseName'], 0, 2) . "/" . $row['BaseName'];
+$lics = pkg_licenses($row["ID"]);
$grps = pkg_groups($row["ID"]);
$deps = pkg_dependencies($row["ID"]);
@@ -170,10 +171,22 @@ if ($SID && ($uid == $row["MaintainerUID"] ||
<?php endif; ?>
</td>
</tr>
+ <?php if (count($lics) > 0): ?>
<tr>
- <th><?= __('License') . ': ' ?></th>
- <td><?= htmlspecialchars($license) ?></td>
+ <th><?= __('Licenses') . ': ' ?></th>
+ <td class="wrap">
+ <?php foreach($lics as $lic): ?>
+ <span class="related">
+ <?php if ($lic !== end($lics)): ?>
+ <?= htmlspecialchars($lic) ?>,
+ <?php else: ?>
+ <?= htmlspecialchars($lic) ?>
+ <?php endif; ?>
+ </span>
+ <?php endforeach; ?>
+ </td>
</tr>
+ <?php endif; ?>
<?php if (count($grps) > 0): ?>
<tr>
<th><?= __('Groups') . ': ' ?></th>