mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-04-27 04:31:11 -04:00
pre-check templates/folders that were checked previously
(when rendering an error)
This commit is contained in:
@@ -1212,6 +1212,9 @@ class TemplateAndFoldersSelectionForm(Form):
|
||||
('copy-existing', 'Copy of an existing template') if allow_adding_copy_of_template else None,
|
||||
]))
|
||||
|
||||
def is_selected(self, template_folder_id):
|
||||
return template_folder_id in (self.templates_and_folders.data or [])
|
||||
|
||||
def validate(self):
|
||||
self.op = request.form.get('operation')
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
{{ unlabelled_checkbox(
|
||||
id='templates-or-folder-{}'.format(item.id),
|
||||
name='templates_and_folders',
|
||||
data=templates_and_folders_form.is_selected(item.id),
|
||||
value=item.id,
|
||||
) }}
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user