diff options
author | Lukas Fleischer <archlinux@cryptocrack.de> | 2014-06-25 11:29:17 +0200 |
---|---|---|
committer | Lukas Fleischer <archlinux@cryptocrack.de> | 2014-06-25 11:38:02 +0200 |
commit | 91e6b5cb2f3d531ce40cd0331e2261d30766de47 (patch) | |
tree | 1b901e6000b44569123a51fd2dd2aa371d92f443 /web/html | |
parent | 959c61a77dd6a41bf82cc12b5eb873c9cfb0ffb8 (diff) | |
download | aurweb-91e6b5cb2f3d531ce40cd0331e2261d30766de47.tar.xz |
Add support for merge requests
This adds a new "Merge" category to the list of available request types
and also adds a new "Merge into" field that is hidden via JavaScript
when "Deletion" or "Orphan" is selected.
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Diffstat (limited to 'web/html')
-rw-r--r-- | web/html/pkgbase.php | 2 | ||||
-rw-r--r-- | web/html/pkgmerge.php | 5 | ||||
-rw-r--r-- | web/html/pkgreq.php | 21 |
3 files changed, 25 insertions, 3 deletions
diff --git a/web/html/pkgbase.php b/web/html/pkgbase.php index da88210..0b0f6ef 100644 --- a/web/html/pkgbase.php +++ b/web/html/pkgbase.php @@ -97,7 +97,7 @@ if (check_token()) { } elseif (current_action("do_ChangeCategory")) { list($ret, $output) = pkgbase_change_category($base_id, $atype); } elseif (current_action("do_FileRequest")) { - list($ret, $output) = pkgbase_file_request($ids, $_POST['type'], $_POST['comments']); + list($ret, $output) = pkgbase_file_request($ids, $_POST['type'], $_POST['merge_into'], $_POST['comments']); } elseif (current_action("do_CloseRequest")) { list($ret, $output) = pkgbase_close_request($_POST['reqid']); } diff --git a/web/html/pkgmerge.php b/web/html/pkgmerge.php index dbc5eac..ba3f742 100644 --- a/web/html/pkgmerge.php +++ b/web/html/pkgmerge.php @@ -39,8 +39,11 @@ if ($atype == "Trusted User" || $atype == "Developer"): ?> <input type="hidden" name="IDs[<?= $base_id ?>]" value="1" /> <input type="hidden" name="ID" value="<?= $base_id ?>" /> <input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" /> + <?php if (isset($_GET['via'])): ?> + <input type="hidden" name="via" value="<?= intval($_GET['via']) ?>" /> + <?php endif; ?> <p><label for="merge_Into" ><?= __("Merge into:") ?></label> - <input type="text" id="merge_Into" name="merge_Into" /></p> + <input type="text" id="merge_Into" name="merge_Into" value="<?= isset($_GET['into']) ? $_GET['into'] : '' ?>" /></p> <p><input type="checkbox" name="confirm_Delete" value="1" /> <?= __("Confirm package merge") ?></p> <p><input type="submit" class="button" name="do_Delete" value="<?= __("Merge") ?>" /></p> diff --git a/web/html/pkgreq.php b/web/html/pkgreq.php index 05eeb51..2b46b02 100644 --- a/web/html/pkgreq.php +++ b/web/html/pkgreq.php @@ -90,11 +90,30 @@ if (!isset($base_id)) { <input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" /> <p> <label for="id_type"><?= __("Request type") ?>:</label> - <select name="type" id="id_type"> + <select name="type" id="id_type" onchange="showHideMergeSection()"> <option value="deletion"><?= __('Deletion') ?></option> + <option value="merge"><?= __('Merge') ?></option> <option value="orphan"><?= __('Orphan') ?></option> </select> </p> + <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> + <script type="text/javascript"> + function showHideMergeSection() { + if ($('#id_type').val() == 'merge') { + $('#merge_section').show(); + } else { + $('#merge_section').hide(); + } + } + + $(document).ready(function() { + showHideMergeSection(); + }); + </script> + <p id="merge_section"> + <label for="id_merge_into"><?= __("Merge into") ?>:</label> + <input type="text" name="merge_into" id="id_merge_into" /> + </p> <p> <label for="id_comments"><?= __("Comments") ?>:</label> <textarea name="comments" id="id_comments" rows="5" cols="50"></textarea> |