Allow nested checkboxes to be collapsible

Expands the API of the macro to allow nested
checkboxes to have a summary tracking the current
selection, the fieldset to expand/collapse and
buttons to be added to allow jumping between
states.

Includes making 'Done' button inline on mobile.
Helps differentiate it form the form submit.
This commit is contained in:
Tom Byers
2019-05-07 16:08:17 +01:00
parent 20a94910cb
commit 33d074c00a
7 changed files with 210 additions and 14 deletions

View File

@@ -14,7 +14,7 @@
</fieldset>
{% if current_service.has_permission("edit_folder_permissions") and form.folder_permissions.all_template_folders %}
{{ checkboxes_nested(form.folder_permissions, form.folder_permissions.children()) }}
{{ checkboxes_nested(form.folder_permissions, form.folder_permissions.children(), hide_legend=True, collapsible_opts={ 'field': 'folder' }) }}
{% endif %}
{% if service_has_email_auth %}

View File

@@ -27,7 +27,7 @@
{{ textbox(form.name) }}
{% if current_service.has_permission("edit_folder_permissions") %}
{% if current_user.has_permissions("manage_service") and form.users_with_permission.all_service_users %}
{{ checkboxes(form.users_with_permission) }}
{{ checkboxes(form.users_with_permission, collapsible_opts={ 'field': 'team member' }) }}
{% endif %}
{% endif %}