Merge pull request #2616 from alphagov/choose_postage

Choose and display postage on template
This commit is contained in:
Pea (Malgorzata Tyczynska)
2019-01-02 15:39:15 +00:00
committed by GitHub
12 changed files with 226 additions and 24 deletions

View File

@@ -1,6 +1,7 @@
{% extends "withnav_template.html" %}
{% from "components/textbox.html" import textbox %}
{% from "components/page-footer.html" import page_footer %}
{% from "components/radios.html" import radios %}
{% from "components/form.html" import form_wrapper %}
{% block service_page_title %}
@@ -17,6 +18,9 @@
<div class="grid-row">
<div class="column-five-sixths">
{{ textbox(form.name, width='1-1', hint='Your recipients wont see this', rows=10) }}
{% if can_choose_postage %}
{{ radios(form.postage, hint='Go to Settings to change default postage for your service') }}
{% endif %}
{{ textbox(form.subject, width='1-1', highlight_tags=True, rows=2) }}
{{ textbox(form.template_content, highlight_tags=True, width='1-1', rows=8) }}
{{ page_footer(

View File

@@ -380,6 +380,11 @@
{{ 'Stop editing folders' if 'edit_folders' in current_service.permissions else 'Allow to edit folders' }}
</a>
</li>
<li class="bottom-gutter">
<a href="{{ url_for('.service_switch_can_choose_postage', service_id=current_service.id) }}" class="button">
{{ 'Stop choosing postage per template' if 'choose_postage' in current_service.permissions else 'Allow to choose postage per template' }}
</a>
</li>
{% if current_service.active %}
<li class="bottom-gutter">
<a href="{{ url_for('.archive_service', service_id=current_service.id) }}" class="button">

View File

@@ -21,6 +21,13 @@
Send
</a>
</div>
<div class="column-whole">
{% if current_service.has_permission("choose_postage") and template_postage %}
<h2 class="heading-small heading-inline">Postage</h2>: {{ template_postage }} class
{% elif (current_service.has_permission("choose_postage") and not template_postage) or not current_service.has_permission("choose_postage") %}
<h2 class="heading-small heading-inline">Postage</h2>: {{ current_service.postage }} class
{% endif %}
</div>
{% endif %}
{% else %}
{% if current_user.has_permissions('send_messages', restrict_admin_usage=True) %}