mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
feat(FastAPI): add /pkgbase/{name}/request (get)
This change brings in the package base request form for new submissions. Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
1cf9420997
commit
ad8369395e
4 changed files with 157 additions and 0 deletions
36
web/html/js/typeahead-pkgbase-request.js
Normal file
36
web/html/js/typeahead-pkgbase-request.js
Normal file
|
@ -0,0 +1,36 @@
|
|||
function showHideMergeSection() {
|
||||
const elem = document.getElementById('id_type');
|
||||
const merge_section = document.getElementById('merge_section');
|
||||
if (elem.value == 'merge') {
|
||||
merge_section.style.display = '';
|
||||
} else {
|
||||
merge_section.style.display = 'none';
|
||||
}
|
||||
}
|
||||
|
||||
function showHideRequestHints() {
|
||||
document.getElementById('deletion_hint').style.display = 'none';
|
||||
document.getElementById('merge_hint').style.display = 'none';
|
||||
document.getElementById('orphan_hint').style.display = 'none';
|
||||
|
||||
const elem = document.getElementById('id_type');
|
||||
document.getElementById(elem.value + '_hint').style.display = '';
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
showHideMergeSection();
|
||||
showHideRequestHints();
|
||||
|
||||
const input = document.getElementById('id_merge_into');
|
||||
const form = document.getElementById('request-form');
|
||||
const type = "suggest-pkgbase";
|
||||
|
||||
typeahead.init(type, input, form, false);
|
||||
});
|
||||
|
||||
// Bind the change event here, otherwise we have to inline javascript,
|
||||
// which angers CSP (Content Security Policy).
|
||||
document.getElementById("id_type").addEventListener("change", function() {
|
||||
showHideMergeSection();
|
||||
showHideRequestHints();
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue