Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VIXTE-22 Fix visible fields for txc vs fd #5

Merged
merged 1 commit into from
Aug 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading