Skip to content

Commit

Permalink
VIXTE-22 Fix visible fields for txc vs fd
Browse files Browse the repository at this point in the history
  • Loading branch information
FilipMitrovski committed Aug 9, 2024
1 parent 77e4ef9 commit 4da96d0
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions ckanext/scheming/templates/scheming/form_snippets/radio.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,42 +66,42 @@

// Customize visibility based on the selected option
if (selectedOption === 'txc_data'){
document.querySelector("#content > div.row.wrapper > div > section > div:nth-child(2)").style.display = 'none';
document.querySelector("#content > div.row.wrapper > div.primary > section.module > div.module-content > form.dataset-form > div:nth-child(3 of .form-group)").style.display = 'none';

}
if (selectedOption === 'financial_data') {
// Hide specific fields for Financial Data
document.querySelector("#content > div.row.wrapper > div > section > div:nth-child(4))").style.display = 'none';
document.querySelector("#content > div.row.wrapper > div > section > div:nth-child(6))").style.display = 'none';
document.querySelector("#content > div.row.wrapper > div > section > div.form-group.control-medium.control-select").style.display = 'none';
document.querySelector("#content > div.row.wrapper > div > section > div:nth-child(11)").style.display = 'none';
// Hide specific fields for Financial Data
document.querySelector("#content > div.row.wrapper > div.primary > section.module > div:nth-child(2 of .form-group.control-medium)").style.display = 'none';
document.querySelector("#content > div.row.wrapper > div.primary > section.module > div:nth-child(3 of .form-group.control-medium)").style.display = 'none';
document.querySelector("#content > div.row.wrapper > div.primary > section.module > div:nth-child(5 of .form-group.control-medium)").style.display = 'none';
document.querySelector("#content > div.row.wrapper > div.primary > section.module > div:nth-child(6 of .form-group.control-medium)").style.display = 'none';

}
}
else{
document.getElementById('field-type_of_dataset').disabled=true;

if (selectedOption === 'txc_data'){
document.querySelector("#content > div.row.wrapper > div > section > div:nth-child(2)").style.display = 'none'; // create a dataset
document.querySelector("#content > div.row.wrapper > div.primary > section.module > div.module-content > form.dataset-form > div:nth-child(3 of .form-group)").style.display = 'none'; // create a dataset


document.querySelector("#content > div.row.wrapper > div > section > div:nth-child(4))").style.display = 'block';
document.querySelector("#content > div.row.wrapper > div > section > div:nth-child(6))").style.display = 'block';
document.querySelector("#content > div.row.wrapper > div > section > div.form-group.control-medium.control-select").style.display = 'block';
document.querySelector("#content > div.row.wrapper > div > section > div:nth-child(11)").style.display = 'block';
document.querySelector("#content > div.row.wrapper > div.primary > section.module > div:nth-child(2 of .form-group.control-medium)").style.display = 'block';
document.querySelector("#content > div.row.wrapper > div.primary > section.module > div:nth-child(3 of .form-group.control-medium)").style.display = 'block';
document.querySelector("#content > div.row.wrapper > div.primary > section.module > div:nth-child(5 of .form-group.control-medium)").style.display = 'block';
document.querySelector("#content > div.row.wrapper > div.primary > section.module > div:nth-child(6 of .form-group.control-medium)").style.display = 'block';


}
// Customize visibility based on the selected option
if (selectedOption === 'financial_data') {
// Hide specific fields for Financial Data
document.querySelector("#content > div.row.wrapper > div > section > div:nth-child(4))").style.display = 'none';
document.querySelector("#content > div.row.wrapper > div > section > div:nth-child(6))").style.display = 'none';
document.querySelector("#content > div.row.wrapper > div > section > div.form-group.control-medium.control-select").style.display = 'none';
document.querySelector("#content > div.row.wrapper > div > section > div:nth-child(11)").style.display = 'none';
document.querySelector("#content > div.row.wrapper > div.primary > section.module > div:nth-child(2 of .form-group.control-medium)").style.display = 'none';
document.querySelector("#content > div.row.wrapper > div.primary > section.module > div:nth-child(3 of .form-group.control-medium)").style.display = 'none';
document.querySelector("#content > div.row.wrapper > div.primary > section.module > div:nth-child(5 of .form-group.control-medium)").style.display = 'none';
document.querySelector("#content > div.row.wrapper > div.primary > section.module > div:nth-child(6 of .form-group.control-medium)").style.display = 'none';


document.querySelector("#content > div.row.wrapper > div > section > div:nth-child(2)").style.display = 'block'; // create a dataset
document.querySelector("#content > div.row.wrapper > div.primary > section.module > div.module-content > form.dataset-form > div:nth-child(3 of .form-group)").style.display = 'block'; // create a dataset


}
Expand Down

0 comments on commit 4da96d0

Please sign in to comment.