mirror of
https://github.com/pretix/pretix.git
synced 2026-05-06 15:24:02 +00:00
* added fields and logic for adding quota in creation of product * added section for selecting quota option * logic for hiding quota selections when needed * fixed logic for quota selection * formatting, removed print statements * styling * tests for adding quotas in product form * cleaned up * added divs * reworked to include translatable text, readable values for quota options * quota_add_existing form assignment to str(q.pk) * made changes for radio buttons, added in sliding animation * moved string constants for quota options, changed quota options to RadioSelect from Select
This commit is contained in:
30
src/pretix/static/pretixcontrol/js/ui/hidequota.js
Normal file
30
src/pretix/static/pretixcontrol/js/ui/hidequota.js
Normal file
@@ -0,0 +1,30 @@
|
||||
$(document).ready(function() {
|
||||
hideDeselected();
|
||||
});
|
||||
|
||||
function hideDeselected() {
|
||||
var v = $("input[name='quota_option']:checked").val();
|
||||
|
||||
if (v === "existing") {
|
||||
hideAll();
|
||||
$("#existing-quota-group").children().slideDown();
|
||||
} else if (v === "new") {
|
||||
hideAll();
|
||||
$("#new-quota-group").children().slideDown();
|
||||
} else {
|
||||
hideAll();
|
||||
}
|
||||
};
|
||||
|
||||
function hideAll() {
|
||||
$("#new-quota-group").children().slideUp();
|
||||
$("#existing-quota-group").children().slideUp();
|
||||
};
|
||||
|
||||
$(function () {
|
||||
$("input[name='quota_option']").on('change',
|
||||
function() {
|
||||
hideDeselected();
|
||||
}
|
||||
);
|
||||
});
|
||||
Reference in New Issue
Block a user