diff --git a/ogcp/forms/action_forms.py b/ogcp/forms/action_forms.py index cbdaaaa..c803b02 100644 --- a/ogcp/forms/action_forms.py +++ b/ogcp/forms/action_forms.py @@ -129,6 +129,7 @@ class ClientDetailsForm(FlaskForm): ('eth2', 'eth2')]) repo = SelectField(label=_l('Repository')) room = SelectField(label=_l('Room')) + folder_id = HiddenField() boot = SelectField(label=_l('Boot Mode')) submit = SubmitField(label=_l('Submit')) diff --git a/ogcp/static/js/ogcp.js b/ogcp/static/js/ogcp.js index 964e68d..ccd8a1e 100644 --- a/ogcp/static/js/ogcp.js +++ b/ogcp/static/js/ogcp.js @@ -374,6 +374,14 @@ function checkRepoServer() { }); } +function checkFolderParent() { + const folder = $('input:checkbox[form|="scopesForm"][name="folder"]') + folder.on('change', function() { + const folder_parent = $('#' + $.escapeSelector(this.dataset.parentInput)); + folder_parent.prop('checked', true); + }); +} + function limitCheckboxes() { const checkboxes = $('input:checkbox[form|="scopesForm"]'); diff --git a/ogcp/templates/macros.html b/ogcp/templates/macros.html index e78cb5b..a00556f 100644 --- a/ogcp/templates/macros.html +++ b/ogcp/templates/macros.html @@ -17,6 +17,7 @@ checkParentsCheckboxes(); {% elif selection_mode == 'scopes' %} limitCheckboxes(); + checkFolderParent(); {% endif %} } }); @@ -27,14 +28,15 @@ {% macro scopes_tree_collapse_level(scopes, parent_room, parent_id, state, selection_mode) -%} {% for scope in scopes %}