mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-16 19:30:13 -04:00
Add option to copy existing template when adding
Sometimes when setting up a service you might have a few very similar templates, in which only a small amount of content. Or you might even have a few of services, which are used by different teams but have similar templates. Copy and pasting, especially from one service to another, is a pain. This commit makes it easier by allowing users to copy an existing template when choosing to add a new one, instead of starting from scratch.
This commit is contained in:
@@ -837,14 +837,15 @@ class ChooseTemplateType(StripWhitespaceForm):
|
||||
]
|
||||
)
|
||||
|
||||
def __init__(self, include_letters=False, *args, **kwargs):
|
||||
def __init__(self, include_letters=False, include_copy=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
|
||||
('letter', 'Letter') if include_letters else None,
|
||||
('copy-existing', 'Copy of an existing template') if include_copy else None,
|
||||
])
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user