Merge pull request #2692 from alphagov/self-serve-channels

Let users switch channels on and off by themselves
This commit is contained in:
Chris Hill-Scott
2019-01-30 13:46:39 +00:00
committed by GitHub
8 changed files with 186 additions and 105 deletions

View File

@@ -71,12 +71,14 @@
{{ 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']
)
}}
'Change',
url_for(
'.service_set_channel',
channel='email',
service_id=current_service.id
),
permissions=['manage_service']
)}}
{% endcall %}
{% call settings_row(if_has_permission='email') %}
@@ -121,12 +123,14 @@
{{ 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']
)
}}
'Change',
url_for(
'.service_set_channel',
service_id=current_service.id,
channel='sms'
),
permissions=['manage_service']
)}}
{% endcall %}
{% call settings_row(if_has_permission='sms') %}
@@ -197,12 +201,14 @@
{{ text_field('Send letters') }}
{{ boolean_field('letter' in current_service.permissions) }}
{{ edit_field(
'Change',
url_for('.service_set_letters',
service_id=current_service.id),
permissions=['manage_service']
)
}}
'Change',
url_for(
'.service_set_channel',
channel='letter',
service_id=current_service.id
),
permissions=['manage_service']
)}}
{% endcall %}
{% call settings_row(if_has_permission='letter') %}

View File

@@ -1,37 +1,28 @@
{% extends "withnav_template.html" %}
{% from "components/textbox.html" import textbox %}
{% from "components/form.html" import form_wrapper %}
{% from "components/page-footer.html" import page_footer %}
{% from "components/radios.html" import radios %}
{% block service_page_title %}
Emails
Send emails
{% endblock %}
{% block maincolumn_content %}
<div class="grid-row">
<div class="column-five-sixths">
<h1 class="heading-large">Emails</h1>
{% if 'email' in current_service.permissions %}
<p>
Your service can send emails.
</p>
<p>
If you want to turn it off,
<a href="{{ url_for('.support') }}">get in touch with the GOV.UK Notify team</a>.
</p>
{% else %}
<p>
Sending emails is an invitation&#8209;only feature.
</p>
<p>
If you want to try it out,
<a href="{{ url_for('.support') }}">get in touch with the GOV.UK Notify team</a>.
</p>
{% endif %}
{{ page_footer(
back_link=url_for('.service_settings', service_id=current_service.id),
back_link_text='Back to settings'
) }}
<h1 class="heading-large">Send emails</h1>
<p>
Its free to send emails through GOV.UK Notify.
</p>
{% call form_wrapper() %}
{{ radios(form.enabled) }}
{{ page_footer(
'Save',
back_link=url_for('.service_settings', service_id=current_service.id),
back_link_text='Back to settings'
) }}
{% endcall %}
</div>
</div>

View File

@@ -1,37 +1,37 @@
{% extends "withnav_template.html" %}
{% from "components/textbox.html" import textbox %}
{% from "components/form.html" import form_wrapper %}
{% from "components/page-footer.html" import page_footer %}
{% from "components/radios.html" import radios %}
{% block service_page_title %}
Text messages
Send text messages
{% endblock %}
{% block maincolumn_content %}
<div class="grid-row">
<div class="column-five-sixths">
<h1 class="heading-large">Text messages</h1>
{% if 'sms' in current_service.permissions %}
<p>
Your service can send text messages.
</p>
<p>
If you want to turn it off,
<a href="{{ url_for('.support') }}">get in touch with the GOV.UK Notify team</a>.
</p>
{% else %}
<p>
Sending text messages is an invitation&#8209;only feature.
</p>
<p>
If you want to try it out,
<a href="{{ url_for('.support') }}">get in touch with the GOV.UK Notify team</a>.
</p>
{% endif %}
{{ page_footer(
back_link=url_for('.service_settings', service_id=current_service.id),
back_link_text='Back to settings'
) }}
<h1 class="heading-large">Send text messages</h1>
<p>
You have a free allowance of
{{ '{:,}'.format(current_service.free_sms_fragment_limit) }} text messages each
financial year.
</p>
<p>
It costs 1.58 pence (plus VAT) for each text message you send
after your free allowance.
</p>
<p>
See <a href="{{ url_for(".pricing", _anchor="letters") }}">pricing</a> for more details.
</p>
{% call form_wrapper() %}
{{ radios(form.enabled) }}
{{ page_footer(
'Save',
back_link=url_for('.service_settings', service_id=current_service.id),
back_link_text='Back to settings'
) }}
{% endcall %}
</div>
</div>