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 %}