mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-02 12:49:01 -04:00
Add flow for composing an alert without a template
We think that in some cases alerts will be composed in the moment, and therefore making people first create a template is: - not a good use of their time - adding some conceptual complexity which they don’t need This commit makes it possible to type some words and have them go straight into the `content` field in the database. In the future we might want to progressively enhance the radio buttons so they show on the same page (like we do with the grey buttons on the templates page).
This commit is contained in:
@@ -1293,6 +1293,21 @@ class ConfirmPasswordForm(StripWhitespaceForm):
|
||||
raise ValidationError('Invalid password')
|
||||
|
||||
|
||||
class NewBroadcastForm(StripWhitespaceForm):
|
||||
content = GovukRadiosField(
|
||||
"How to do you want to add content to the alert?",
|
||||
choices=[
|
||||
('freeform', 'Write your own message'),
|
||||
('template', 'Use a template'),
|
||||
],
|
||||
param_extensions={'fieldset': {'legend': {'classes': 'govuk-visually-hidden'}}}
|
||||
)
|
||||
|
||||
@property
|
||||
def use_template(self):
|
||||
return self.content.data == 'template'
|
||||
|
||||
|
||||
class BaseTemplateForm(StripWhitespaceForm):
|
||||
name = GovukTextInputField(
|
||||
"Template name",
|
||||
|
||||
Reference in New Issue
Block a user