Add letter class row to settings page, visible to platform admin

Added a new row to the settings table, 'Post class', which shows the
default letter class of a service and is only visible to Platform Admin.

Also added a new page to enable Platform Admin users to change the
default letter class for a service - this only has two options at the
moment, 1st class only and 2nd class only.
This commit is contained in:
Katie Smith
2018-09-18 08:59:23 +01:00
parent 023d564008
commit de9759b99a
9 changed files with 117 additions and 0 deletions

View File

@@ -235,6 +235,21 @@
)}}
{% endcall %}
{% if current_user.platform_admin %}
{% call row() %}
{{ text_field('Post class') }}
{% set letter_class = {'first': '1st class only', 'second': '2nd class only'} %}
{{ text_field(letter_class[current_service.letter_class]) }}
{{ edit_field(
'Change',
url_for('.service_set_letter_class',
service_id=current_service.id),
permissions=['manage_service']
)
}}
{% endcall %}
{% endif %}
{% endcall %}
</div>

View File

@@ -0,0 +1,36 @@
{% extends "withnav_template.html" %}
{% from "components/radios.html" import radios %}
{% from "components/page-footer.html" import page_footer %}
{% block service_page_title %}
Postage classes
{% endblock %}
{% block maincolumn_content %}
<div class="grid-row">
<div class="column-five-sixths">
<h1 class="heading-large">Postage classes</h1>
<p>
Letters sent before 5:30pm will be printed and despatched the following business day.
</p>
<p>
1st class letters will be delivered the day after they are despatched (Monday to Saturday).
2nd class letters will be delivered 2 days after they are despatched.
</p>
<p>
See <a href="{{ url_for(".pricing", _anchor="letters") }}">pricing</a> for the list
of rates.
</p>
<form method="post">
{{ radios(form.letter_class) }}
{{ page_footer(
'Save',
back_link=url_for('.service_settings', service_id=current_service.id),
back_link_text='Back to settings'
) }}
</form>
</div>
</div>
{% endblock %}