clean up info tables to not over-use safe markdown filter

the safe filter is quite dangerous - it allows HTML to be rendered as
passed through (the default action is to escape all html), so should
only be used with trusted input. Move it so we only apply it to fields
we specifically expect to have HTML in - in this case, some tables
contain links to other pages.

Also, clean up the variable names for some of these info tables, as they
didn't really make sense.
This commit is contained in:
Leo Hemsted
2022-04-11 14:38:20 +01:00
parent ebc005005b
commit c2472e55aa
5 changed files with 23 additions and 23 deletions

View File

@@ -22,16 +22,16 @@
field_headings_visible=True,
caption_visible=False
) %}
{% for message_length, charge in [
{% for message_status, description in [
('Sending', 'Notify has sent the message to the provider. The provider will try to deliver the message to the recipient for up to 72 hours. Notify is waiting for delivery information.'),
('Delivered', 'The message was successfully delivered. Notify will not tell you if a user has opened or read a message.'),
('Email address does not exist', 'The provider could not deliver the message because the email address was wrong. You should remove these email addresses from your database.'),
('Inbox not accepting messages right now', 'The provider could not deliver the message. This can happen when the recipients inbox is full or their anti-spam filter rejects your email. <a class="govuk-link govuk-link--no-visited-state" href="https://www.gov.uk/service-manual/design/sending-emails-and-text-messages#protect-your-users-from-spam-and-phishing">Check your content does not look like spam</a> before you try to send the message again.'),
('Inbox not accepting messages right now', 'The provider could not deliver the message. This can happen when the recipients inbox is full or their anti-spam filter rejects your email. <a class="govuk-link govuk-link--no-visited-state" href="https://www.gov.uk/service-manual/design/sending-emails-and-text-messages#protect-your-users-from-spam-and-phishing">Check your content does not look like spam</a> before you try to send the message again.' | safe),
('Technical failure', 'Your message was not sent because there was a problem between Notify and the provider. Youll have to try sending your messages again.'),
] %}
{% call row() %}
{{ text_field(message_length) }}
{{ text_field(charge | safe) }}
{{ text_field(message_status) }}
{{ text_field(description) }}
{% endcall %}
{% endfor %}
{% endcall %}
@@ -51,7 +51,7 @@
field_headings_visible=True,
caption_visible=False
) %}
{% for message_length, charge in [
{% for message_status, description in [
('Sending', 'Notify has sent the message to the provider. The provider will try to deliver the message to the recipient for up to 72 hours. Notify is waiting for delivery information.'),
('Sent to an international number', 'The mobile networks in some countries do not provide any more delivery information.'),
('Delivered', 'The message was successfully delivered. Notify will not tell you if a user has opened or read a message.'),
@@ -60,8 +60,8 @@
('Technical failure', 'Your message was not sent because there was a problem between Notify and the provider. Youll have to try sending your messages again. You will not be charged for text messages that are affected by a technical failure.'),
] %}
{% call row() %}
{{ text_field(message_length) }}
{{ text_field(charge) }}
{{ text_field(message_status) }}
{{ text_field(description) }}
{% endcall %}
{% endfor %}
{% endcall %}
@@ -75,7 +75,7 @@
field_headings_visible=True,
caption_visible=False
) %}
{% for message_length, charge in [
{% for message_status, description in [
('Sent', 'Notify has sent the letter to the provider to be printed.'),
('Printed', 'The provider has printed the letter. Letters are printed at 5:30pm and dispatched the next working day.'),
('Cancelled', 'Sending cancelled. Your letter will not be printed or dispatched.'),
@@ -83,8 +83,8 @@
('Permanent failure', 'The provider cannot print the letter. Your letter will not be dispatched.')
] %}
{% call row() %}
{{ text_field(message_length) }}
{{ text_field(charge) }}
{{ text_field(message_status) }}
{{ text_field(description) }}
{% endcall %}
{% endfor %}
{% endcall %}

View File

@@ -28,7 +28,7 @@
field_headings_visible=True,
caption_visible=False
) %}
{% for message_length, description in [
{% for column_heading, description in [
('day', 'The whole business day in BST'),
('provider', 'The SMS provider'),
('sms totals', 'The number of text messages sent'),
@@ -37,8 +37,8 @@
('sms cost', 'The cost of text messages sent'),
] %}
{% call row() %}
{{ text_field(message_length) }}
{{ text_field(description | safe) }}
{{ text_field(column_heading) }}
{{ text_field(description) }}
{% endcall %}
{% endfor %}
{% endcall %}

View File

@@ -28,7 +28,7 @@
field_headings_visible=True,
caption_visible=False
) %}
{% for message_length, charge in [
{% for column_heading, description in [
('day', 'The whole business day in BST.'),
('sms totals', 'The number of text messages sent'),
('sms fragments', 'The number of text message fragments sent times the rate multiplier'),
@@ -38,8 +38,8 @@
('letter sheet totals', 'The number of sheets sent')
] %}
{% call row() %}
{{ text_field(message_length) }}
{{ text_field(charge | safe) }}
{{ text_field(column_heading) }}
{{ text_field(description) }}
{% endcall %}
{% endfor %}
{% endcall %}

View File

@@ -28,16 +28,16 @@
field_headings_visible=True,
caption_visible=False
) %}
{% for message_length, charge in [
{% for column_heading, description in [
('sms cost', 'The total cost of text messages sent after a service has used its free allowance.'),
('sms chargeable units', 'The number of fragments sent after a service has used its free allowance. This number takes into account the cost multiplier for <a class="govuk-link govuk-link--no-visited-state" href="https://www.notifications.service.gov.uk/pricing#international-numbers">sending international text messages</a>.'),
('sms chargeable units', 'The number of fragments sent after a service has used its free allowance. This number takes into account the cost multiplier for <a class="govuk-link govuk-link--no-visited-state" href="https://www.notifications.service.gov.uk/pricing#international-numbers">sending international text messages</a>.' | safe),
('letter cost', 'The total cost of letters sent by a service.'),
('letter breakdown', 'The number of letters sent by a service, grouped by postage and unit cost.'),
('purchase order number, contact names, contact email addresses and billing reference', 'We add this data manually based on the information we get from services. You can help by adding it to the service settings page.'),
] %}
{% call row() %}
{{ text_field(message_length) }}
{{ text_field(charge | safe) }}
{{ text_field(column_heading) }}
{{ text_field(description) }}
{% endcall %}
{% endfor %}
{% endcall %}

View File

@@ -28,7 +28,7 @@
field_headings_visible=True,
caption_visible=False
) %}
{% for message_length, charge in [
{% for column_heading, description in [
('free allowance', 'Free allowance set for the service. This is the latest free allowance for the date range given'),
('sms notifications', 'The number of text messages sent by the service.'),
('sms chargeable units', 'The number of text message fragments times the rate multiplier sent by the service.'),
@@ -38,8 +38,8 @@
('letter sheet totals', 'The number of sheet sent by a service')
] %}
{% call row() %}
{{ text_field(message_length) }}
{{ text_field(charge | safe) }}
{{ text_field(column_heading) }}
{{ text_field(description) }}
{% endcall %}
{% endfor %}
{% endcall %}