summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
Diffstat (limited to 'web')
-rw-r--r--web/html/index.php6
-rw-r--r--web/template/pkg_details.php34
2 files changed, 23 insertions, 17 deletions
diff --git a/web/html/index.php b/web/html/index.php
index be6c98d3..ccc94d23 100644
--- a/web/html/index.php
+++ b/web/html/index.php
@@ -25,6 +25,12 @@ if (!empty($tokens[1]) && '/' . $tokens[1] == get_pkg_route()) {
/* TODO: Remove support for legacy URIs and move these
* actions to separate modules. */
switch ($tokens[3]) {
+ case "adopt":
+ $_POST['do_Adopt'] = __('Adopt');
+ break;
+ case "disown":
+ $_POST['do_Disown'] = __('Disown');
+ break;
case "vote":
$_POST['do_Vote'] = __('Vote');
break;
diff --git a/web/template/pkg_details.php b/web/template/pkg_details.php
index 0484924f..bc20a220 100644
--- a/web/template/pkg_details.php
+++ b/web/template/pkg_details.php
@@ -89,24 +89,24 @@ $sources = package_sources($row["ID"]);
<li><a href="<?= get_pkg_uri($row['Name']) . 'merge/'; ?>"><?= __('Merge Package'); ?></a></li>
<?php endif; ?>
<?php endif; ?>
+
+ <?php if ($uid && $row["MaintainerUID"] === NULL): ?>
+ <li>
+ <form action="<?= get_pkg_uri($row['Name']) . 'adopt/'; ?>" method="post">
+ <input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
+ <input type="submit" class="button text-button" name="do_Adopt" value="<?= __('Adopt Package') ?>" />
+ </form>
+ </li>
+ <?php elseif ($uid && $uid == $row["MaintainerUID"] ||
+ $atype == "Trusted User" || $atype == "Developer"): ?>
+ <li>
+ <form action="<?= get_pkg_uri($row['Name']) . 'disown/'; ?>" method="post">
+ <input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
+ <input type="submit" class="button text-button" name="do_Disown" value="<?= __('Disown Package') ?>" />
+ </form>
+ </li>
+ <?php endif; ?>
</ul>
- <?php if ($uid): ?>
- <form action="<?= htmlspecialchars(get_pkg_uri($row['Name']), ENT_QUOTES); ?>" method="post">
- <div>
- <input type="hidden" name="IDs[<?= $row['ID'] ?>]" value="1" />
- <input type="hidden" name="ID" value="<?= $row['ID'] ?>" />
- <input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
- </div>
- <p>
- <?php if ($row["MaintainerUID"] === NULL): ?>
- <input type="submit" class="button" name="do_Adopt" value="<?= __("Adopt Package") ?>" />
- <?php elseif ($uid == $row["MaintainerUID"] ||
- $atype == "Trusted User" || $atype == "Developer"): ?>
- <input type="submit" class="button" name="do_Disown" value="<?= __("Disown Package") ?>" />
- <?php endif; ?>
- </p>
- </form>
- <?php endif; ?>
</div>
</div>