File tree Expand file tree Collapse file tree 5 files changed +47
-22
lines changed
scanpipe/templates/scanpipe Expand file tree Collapse file tree 5 files changed +47
-22
lines changed Original file line number Diff line number Diff line change @@ -232,7 +232,8 @@ function setupSelectCheckbox() {
232232 updateButtonAndDropdownState ( ) ;
233233
234234 // Check if all row checkboxes are checked and update the "Select All" checkbox accordingly
235- selectAllCheckbox . checked = Array . from ( rowCheckboxes ) . every ( ( cb ) => cb . checked ) ;
235+ const allRowCheckboxesChecked = Array . from ( rowCheckboxes ) . every ( ( cb ) => cb . checked ) ;
236+ selectAllCheckbox . checked = allRowCheckboxesChecked ;
236237 } ) ;
237238 } ) ;
238239
Original file line number Diff line number Diff line change 3434 </ label >
3535 </ div >
3636 {% if page_obj.paginator.num_pages > 1 %}
37- < hr >
38- < div class ="field ">
39- < label class ="checkbox " for ="{{ archive_form.select_across.id_for_label }} ">
40- < input type ="checkbox " name ="{{ archive_form.select_across.name }} " id ="{{ archive_form.select_across.id_for_label }} ">
41- Include all {{ paginator.count|intcomma }} projects
42- </ label >
43- < p class ="help "> {{ outputs_download_form.select_across.help_text }}</ p >
37+ < div class ="show-on-all-checked ">
38+ < hr >
39+ < div class ="field include-all-field ">
40+ < label class ="checkbox " for ="{{ archive_form.select_across.id_for_label }} ">
41+ < input type ="checkbox " name ="{{ archive_form.select_across.name }} " id ="{{ archive_form.select_across.id_for_label }} ">
42+ Include all {{ paginator.count|intcomma }} projects
43+ </ label >
44+ < p class ="help "> {{ outputs_download_form.select_across.help_text }}</ p >
45+ </ div >
4446 </ div >
4547 {% endif %}
4648 </ section >
Original file line number Diff line number Diff line change 1515 </ div >
1616 </ div >
1717 {% if page_obj.paginator.num_pages > 1 %}
18- < hr >
19- < div class ="field ">
20- < label class ="checkbox " for ="{{ outputs_download_form.select_across.id_for_label }} ">
21- < input type ="checkbox " name ="{{ outputs_download_form.select_across.name }} " id ="{{ outputs_download_form.select_across.id_for_label }} ">
22- Include all {{ paginator.count|intcomma }} projects
23- </ label >
24- < p class ="help "> {{ outputs_download_form.select_across.help_text }}</ p >
18+ < div class ="show-on-all-checked ">
19+ < hr >
20+ < div class ="field ">
21+ < label class ="checkbox " for ="{{ outputs_download_form.select_across.id_for_label }} ">
22+ < input type ="checkbox " name ="{{ outputs_download_form.select_across.name }} " id ="{{ outputs_download_form.select_across.id_for_label }} ">
23+ Include all {{ paginator.count|intcomma }} projects
24+ </ label >
25+ < p class ="help "> {{ outputs_download_form.select_across.help_text }}</ p >
26+ </ div >
2527 </ div >
2628 {% endif %}
2729 </ section >
Original file line number Diff line number Diff line change 1515 </ div >
1616 </ div >
1717 {% if page_obj.paginator.num_pages > 1 %}
18- < hr >
19- < div class ="field ">
20- < label class ="checkbox " for ="{{ report_form.select_across.id_for_label }} ">
21- < input type ="checkbox " name ="{{ report_form.select_across.name }} " id ="{{ report_form.select_across.id_for_label }} ">
22- Include all {{ paginator.count|intcomma }} projects
23- </ label >
24- < p class ="help "> {{ report_form.select_across.help_text }}</ p >
18+ < div class ="show-on-all-checked ">
19+ < hr >
20+ < div class ="field include-all-field ">
21+ < label class ="checkbox " for ="{{ report_form.select_across.id_for_label }} ">
22+ < input type ="checkbox " name ="{{ report_form.select_across.name }} " id ="{{ report_form.select_across.id_for_label }} ">
23+ Include all {{ paginator.count|intcomma }} projects
24+ </ label >
25+ < p class ="help "> {{ report_form.select_across.help_text }}</ p >
26+ </ div >
2527 </ div >
2628 {% endif %}
2729 </ section >
Original file line number Diff line number Diff line change 9898 }
9999 } ) ;
100100 } ) ;
101+
102+ document . addEventListener ( "openModal" , function ( event ) {
103+ // Get all elements that should be shown or hidden based on the state of the checkboxes
104+ const elementsForAllRowsChecked = getAll ( ".show-on-all-checked" ) ;
105+ const selectAllCheckbox = document . getElementById ( "select-all" ) ;
106+ const displayValue = selectAllCheckbox . checked ? "block" : "none" ;
107+
108+ // Iterate through all elements that need to be shown or hidden and apply the display style
109+ elementsForAllRowsChecked . forEach ( ( field ) => {
110+ field . style . display = displayValue ;
111+ } ) ;
112+ } ) ;
113+
101114 } ) ;
102115 </ script >
116+
117+
118+ < script >
119+
120+ </ script >
103121{% endblock %}
You can’t perform that action at this time.
0 commit comments