Merge pull request #1513 from alphagov/add-letters-to-go-live

Add letters to the request to go live page
This commit is contained in:
Chris Hill-Scott
2017-10-02 10:53:08 +01:00
committed by GitHub
5 changed files with 69 additions and 44 deletions

View File

@@ -431,15 +431,9 @@ class RequestToGoLiveForm(Form):
],
validators=[DataRequired()]
)
channel = RadioField(
'What kind of messages will you be sending?',
choices=[
('emails', 'Emails'),
('text messages', 'Text messages'),
('emails and text messages', 'Both')
],
validators=[DataRequired()]
)
channel_email = BooleanField('Emails')
channel_sms = BooleanField('Text messages')
channel_letter = BooleanField('Letters')
start_date = StringField(
'When will you be ready to start sending messages?',
validators=[DataRequired(message='Cant be empty')]

View File

@@ -36,6 +36,7 @@ from app.main.forms import (
InternationalSMSForm,
)
from app import user_api_client, current_service, organisations_client, inbound_number_client
from notifications_utils.formatters import formatted_list
dummy_bearer_token = 'bearer_token_set'
@@ -168,7 +169,11 @@ def service_request_to_go_live(service_id):
current_service['name'],
url_for('main.service_dashboard', service_id=current_service['id'], _external=True),
form.mou.data,
form.channel.data,
formatted_list(filter(None, (
'email' if form.channel_email.data else None,
'text messages' if form.channel_sms.data else None,
'letters' if form.channel_letter.data else None,
)), before_each='', after_each=''),
form.start_date.data,
form.start_volume.data,
form.peak_volume.data,

View File

@@ -20,3 +20,18 @@
</label>
</div>
{% endmacro %}
{% macro checkbox_group(
legend,
fields
) %}
<fieldset class="form-group">
<legend class="form-label">
{{ legend }}
</legend>
{% for field in fields %}
{{ checkbox(field) }}
{% endfor %}
</fieldset>
{% endmacro %}

View File

@@ -1,4 +1,5 @@
{% extends "withnav_template.html" %}
{% from "components/checkbox.html" import checkbox_group %}
{% from "components/textbox.html" import textbox %}
{% from "components/radios.html" import radios %}
{% from "components/page-footer.html" import page_footer %}
@@ -38,8 +39,12 @@
'dont know': 'Well check for you',
}) }}
</div>
{{ checkbox_group('What kind of messages will you be sending?', [
form.channel_email,
form.channel_sms,
form.channel_letter
]) }}
<div class="form-group">
{{ radios(form.channel) }}
{{ textbox(form.start_date, width='1-1') }}
{{ textbox(form.start_volume, width='1-1', hint='For example, 1000 a month.') }}
{{ textbox(form.peak_volume, width='1-1', hint='For example, Messages will increase to 20,000 a month in January.') }}