Add a page to set organisation and branding option

Platform admin only.

Adds radio buttons to choose one of:
- three hard-coded branding options
- organisations from a list provided by the API
This commit is contained in:
Chris Hill-Scott
2016-08-08 10:28:40 +01:00
committed by Leo Hemsted
parent 20c39d24b7
commit 6b5e64479a
10 changed files with 249 additions and 6 deletions

View File

@@ -338,3 +338,29 @@ class ServiceSmsSender(Form):
import re
if field.data and not re.match('^[a-zA-Z0-9\s]+$', field.data):
raise ValidationError('Sms text message sender can only contain alpha-numeric characters')
class ServiceBrandingOrg(Form):
def __init__(self, organisations=[], *args, **kwargs):
self.organisation.choices = organisations
super(ServiceBrandingOrg, self).__init__(*args, **kwargs)
branding_type = RadioField(
'Branding',
choices=[
('govuk', 'GOV.UK only'),
('both', 'GOV.UK and organisation'),
('org', 'Organisation only')
],
validators=[
DataRequired()
]
)
organisation = RadioField(
'Organisation',
validators=[
DataRequired()
]
)