From 6d9434d968672545456f80d36b06d8f1677f4fd1 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Fri, 28 Jul 2017 14:28:25 +0100 Subject: [PATCH 1/5] Re-order page ready for new stuff --- app/main/views/index.py | 7 ++++- app/templates/views/pricing.html | 54 +++++++++++++++++++++++++------- 2 files changed, 48 insertions(+), 13 deletions(-) diff --git a/app/main/views/index.py b/app/main/views/index.py index 23f03fff6..edf032324 100644 --- a/app/main/views/index.py +++ b/app/main/views/index.py @@ -4,6 +4,7 @@ from app import convert_to_boolean from flask_login import (login_required, current_user) from notifications_utils.template import HTMLEmailTemplate +from notifications_utils.international_billing_rates import INTERNATIONAL_BILLING_RATES @main.route('/') @@ -31,7 +32,11 @@ def trial_mode(): @main.route('/pricing') def pricing(): - return render_template('views/pricing.html', sms_rate=0.0158) + return render_template( + 'views/pricing.html', + sms_rate=0.0158, + international_sms_rates=INTERNATIONAL_BILLING_RATES, + ) @main.route('/delivery-and-failure') diff --git a/app/templates/views/pricing.html b/app/templates/views/pricing.html index c5ed60611..3a5271d32 100644 --- a/app/templates/views/pricing.html +++ b/app/templates/views/pricing.html @@ -18,22 +18,47 @@

Text messages

- +

+ Text message rate: {{ '{:.2f}'.format(sms_rate * 100) }} pence + VAT +

+ +

+ Free allowance +

- We simply charge you the costs we pay to our delivery partners. - We don’t mark these costs up in any way. + All services have a free allowance of text messages, per financial year:

+ + +

+ Long messages +

+ +

+ Long messages count as 2 or 3 text messages depending on length: +

+ + + +

+ International numbers +

+ +

+ Messages to international mobile numbers are charged at 1, 2, or 3 + times the cost of messages to UK mobile numbers. +

+ +

No monthly charge or setup fee

There are no other charges for using Notify. There’s no monthly charge @@ -45,6 +70,11 @@ of Notify. We’re also covering the cost of the free emails and text messages.

+

+ We simply charge you the costs we pay to our delivery partners. We + don’t mark these costs up in any way. +

+ From a1880bdddaca6446686f93666d53c31b94ef9e70 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Fri, 28 Jul 2017 14:43:44 +0100 Subject: [PATCH 2/5] Add letter pricing table --- app/templates/views/pricing.html | 34 ++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/app/templates/views/pricing.html b/app/templates/views/pricing.html index 3a5271d32..776934527 100644 --- a/app/templates/views/pricing.html +++ b/app/templates/views/pricing.html @@ -1,3 +1,5 @@ +{% from "components/table.html" import mapping_table, row, text_field, row_heading %} + {% extends "withoutnav_template.html" %} {% block per_page_title %} @@ -58,6 +60,38 @@ times the cost of messages to UK mobile numbers.

+

+ Letters +

+

+ Letters are printed double sided in colour. Prices include + printing, paper, envelope, and postage. All letters are sent + second class post. +

+

+ The price of letters increases with the number of sheets printed: +

+ +
+ {% call mapping_table( + caption='Letter pricing', + field_headings=['', 'Central government', 'Local government'], + field_headings_visible=True, + caption_visible=False + ) %} + {% for sheets, central, local in [ + ('1 sheet', '30', '33'), + ('2 sheets', '33', '39'), + ('3 sheets', '36', '45') + ] %} + {% call row() %} + {% call row_heading() %} {{ sheets }} (double sided) {% endcall %} + {{ text_field(central + 'p + VAT') }} + {{ text_field(local + 'p + VAT') }} + {% endcall %} + {% endfor %} + {% endcall %} +

No monthly charge or setup fee

From 10b87e433b8f20de2ddd2426fae2003db2cde73b Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Fri, 28 Jul 2017 14:58:47 +0100 Subject: [PATCH 3/5] Add international pricing table --- app/main/views/index.py | 5 ++++- app/templates/views/pricing.html | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/app/main/views/index.py b/app/main/views/index.py index edf032324..c0264c62e 100644 --- a/app/main/views/index.py +++ b/app/main/views/index.py @@ -35,7 +35,10 @@ def pricing(): return render_template( 'views/pricing.html', sms_rate=0.0158, - international_sms_rates=INTERNATIONAL_BILLING_RATES, + international_sms_rates=sorted([ + (cc, country['names'], country['billable_units']) + for cc, country in INTERNATIONAL_BILLING_RATES.items() + ], key=lambda x: x[0]) ) diff --git a/app/templates/views/pricing.html b/app/templates/views/pricing.html index 776934527..9b202cc82 100644 --- a/app/templates/views/pricing.html +++ b/app/templates/views/pricing.html @@ -60,6 +60,21 @@ times the cost of messages to UK mobile numbers.

+ {% call mapping_table( + caption='Letter pricing', + field_headings=['Country code', 'Country', 'Cost multipler'], + field_headings_visible=True, + caption_visible=False + ) %} + {% for cc, names, billable_units in international_sms_rates %} + {% call row() %} + {{ text_field('+ '|safe + cc) }} + {{ text_field(names[0]) }} + {{ text_field('{} ×'.format(billable_units)|safe) }} + {% endcall %} + {% endfor %} + {% endcall %} +

Letters

From 10f81d5d161ddf5e740613c604219fea29473031 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Fri, 28 Jul 2017 15:07:08 +0100 Subject: [PATCH 4/5] Make pricing table searchable uses the same pattern as searching templates by name. --- app/main/views/index.py | 4 ++- app/templates/views/pricing.html | 45 +++++++++++++++++++++----------- 2 files changed, 33 insertions(+), 16 deletions(-) diff --git a/app/main/views/index.py b/app/main/views/index.py index c0264c62e..596527769 100644 --- a/app/main/views/index.py +++ b/app/main/views/index.py @@ -1,6 +1,7 @@ from flask import (render_template, url_for, redirect, request, abort) from app.main import main from app import convert_to_boolean +from app.main.forms import SearchTemplatesForm from flask_login import (login_required, current_user) from notifications_utils.template import HTMLEmailTemplate @@ -38,7 +39,8 @@ def pricing(): international_sms_rates=sorted([ (cc, country['names'], country['billable_units']) for cc, country in INTERNATIONAL_BILLING_RATES.items() - ], key=lambda x: x[0]) + ], key=lambda x: x[0]), + search_form=SearchTemplatesForm(), ) diff --git a/app/templates/views/pricing.html b/app/templates/views/pricing.html index 9b202cc82..90418b19b 100644 --- a/app/templates/views/pricing.html +++ b/app/templates/views/pricing.html @@ -1,4 +1,5 @@ -{% from "components/table.html" import mapping_table, row, text_field, row_heading %} +{% from "components/table.html" import mapping_table, row, text_field, field, row_heading %} +{% from "components/textbox.html" import textbox %} {% extends "withoutnav_template.html" %} @@ -60,20 +61,34 @@ times the cost of messages to UK mobile numbers.

- {% call mapping_table( - caption='Letter pricing', - field_headings=['Country code', 'Country', 'Cost multipler'], - field_headings_visible=True, - caption_visible=False - ) %} - {% for cc, names, billable_units in international_sms_rates %} - {% call row() %} - {{ text_field('+ '|safe + cc) }} - {{ text_field(names[0]) }} - {{ text_field('{} ×'.format(billable_units)|safe) }} - {% endcall %} - {% endfor %} - {% endcall %} + + +
+ {% call mapping_table( + caption='Letter pricing', + field_headings=['Country code', 'Country', 'Cost multipler'], + field_headings_visible=True, + caption_visible=False + ) %} + {% for cc, names, billable_units in international_sms_rates %} + {% call row() %} + {{ text_field('+' + cc) }} + {% call field() %} + {% for name in names %} + {{ name }}
+ {% endfor %} + {% endcall %} + {{ text_field('{} ×'.format(billable_units)|safe) }} + {% endcall %} + {% endfor %} + {% endcall %} +

Letters From f3d7eea43ebd2e8a2efd4afbabb32cd6fef4638e Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Fri, 28 Jul 2017 15:10:12 +0100 Subject: [PATCH 5/5] Hide international pricing by default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It’s really big. --- app/templates/views/pricing.html | 57 +++++++++++++++++--------------- 1 file changed, 31 insertions(+), 26 deletions(-) diff --git a/app/templates/views/pricing.html b/app/templates/views/pricing.html index 90418b19b..6c0cbdade 100644 --- a/app/templates/views/pricing.html +++ b/app/templates/views/pricing.html @@ -61,34 +61,39 @@ times the cost of messages to UK mobile numbers.

- +
+ International text message rates -
- {% call mapping_table( - caption='Letter pricing', - field_headings=['Country code', 'Country', 'Cost multipler'], - field_headings_visible=True, - caption_visible=False - ) %} - {% for cc, names, billable_units in international_sms_rates %} - {% call row() %} - {{ text_field('+' + cc) }} - {% call field() %} - {% for name in names %} - {{ name }}
- {% endfor %} + + +
+ {% call mapping_table( + caption='Letter pricing', + field_headings=['Country code', 'Country', 'Cost multipler'], + field_headings_visible=True, + caption_visible=False + ) %} + {% for cc, names, billable_units in international_sms_rates %} + {% call row() %} + {{ text_field('+' + cc) }} + {% call field() %} + {% for name in names %} + {{ name }}
+ {% endfor %} + {% endcall %} + {{ text_field('{} ×'.format(billable_units)|safe) }} {% endcall %} - {{ text_field('{} ×'.format(billable_units)|safe) }} - {% endcall %} - {% endfor %} - {% endcall %} -
+ {% endfor %} + {% endcall %} +
+ +

Letters