Files
notifications-admin/app/templates/views/service-settings.html
T

395 lines
14 KiB
HTML
Raw Normal View History

2015-12-14 16:53:07 +00:00
{% extends "withnav_template.html" %}
{% from "components/banner.html" import banner_wrapper %}
{% from "components/table.html" import mapping_table, row, text_field, optional_text_field, edit_field, field, boolean_field with context %}
2017-02-13 10:45:15 +00:00
{% block service_page_title %}
Settings
{% endblock %}
2015-12-14 16:53:07 +00:00
{% block maincolumn_content %}
2016-04-01 10:42:23 +01:00
<h1 class="heading-large">Settings</h1>
2015-12-14 16:53:07 +00:00
2017-07-12 15:50:11 +01:00
<div class="bottom-gutter-3-2 dashboard-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) }}
{{ edit_field(
'Change',
url_for('.service_name_change', 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
{% 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'
) }}
{{ edit_field(
'Change',
url_for('.service_set_auth_type',
service_id=current_service.id),
permissions=['manage_service']
)
}}
{% endcall %}
{% if 'upload_document' in current_service.permissions %}
{% call row() %}
{{ text_field('Contact link') }}
2018-06-07 10:55:48 +01:00
{{ text_field(current_service.contact_link, truncate=true) }}
{{ edit_field(
'Change',
url_for('.service_set_contact_link',
service_id=current_service.id),
permissions=['manage_service']
)
}}
{% endcall %}
{% endif %}
2017-07-12 15:50:11 +01:00
{% endcall %}
{% call mapping_table(
caption='Email',
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) }}
{{ edit_field(
'Change',
url_for('.service_set_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
2017-06-26 15:22:06 +01:00
{% if 'email' in current_service.permissions %}
{% call row() %}
2017-09-26 16:00:13 +01:00
{{ text_field('Email reply to addresses') }}
{% call field(status='default' if default_reply_to_email_address == "Not set" else '') %}
2017-09-26 15:08:21 +01:00
{{ default_reply_to_email_address }}
{% if reply_to_email_address_count > 1 %}
<div class="hint">
{{ '…and %d more' | format(reply_to_email_address_count - 1) }}
</div>
{% endif %}
{% endcall %}
2017-09-26 16:00:13 +01:00
{{ edit_field(
'Manage' if reply_to_email_address_count else 'Change',
url_for('.service_email_reply_to',
service_id=current_service.id),
permissions=['manage_service','manage_api_keys']
)
2017-09-26 16:00:13 +01:00
}}
2017-06-26 15:22:06 +01:00
{% endcall %}
{% call row() %}
{{ text_field('Email branding') }}
{{ text_field(
'GOV.UK' if current_service.branding == 'govuk' else 'Your branding'
) }}
{{ edit_field(
'Change',
url_for('.branding_request', service_id=current_service.id),
)}}
{% endcall %}
2017-06-26 15:22:06 +01:00
{% endif %}
2017-07-12 15:50:11 +01:00
{% endcall %}
{% call mapping_table(
caption='Text messages',
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) }}
{{ edit_field(
'Change',
url_for('.service_set_sms',
service_id=current_service.id),
permissions=['manage_service']
)
}}
2017-06-26 16:22:48 +01:00
{% endcall %}
{% if 'sms' in current_service.permissions %}
{% call row() %}
{{ text_field('Text message sender') }}
2017-10-24 15:37:44 +01:00
{% call field(status='default' if default_sms_sender == "None" else '') %}
{{ default_sms_sender | string | nl2br | safe if default_sms_sender else 'None'}}
{% if sms_sender_count > 1 %}
<div class="hint">
{{ '…and %d more' | format(sms_sender_count - 1) }}
</div>
{% endif %}
{% endcall %}
{{ edit_field(
'Manage' if sms_sender_count else 'Change',
url_for('.service_sms_senders',
service_id=current_service.id),
permissions=['manage_service','manage_api_keys']
)
}}
2017-06-26 16:22:48 +01:00
{% endcall %}
2017-11-03 15:01:41 +00:00
{% call row() %}
2017-11-06 14:12:25 +00:00
{{ text_field('Text messages start with service name') }}
{{ boolean_field(prefix_sms) }}
{{ edit_field(
'Change',
url_for('.service_set_sms_prefix',
service_id=current_service.id),
permissions=['manage_service']
)
}}
2017-11-03 15:01:41 +00:00
{% endcall %}
2017-06-26 16:22:48 +01:00
{% call row() %}
{{ text_field('International text messages') }}
{{ 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']
)
}}
2017-06-26 16:22:48 +01:00
{% endcall %}
{% call row() %}
{{ 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']
)
}}
2017-06-26 16:22:48 +01:00
{% endcall %}
2017-06-20 13:24:01 +01:00
{% endif %}
2017-07-12 15:50:11 +01:00
{% endcall %}
{% call mapping_table(
caption='Letters',
field_headings=['Label', 'Value', 'Action'],
field_headings_visible=False,
caption_visible=True
) %}
2017-05-02 11:03:10 +01:00
{% call row() %}
{{ text_field('Send letters') }}
2017-06-23 13:35:08 +01:00
{{ boolean_field('letter' in current_service.permissions) }}
{{ edit_field(
'Change',
url_for('.service_set_letters',
service_id=current_service.id),
permissions=['manage_service']
)
}}
2017-05-02 11:03:10 +01:00
{% endcall %}
2017-06-23 13:35:08 +01:00
{% if 'letter' in current_service.permissions %}
2017-03-02 15:56:28 +00:00
{% call row() %}
{{ text_field('Sender addresses') }}
2017-10-05 11:23:17 +01:00
{% call field(status='default' if default_letter_contact_block == "Not set" else '') %}
{{ default_letter_contact_block | string | nl2br | safe if default_letter_contact_block else 'Not set'}}
{% if letter_contact_details_count > 1 %}
<div class="hint">
{{ '…and %d more' | format(letter_contact_details_count - 1) }}
</div>
{% endif %}
2017-03-02 15:56:28 +00:00
{% endcall %}
{{ edit_field(
'Manage' if letter_contact_details_count else 'Change',
url_for('.service_letter_contact_details',
service_id=current_service.id),
permissions=['manage_service','manage_api_keys']
)
}}
2017-03-02 15:56:28 +00:00
{% endcall %}
{% endif %}
2017-06-15 16:20:07 +01:00
{% endcall %}
2016-08-22 14:39:57 +01:00
</div>
2016-11-04 09:50:11 +00:00
{% if current_service.restricted %}
<h2 class="heading-medium">Your service is in trial mode</h2>
<ul class='list list-bullet'>
<li>you can only send messages to yourself</li>
<li>you can add people to your team, then you can send messages to them too</li>
<li>you can only send 50 messages per day</li>
</ul>
<p>
{% if current_user.has_permissions('manage_service') %}
To remove these restrictions
<a href="{{ url_for('.request_to_go_live', service_id=current_service.id) }}">request to go live</a>.
{% else %}
Your service manager can ask to have these restrictions removed.
{% endif %}
</p>
2016-11-04 10:38:37 +00:00
{% else %}
<h2 class="heading-medium">Your service is live</h2>
<p>
You can send up to
{{ "{:,}".format(current_service.message_limit) }} messages
per day.
</p>
<p>
Problems or comments?
2016-12-12 11:18:25 +00:00
<a 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 %}
{% if current_user.platform_admin %}
2016-08-22 20:22:47 +01:00
<h2 class="heading-medium">Platform admin settings</h2>
2016-08-24 09:34:14 +01:00
{% call mapping_table(
caption='Settings',
field_headings=['Label', 'Value', 'Action'],
field_headings_visible=False,
caption_visible=False
) %}
2018-02-12 09:26:13 +00:00
{% call row() %}
{{ text_field('Organisation')}}
2018-02-14 16:13:11 +00:00
{{ optional_text_field(organisation or None) }}
2018-02-12 09:26:13 +00:00
{{ edit_field('Change', url_for('.link_service_to_organisation', service_id=current_service.id)) }}
{% endcall %}
{% call row() %}
{{ text_field('Organisation type')}}
2017-10-05 11:21:00 +01:00
{{ optional_text_field(
(current_service.organisation_type or '')|title
) }}
2017-10-05 12:06:40 +01:00
{{ edit_field('Change', url_for('.set_organisation_type', service_id=current_service.id)) }}
{% endcall %}
{% call row() %}
{{ text_field('Free text message allowance')}}
{{ text_field('{:,}'.format(free_sms_fragment_limit or 0)) }}
2017-10-05 13:49:43 +01:00
{{ edit_field('Change', url_for('.set_free_sms_allowance', service_id=current_service.id)) }}
{% endcall %}
2016-08-24 09:34:14 +01:00
{% call row() %}
{{ text_field('Email branding' )}}
{% call field() %}
{% if current_service.branding == 'govuk' %}
GOV.UK
{% elif current_service.branding == 'both' %}
2018-02-07 10:30:49 +00:00
GOV.UK and {{ email_branding.name if email_branding else None }}
2016-08-24 09:34:14 +01:00
{% elif current_service.branding == 'org' %}
2018-02-07 10:30:49 +00:00
Only {{ email_branding.name if email_branding else None }}
{% elif current_service.branding == 'org_banner' %}
2018-02-07 10:30:49 +00:00
Only {{ email_branding.name if email_branding else None }} banner
2016-08-24 09:34:14 +01:00
{% endif %}
{% endcall %}
2018-02-07 10:30:49 +00:00
{{ edit_field('Change', url_for('.service_set_email_branding', service_id=current_service.id)) }}
2016-08-24 09:34:14 +01:00
{% endcall %}
{% call row() %}
{{ text_field('Letter branding')}}
{{ text_field(letter_branding) }}
{{ edit_field('Change', url_for('.set_letter_branding', service_id=current_service.id)) }}
{% endcall %}
2016-08-24 09:34:14 +01:00
{% endcall %}
<ul>
<li class="bottom-gutter">
<a href="{{ url_for('.service_switch_live', service_id=current_service.id) }}" class="button">
{{ 'Make service live' if current_service.restricted else 'Revert service to trial mode' }}
</a>
</li>
<li class="bottom-gutter">
<a href="{{ url_for('.service_switch_research_mode', service_id=current_service.id) }}" class="button">
{{ 'Take service out of research mode' if current_service.research_mode else 'Put into research mode' }}
</a>
</li>
2017-06-26 15:22:06 +01:00
<li class="bottom-gutter">
<a href="{{ url_for('.service_switch_can_send_email', service_id=current_service.id) }}" class="button">
{{ 'Stop sending emails' if 'email' in current_service.permissions else 'Allow to send emails' }}
</a>
</li>
<li class="bottom-gutter">
2017-06-26 16:22:48 +01:00
<a href="{{ url_for('.service_switch_can_send_sms', service_id=current_service.id) }}" class="button">
{{ 'Stop sending sms' if 'sms' in current_service.permissions else 'Allow to send sms' }}
</a>
</li>
2017-06-26 16:22:48 +01:00
{% if 'sms' in current_service.permissions %}
<li class="bottom-gutter">
2017-10-24 15:37:44 +01:00
{% if not can_receive_inbound %}
2017-08-10 10:29:31 +01:00
<a href="{{ url_for('.service_set_inbound_number', service_id=current_service.id, set_inbound_sms=True) }}" class="button">
Allow inbound sms
</a>
{% endif %}
2017-06-26 16:22:48 +01:00
</li>
{% endif %}
{% if 'letter' in current_service.permissions %}
<li class="bottom-gutter">
<a href="{{ url_for('.service_switch_can_send_precompiled_letter', service_id=current_service.id) }}" class="button">
{{ 'Stop sending precompiled letters' if 'precompiled_letter' in current_service.permissions else 'Allow to send precompiled letters' }}
</a>
</li>
{% endif %}
2017-10-27 11:44:40 +01:00
<li class="bottom-gutter">
<a href="{{ url_for('.service_switch_email_auth', service_id=current_service.id) }}" class="button">
{{ 'Stop user auth type editing' if 'email_auth' in current_service.permissions else 'Allow user auth type editing' }}
2017-10-27 11:44:40 +01:00
</a>
</li>
<li class="bottom-gutter">
<a href="{{ url_for('.service_switch_can_upload_document', service_id=current_service.id) }}" class="button">
{{ 'Stop uploading documents' if 'upload_document' in current_service.permissions else 'Allow to upload documents' }}
</a>
</li>
{% if current_service.active %}
<li class="bottom-gutter">
<a href="{{ url_for('.archive_service', service_id=current_service.id) }}" class="button">
2016-11-08 14:33:53 +00:00
Archive service
</a>
</li>
<li class="bottom-gutter">
<a href="{{ url_for('.suspend_service', service_id=current_service.id) }}" class="button">
Suspend service
</a>
</li>
2017-10-27 11:44:40 +01:00
{% else %}
<li class="bottom-gutter">
<a href="{{ url_for('.resume_service', service_id=current_service.id) }}" class="button">
Resume service
</a>
</li>
{% endif %}
</ul>
{% endif %}
{% endblock %}