mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-08 01:28:24 -04:00
preserve previous state on form error
the html now contains a `data-prev-state` attribute which contains the previous state, taken from the `operation` value in the form data (from the submit button). This is used to seed the `currentState` of the templateFolderForm. If not specified (or 'unknown', because the user hit enter last time round), then set it to nothingSelectedButtons.
This commit is contained in:
@@ -79,7 +79,10 @@
|
||||
{{ live_search(target_selector='#template-list .template-list-item', show=show_search_box, form=search_form) }}
|
||||
|
||||
{% if can_manage_folders %}
|
||||
{% call form_wrapper(module='template-folder-form') %}
|
||||
{% call form_wrapper(
|
||||
module='template-folder-form',
|
||||
data_kwargs={'prev-state': templates_and_folders_form.op or None}
|
||||
) %}
|
||||
{% include 'views/templates/_template_list.html' %}
|
||||
{% include 'views/templates/_move_to.html' %}
|
||||
{% endcall %}
|
||||
|
||||
Reference in New Issue
Block a user