add new template folder

The add new templates page now has option to add template folders.
Tweaked wording of other options and h1 to clarify options since it's
not all about templates any more.

Added api client and stuff for it
This commit is contained in:
Leo Hemsted
2018-11-01 15:33:09 +00:00
committed by Alexey Bezhan
parent 37295f4b6e
commit 7cbf5de240
11 changed files with 134 additions and 10 deletions

View File

@@ -850,21 +850,22 @@ class DateFilterForm(StripWhitespaceForm):
class ChooseTemplateType(StripWhitespaceForm):
template_type = RadioField(
'What kind of template do you want to add?',
'',
validators=[
DataRequired()
]
)
def __init__(self, include_letters=False, include_copy=False, *args, **kwargs):
def __init__(self, include_letters=False, include_copy=False, include_folder=False, *args, **kwargs):
super().__init__(*args, **kwargs)
self.template_type.choices = filter(None, [
('email', 'Email'),
('sms', 'Text message'),
('letter', 'Letter') if include_letters else None,
('email', 'Email template'),
('sms', 'Text message template'),
('letter', 'Letter template') if include_letters else None,
('copy-existing', 'Copy of an existing template') if include_copy else None,
('folder', 'Folder') if include_folder else None,
])