mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
Convert adopt/disown package action link to form
* Changes adopting/disowning packages to use GET instead of POST
* Uses CSS to make form submit button look like a link
* Complements commit 3bc951e3d8
Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
This commit is contained in:
parent
77f1b264ca
commit
dbf1d474f7
2 changed files with 23 additions and 17 deletions
|
@ -25,6 +25,12 @@ if (!empty($tokens[1]) && '/' . $tokens[1] == get_pkg_route()) {
|
||||||
/* TODO: Remove support for legacy URIs and move these
|
/* TODO: Remove support for legacy URIs and move these
|
||||||
* actions to separate modules. */
|
* actions to separate modules. */
|
||||||
switch ($tokens[3]) {
|
switch ($tokens[3]) {
|
||||||
|
case "adopt":
|
||||||
|
$_POST['do_Adopt'] = __('Adopt');
|
||||||
|
break;
|
||||||
|
case "disown":
|
||||||
|
$_POST['do_Disown'] = __('Disown');
|
||||||
|
break;
|
||||||
case "vote":
|
case "vote":
|
||||||
$_POST['do_Vote'] = __('Vote');
|
$_POST['do_Vote'] = __('Vote');
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -89,24 +89,24 @@ $sources = package_sources($row["ID"]);
|
||||||
<li><a href="<?= get_pkg_uri($row['Name']) . 'merge/'; ?>"><?= __('Merge Package'); ?></a></li>
|
<li><a href="<?= get_pkg_uri($row['Name']) . 'merge/'; ?>"><?= __('Merge Package'); ?></a></li>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</ul>
|
|
||||||
<?php if ($uid): ?>
|
<?php if ($uid && $row["MaintainerUID"] === NULL): ?>
|
||||||
<form action="<?= htmlspecialchars(get_pkg_uri($row['Name']), ENT_QUOTES); ?>" method="post">
|
<li>
|
||||||
<div>
|
<form action="<?= get_pkg_uri($row['Name']) . 'adopt/'; ?>" method="post">
|
||||||
<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']) ?>" />
|
<input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
|
||||||
</div>
|
<input type="submit" class="button text-button" name="do_Adopt" value="<?= __('Adopt Package') ?>" />
|
||||||
<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>
|
</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; ?>
|
<?php endif; ?>
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue