Fix #475 -- add to existing quota / add new quota from product form (#562)

* 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:
Clint
2017-07-26 04:41:23 -07:00
committed by Raphael Michel
parent f3b616e495
commit 4293ec3805
4 changed files with 143 additions and 0 deletions

View 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();
}
);
});