2015-12-14 16:53:07 +00:00
{% extends "withnav_template.html" %}
2016-09-20 12:12:58 +01:00
{% from "components/banner.html" import banner_wrapper %}
2018-07-09 16:58:04 +01:00
{% from "components/table.html" import mapping_table, row, settings_row, text_field, optional_text_field, edit_field, field, boolean_field with context %}
2015-11-30 16:16:58 +00:00
2017-02-13 10:45:15 +00:00
{% block service_page_title %}
Settings
2015-11-30 16:16:58 +00:00
{% endblock %}
2015-12-14 16:53:07 +00:00
{% block maincolumn_content %}
2015-11-30 16:16:58 +00:00
2019-04-23 10:03:28 +01:00
< h1 class = "heading-medium" > Settings< / h1 >
2016-01-07 12:29:56 +00:00
2019-04-23 10:21:19 +01:00
< div class = "bottom-gutter-3-2 settings-table body-copy-table" >
2016-08-22 14:39:57 +01:00
{% call mapping_table(
2017-07-12 15:50:11 +01:00
caption='General',
2016-08-22 14:39:57 +01:00
field_headings=['Label', 'Value', 'Action'],
field_headings_visible=False,
caption_visible=False
) %}
2017-07-12 15:50:11 +01:00
2016-08-22 14:39:57 +01:00
{% call row() %}
2017-03-02 15:56:28 +00:00
{{ text_field('Service name') }}
2016-08-22 14:39:57 +01:00
{{ text_field(current_service.name) }}
2018-01-25 15:29:05 +00:00
{{ edit_field(
'Change',
url_for('.service_name_change', service_id=current_service.id),
2018-02-28 17:22:20 +00:00
permissions=['manage_service']
2018-01-25 15:29:05 +00:00
)
}}
2016-08-22 14:39:57 +01:00
{% endcall %}
2017-03-02 15:56:28 +00:00
2017-11-23 09:59:34 +00:00
{% call row() %}
{{ text_field('Sign-in method') }}
{{ text_field(
'Email link or text message code'
if 'email_auth' in current_service.permissions
else 'Text message code'
) }}
2018-01-25 15:29:05 +00:00
{{ edit_field(
'Change',
url_for('.service_set_auth_type',
service_id=current_service.id),
2018-02-28 17:22:20 +00:00
permissions=['manage_service']
2018-01-25 15:29:05 +00:00
)
}}
2017-11-23 09:59:34 +00:00
{% endcall %}
2017-07-12 15:50:11 +01:00
{% endcall %}
{% call mapping_table(
2019-04-23 10:03:28 +01:00
caption='Email settings',
2017-07-12 15:50:11 +01:00
field_headings=['Label', 'Value', 'Action'],
field_headings_visible=False,
caption_visible=True
) %}
2016-08-22 14:39:57 +01:00
{% call row() %}
2017-06-26 15:22:06 +01:00
{{ text_field('Send emails') }}
{{ boolean_field('email' in current_service.permissions) }}
2018-01-25 15:29:05 +00:00
{{ edit_field(
2019-01-29 14:51:31 +00:00
'Change',
url_for(
'.service_set_channel',
channel='email',
service_id=current_service.id
),
permissions=['manage_service']
)}}
2016-08-22 14:39:57 +01:00
{% endcall %}
2017-03-02 15:56:28 +00:00
2018-07-09 16:58:04 +01:00
{% call settings_row(if_has_permission='email') %}
2019-07-09 16:43:54 +01:00
{{ text_field('Reply-to email addresses') }}
2019-01-29 16:40:44 +00:00
{% call field(status='default' if current_service.count_email_reply_to_addresses == 0 else '') %}
2018-10-26 17:31:49 +01:00
{{ current_service.default_email_reply_to_address or 'Not set' }}
{% if current_service.count_email_reply_to_addresses > 1 %}
2018-07-09 16:58:04 +01:00
< div class = "hint" >
2018-10-26 17:31:49 +01:00
{{ '…and %d more' | format(current_service.count_email_reply_to_addresses - 1) }}
2018-07-09 16:58:04 +01:00
< / div >
{% endif %}
2018-05-18 14:05:48 +01:00
{% endcall %}
2018-07-09 16:58:04 +01:00
{{ edit_field(
2019-07-25 11:52:13 +01:00
'Manage',
2018-07-09 16:58:04 +01:00
url_for('.service_email_reply_to',
service_id=current_service.id),
permissions=['manage_service','manage_api_keys']
)
}}
{% endcall %}
2018-05-18 14:05:48 +01:00
2018-07-09 16:58:04 +01:00
{% call settings_row(if_has_permission='email') %}
{{ text_field('Email branding') }}
2019-09-12 13:45:35 +01:00
{{ text_field(current_service.email_branding_name) }}
2018-07-09 16:58:04 +01:00
{{ edit_field(
'Change',
2020-01-17 17:03:07 +00:00
url_for('.branding_request', service_id=current_service.id, branding_type="email"),
2018-08-06 11:25:19 +01:00
permissions=['manage_service'],
2018-07-09 16:58:04 +01:00
)}}
{% endcall %}
2017-06-26 15:22:06 +01:00
2020-02-17 15:32:19 +00:00
{% call settings_row(if_has_permission='email') %}
{{ text_field('Send files by email') }}
2020-02-25 11:27:43 +00:00
{{ text_field(current_service.contact_link if current_service.contact_link else "Not set up", truncate=true) }}
2020-02-17 15:32:19 +00:00
{{ edit_field(
2020-02-25 11:27:43 +00:00
'Manage',
url_for('.send_files_by_email_contact_details', service_id=current_service.id),
2020-02-17 15:32:19 +00:00
permissions=['manage_service'],
)}}
{% endcall %}
2017-07-12 15:50:11 +01:00
{% endcall %}
{% call mapping_table(
2019-04-23 10:03:28 +01:00
caption='Text message settings',
2017-07-12 15:50:11 +01:00
field_headings=['Label', 'Value', 'Action'],
field_headings_visible=False,
caption_visible=True
) %}
2016-08-22 14:39:57 +01:00
{% call row() %}
2017-06-26 16:22:48 +01:00
{{ text_field('Send text messages') }}
{{ boolean_field('sms' in current_service.permissions) }}
2018-01-25 15:29:05 +00:00
{{ edit_field(
2019-01-29 14:51:31 +00:00
'Change',
url_for(
'.service_set_channel',
service_id=current_service.id,
channel='sms'
),
permissions=['manage_service']
)}}
2016-08-22 14:39:57 +01:00
{% endcall %}
2017-05-02 11:03:10 +01:00
2018-07-09 16:58:04 +01:00
{% call settings_row(if_has_permission='sms') %}
2019-07-25 11:52:13 +01:00
{{ text_field('Text message senders') }}
2018-10-26 17:31:49 +01:00
{% call field(status='default' if current_service.default_sms_sender == "None" else '') %}
2020-01-22 16:13:25 +00:00
{{ current_service.default_sms_sender | nl2br if current_service.default_sms_sender else 'None'}}
2018-10-26 17:31:49 +01:00
{% if current_service.count_sms_senders > 1 %}
2018-07-09 16:58:04 +01:00
< div class = "hint" >
2018-10-26 17:31:49 +01:00
{{ '…and %d more' | format(current_service.count_sms_senders - 1) }}
2018-07-09 16:58:04 +01:00
< / div >
{% endif %}
2017-11-03 15:01:41 +00:00
{% endcall %}
2018-07-09 16:58:04 +01:00
{{ edit_field(
2019-07-25 11:52:13 +01:00
'Manage',
2018-07-09 16:58:04 +01:00
url_for('.service_sms_senders',
service_id=current_service.id),
permissions=['manage_service','manage_api_keys']
)
}}
{% endcall %}
2017-11-03 15:01:41 +00:00
2018-07-09 16:58:04 +01:00
{% call settings_row(if_has_permission='sms') %}
2019-07-22 10:13:33 +01:00
{{ text_field('Start text messages with service name') }}
2018-10-26 17:31:49 +01:00
{{ boolean_field(current_service.prefix_sms) }}
2018-07-09 16:58:04 +01:00
{{ edit_field(
'Change',
url_for('.service_set_sms_prefix',
service_id=current_service.id),
permissions=['manage_service']
)
}}
{% endcall %}
2017-06-26 16:22:48 +01:00
2018-07-09 16:58:04 +01:00
{% call settings_row(if_has_permission='sms') %}
2019-07-25 11:52:13 +01:00
{{ text_field('Send international text messages') }}
2018-07-09 16:58:04 +01:00
{{ boolean_field('international_sms' in current_service.permissions) }}
{{ edit_field(
'Change',
url_for('.service_set_international_sms',
service_id=current_service.id),
permissions=['manage_service']
)
}}
{% endcall %}
2017-06-26 16:22:48 +01:00
2018-07-09 16:58:04 +01:00
{% call settings_row(if_has_permission='sms') %}
{{ text_field('Receive text messages') }}
{{ boolean_field('inbound_sms' in current_service.permissions) }}
{{ edit_field(
'Change',
url_for('.service_set_inbound_sms',
service_id=current_service.id),
permissions=['manage_service']
)
}}
{% endcall %}
2017-06-20 13:24:01 +01:00
2017-07-12 15:50:11 +01:00
{% endcall %}
{% call mapping_table(
2019-04-23 10:03:28 +01:00
caption='Letter settings',
2017-07-12 15:50:11 +01:00
field_headings=['Label', 'Value', 'Action'],
field_headings_visible=False,
caption_visible=True
) %}
2017-05-02 11:03:10 +01:00
{% call row() %}
2017-07-12 16:02:33 +01:00
{{ text_field('Send letters') }}
2017-06-23 13:35:08 +01:00
{{ boolean_field('letter' in current_service.permissions) }}
2018-01-25 15:29:05 +00:00
{{ edit_field(
2019-01-29 14:51:31 +00:00
'Change',
url_for(
'.service_set_channel',
channel='letter',
service_id=current_service.id
),
permissions=['manage_service']
)}}
2017-05-02 11:03:10 +01:00
{% endcall %}
2018-07-09 16:58:04 +01:00
{% call settings_row(if_has_permission='letter') %}
{{ text_field('Sender addresses') }}
2019-07-05 13:17:48 +01:00
{% call field(status='' if current_service.count_letter_contact_details else 'default') %}
{% if current_service.default_letter_contact_block %}
{{ current_service.default_letter_contact_block_html }}
{% elif current_service.count_letter_contact_details %}
Blank
{% else %}
Not set
{% endif %}
2018-10-26 17:31:49 +01:00
{% if current_service.count_letter_contact_details > 1 %}
2018-07-09 16:58:04 +01:00
< div class = "hint" >
2018-10-26 17:31:49 +01:00
{{ '…and %d more' | format(current_service.count_letter_contact_details - 1) }}
2018-07-09 16:58:04 +01:00
< / div >
{% endif %}
2017-03-02 15:56:28 +00:00
{% endcall %}
2018-07-09 16:58:04 +01:00
{{ edit_field(
2019-07-25 11:52:13 +01:00
'Manage',
2018-07-09 16:58:04 +01:00
url_for('.service_letter_contact_details',
service_id=current_service.id),
permissions=['manage_service','manage_api_keys']
)
}}
{% endcall %}
2017-06-15 16:20:07 +01:00
2018-08-21 09:23:32 +01:00
{% call settings_row(if_has_permission='letter') %}
{{ text_field('Letter branding') }}
2019-02-05 17:21:09 +00:00
{{ optional_text_field(current_service.letter_branding.name) }}
2018-08-21 09:23:32 +01:00
{{ edit_field(
'Change',
2020-01-17 17:03:07 +00:00
url_for('.branding_request', service_id=current_service.id, branding_type="letter"),
2018-08-21 09:23:32 +01:00
permissions=['manage_service']
)}}
{% endcall %}
2016-08-22 11:43:35 +01:00
{% endcall %}
2016-08-22 14:39:57 +01:00
< / div >
2015-11-30 16:16:58 +00:00
2018-10-26 11:19:50 +01:00
{% if current_service.trial_mode %}
2019-07-22 11:36:40 +01:00
< h2 class = "heading-medium top-gutter-0" > Your service is in trial mode< / h2 >
2016-11-04 09:50:11 +00:00
2020-05-29 17:11:01 +01:00
< p class = "govuk-body" > You can only:< / p >
2019-11-20 11:25:36 +00:00
2016-11-04 09:50:11 +00:00
< ul class = 'list list-bullet' >
2019-11-20 11:25:36 +00:00
< li > send {{ current_service.message_limit }} text messages and emails per day< / li >
2019-11-20 11:32:42 +00:00
< li > send messages to yourself and other people in your team< / li >
2019-11-20 11:25:36 +00:00
< li > create letter templates, but not send them< / li >
2016-11-04 09:50:11 +00:00
< / ul >
2020-05-29 17:11:01 +01:00
< p class = "govuk-body" >
2018-03-01 10:30:17 +00:00
{% if current_user.has_permissions('manage_service') %}
2019-11-22 14:17:15 +00:00
To remove these restrictions, you can send us a
2019-12-06 07:53:46 +00:00
< a class = "govuk-link govuk-link--no-visited-state" href = "{{ url_for('.request_to_go_live', service_id=current_service.id) }}" > request to go live< / a > .
2018-02-22 13:13:57 +00:00
{% else %}
Your service manager can ask to have these restrictions removed.
{% endif %}
2020-05-29 17:11:01 +01:00
< / p >
2018-02-22 13:13:57 +00:00
2016-11-04 10:38:37 +00:00
{% else %}
2019-07-22 11:36:40 +01:00
< h2 class = "heading-medium top-gutter-0" > Your service is live< / h2 >
2016-11-04 10:38:37 +00:00
2020-05-29 17:11:01 +01:00
< p class = "govuk-body" >
2016-11-04 10:38:37 +00:00
You can send up to
{{ "{:,}".format(current_service.message_limit) }} messages
per day.
< / p >
2020-05-29 17:11:01 +01:00
< p class = "govuk-body" >
2016-11-04 10:38:37 +00:00
Problems or comments?
2019-12-06 07:53:46 +00:00
< a class = "govuk-link govuk-link--no-visited-state" href = "{{ url_for('main.support') }}" > Give feedback< / a > .
2016-11-04 10:38:37 +00:00
< / p >
2016-11-04 09:50:11 +00:00
{% endif %}
2018-02-27 16:45:20 +00:00
{% if current_user.platform_admin %}
2016-08-22 10:44:45 +01:00
2019-04-23 10:31:32 +01:00
< div class = "settings-table body-copy-table top-gutter-4-3" >
< h2 class = "heading-medium" > Platform admin settings< / h2 >
{% call mapping_table(
caption='Settings',
field_headings=['Label', 'Value', 'Action'],
field_headings_visible=False,
caption_visible=False
) %}
{% call row() %}
{{ text_field('Live')}}
2020-04-02 15:06:03 +01:00
{% if current_service.trial_mode and not current_service.organisation_id %}
2019-05-20 16:14:41 +01:00
{{ text_field('No (organisation must be set first)') }}
2019-04-23 10:31:32 +01:00
{{ text_field('') }}
{% else %}
{{ boolean_field(not current_service.trial_mode) }}
{{ edit_field('Change', url_for('.service_switch_live', service_id=current_service.id)) }}
{% endif %}
{% endcall %}
2019-03-25 14:46:42 +00:00
2019-04-23 10:31:32 +01:00
{% call row() %}
{{ text_field('Count in list of live services')}}
{{ text_field('Yes' if current_service.count_as_live else 'No') }}
{{ edit_field('Change', url_for('.service_switch_count_as_live', service_id=current_service.id)) }}
2018-07-17 14:39:04 +01:00
{% endcall %}
2019-02-18 16:56:43 +00:00
2019-04-23 10:31:32 +01:00
{% call row() %}
{{ text_field('Organisation')}}
2019-07-08 09:44:22 +01:00
{% call field() %}
{% if current_service.organisation_id %}
2019-12-06 07:53:46 +00:00
< a class = "govuk-link govuk-link--no-visited-state" href = "{{ url_for('main.organisation_dashboard', org_id=current_service.organisation_id) }}" >
2020-03-20 08:42:33 +00:00
{{ current_service.organisation_name }}
2019-07-08 09:44:22 +01:00
< / a >
{% else %}
< span class = "table-field-status-default" > Not set< / span >
{% endif %}
{% if current_service.organisation_type %}
< div class = "hint" >
2019-08-27 16:32:30 +01:00
{{ current_service.organisation_type_label }}
2019-07-08 09:44:22 +01:00
< / div >
{% endif %}
{% endcall %}
2019-04-23 10:31:32 +01:00
{{ edit_field('Change', url_for('.link_service_to_organisation', service_id=current_service.id)) }}
{% endcall %}
2019-07-08 09:44:22 +01:00
2019-04-23 10:31:32 +01:00
{% call row() %}
{{ text_field('Free text message allowance')}}
{{ text_field('{:,}'.format(current_service.free_sms_fragment_limit)) }}
{{ edit_field('Change', url_for('.set_free_sms_allowance', service_id=current_service.id)) }}
{% endcall %}
{% call row() %}
{{ text_field('Email branding' )}}
{{ text_field(current_service.email_branding_name) }}
{{ edit_field('Change', url_for('.service_set_email_branding', service_id=current_service.id)) }}
{% endcall %}
{% call row() %}
{{ text_field('Letter branding')}}
{{ optional_text_field(current_service.letter_branding.name) }}
{{ edit_field('Change', url_for('.service_set_letter_branding', service_id=current_service.id)) }}
{% endcall %}
{% call row() %}
{{ text_field('Data retention')}}
{% call field() %}
{{ current_service.data_retention | join(', ', attribute='notification_type') }}
2019-02-18 16:56:43 +00:00
{% endcall %}
2019-04-23 10:31:32 +01:00
{{ edit_field('Change', url_for('.data_retention', service_id=current_service.id)) }}
{% endcall %}
2019-02-18 16:56:43 +00:00
2019-04-23 10:31:32 +01:00
{% for permission in service_permissions %}
{% if not service_permissions[permission].requires or current_service.has_permission(service_permissions[permission].requires) %}
{% call row() %}
{{ text_field(service_permissions[permission].title)}}
{{ boolean_field(current_service.has_permission(permission)) }}
{{ edit_field('Change', url_for(service_permissions[permission].endpoint or '.service_set_permission', service_id=current_service.id, permission=permission if not service_permissions[permission].endpoint else None)) }}
{% endcall %}
{% endif %}
{% endfor %}
2016-08-22 10:44:45 +01:00
2019-04-23 10:31:32 +01:00
{% endcall %}
< / div >
2016-08-23 15:47:43 +01:00
2016-08-22 10:44:45 +01:00
{% endif %}
2019-05-29 16:51:25 +01:00
{% if current_service.active and (current_service.trial_mode or current_user.platform_admin) %}
< p class = "top-gutter-1-2" >
< span class = "page-footer-delete-link page-footer-delete-link-without-button" >
2020-02-10 12:13:24 +00:00
< a class = "govuk-link govuk-link--destructive" href = "{{ url_for('.archive_service', service_id=current_service.id) }}" >
2019-05-29 16:51:25 +01:00
Delete this service
< / a >
< / span >
{% if current_user.platform_admin %}
< span class = "page-footer-delete-link" >
2020-02-10 12:13:24 +00:00
< a href = "{{ url_for('.suspend_service', service_id=current_service.id) }}" class = "govuk-link govuk-link--destructive page-footer-delete-link" >
2019-05-29 16:51:25 +01:00
Suspend service
< / a >
< / span >
{% endif %}
< / p >
{% endif %}
{% if (not current_service.active) and current_user.platform_admin %}
2020-05-29 17:11:01 +01:00
< p class = "govuk-body" >
2019-05-29 16:51:25 +01:00
< div class = "hint bottom-gutter-1-2" >
Service suspended
< / div >
< span class = "page-footer-delete-link page-footer-delete-link-without-button" >
2020-02-10 12:13:24 +00:00
< a class = "govuk-link govuk-link--destructive" href = "{{ url_for('.resume_service', service_id=current_service.id) }}" >
2019-05-29 16:51:25 +01:00
Resume service
< / a >
< / span >
< / p >
{% endif %}
2015-11-30 16:16:58 +00:00
{% endblock %}
2018-07-10 10:09:17 +01:00
}