From 23f86cd6f085a397ee5c464a94a230a968a63c57 Mon Sep 17 00:00:00 2001 From: Ben Millar Date: Mon, 10 Mar 2025 22:20:33 +0000 Subject: [PATCH 1/2] LGA-3556: Stay safe when you use this website (#192) * Add online safety page * Add Welsh translation to link footer * Add unit tests --- app/main/routes.py | 7 +- app/templates/base.html | 4 + app/templates/main/online-safety.html | 70 ++++++++++ app/translations/cy/LC_MESSAGES/messages.mo | Bin 76114 -> 82962 bytes app/translations/cy/LC_MESSAGES/messages.po | 131 +++++++++++++++++++ app/translations/en/LC_MESSAGES/messages.pot | 128 ++++++++++++++++++ tests/unit_tests/test_pages.py | 16 +++ 7 files changed, 355 insertions(+), 1 deletion(-) create mode 100644 app/templates/main/online-safety.html diff --git a/app/main/routes.py b/app/main/routes.py index d57ad2f68..ab25a9f53 100644 --- a/app/main/routes.py +++ b/app/main/routes.py @@ -153,7 +153,12 @@ def cookies(): @bp.route("/privacy", methods=["GET"]) def privacy(): - return render_template("privacy.html") + return render_template("main/privacy.html") + + +@bp.route("/online-safety") +def online_safety(): + return render_template("main/online-safety.html") @bp.route("/session-expired", methods=["GET"]) diff --git a/app/templates/base.html b/app/templates/base.html index ec353198e..88e966466 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -162,6 +162,10 @@ 'href': language.switch.href, 'text': language.switch.text, 'attributes': {'x-data': 'language-switcher'}, + }, + { + 'href': url_for('main.online_safety'), + 'text': _("Staying safe online") }, { 'href': url_for('main.accessibility'), diff --git a/app/templates/main/online-safety.html b/app/templates/main/online-safety.html new file mode 100644 index 000000000..5168782f7 --- /dev/null +++ b/app/templates/main/online-safety.html @@ -0,0 +1,70 @@ +{% extends "base.html" %} +{%- from 'components/back_link.html' import govukBackLink -%} + +{% block page_title %}{{ _('Staying safe online') }} - {{ super() }}{% endblock %} + +{% block beforeContent %} + {{ super() }} + {{ govukBackLink({ 'text': _('Back') }) }} +{% endblock %} + +{% block content %} +
+
+

{{ _('Stay safe when you use this website') }}

+ +

{{ _('If you need to hide what you’re doing on this website, or protect yourself from someone, it can be safer not to use your home computer or your own mobile phone.') }}

+

{{ _('For example, use a computer at the library, or borrow a phone from someone you trust.') }}

+ + +

{{ _('What this website saves to your device') }}

+

{{ _('When you use this website, and every time you use the internet, your device saves a record of:') }}

+
    +
  • {{ _('the pages you’ve looked at and the files you’ve downloaded - this is called your ‘browsing history’') }}
  • +
  • {{ _('small files called ‘cookies’') }}
  • +
+ +

{{ _('How to delete cookies and your browsing history') }}

+

{{ _('Be careful because:') }}

+
    +
  • {{ _('deleting cookies will also delete stored passwords for online accounts') }}
  • +
  • {{ _('clearing your history could make someone more suspicious') }}
  • +
+

{{ _('Try to only remove information about the websites you want to keep private.') }}

+

{{ _('Find out how to do that on:') }}

+ + + +

{{ _('How the ‘Exit this page’ button works on this website') }}

+

+ {{ _('There is an ‘Exit this page’ button on some pages. If you click this button, all the information you’ve entered will be deleted. This website will close.')}} +

+

+ {{ _('You’ll automatically go to the BBC Weather homepage:') }} {{ _('https://www.bbc.co.uk/weather/') }} +

+ +

{{ _('Cookies and browsing history will still be saved to your device.') }}

+

{{ _('On any page where you see the ‘Exit this page’ button, pressing the ‘Shift’ key 3 times will work the same way.') }}

+

{{ _('To find this website again, search ‘Check if you can get legal aid’.') }}

+ +

{{ _('How to use this website without storing cookies and browser history') }}

+

{{ _('Use the ‘private browsing’ settings. Go to the menu on your browser, click on ‘File’ and turn on:') }}

+
    +
  • {{ _('Incognito on Google Chrome') }}
  • +
  • {{ _('Private Window on Safari') }}
  • +
  • {{ _('InPrivate on Internet Explorer') }}
  • +
  • {{ _('Private Browsing on Mozilla Firefox') }}
  • +
+

{{ _('On Samsung internet, you need to turn on') }} {{ _('Secret mode.') }}

+ +

{{ _('Get help to stay safe online') }}

+

{{ _('There are other ways someone can track you online, for example by using spying or tracking programmes. See the Refuge website') }} {{ _('Secure your tech.') }}

+
+
+{% endblock %} diff --git a/app/translations/cy/LC_MESSAGES/messages.mo b/app/translations/cy/LC_MESSAGES/messages.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KUVW?;R8XSs;a4^;nHWmfj4p+xF?v9iY+x4BT486E8v8wGl zuWc}ycogb}Yq1DFLKRnfHQV(_o{id)Wtf47FchuoCa#N`=pYQn<<%Xw>)HP%9S!K% zgZ1%@`@(xzmAF|A+x0_5I_d^bU^%{kI=(Gy+O8iICSVKV&rw_X5OtcOYMJ89Ms3*& z498;*8Y+q#s2c~>wq3`q3#v-TqgK4n9bZ5_N*mU(Ee}jaRe36^W@e)X-i?WP5%vC{ zP}}uKYZ68f55W28m`+1QW!E(+YKpnUV{tovh2QJKdbTwQhlZK!Poh%$z-{$#+w~Vw zyxUp0nb#{&8Jbexwu*5lsyGuOY&{|Q|GzY}XG3r+F2*jH9BH1HpQeKKGu1|3eoJk zj`#|8#K^{G4@aR=x&VjZ$5;a!#MrK1z1rXe;ulfJ?siOR)0i>N>?S9?oGs!fcsnn( z>gw-ool#+z7Lgw1$?4anpY5FS#66$V*L%I^tjPALoxiS%@ptxov!h-5*?*cjQ#So-m!=iPmri}FhqL*X zeA_pnbwrC6ZIcq5>)-Bb+pSA~+&a}+YkQ)PGsn5c$JzOVjRDSwpS7yw?0u|S4-E*~l%!q=Cx%m;pC*PG-o0AnRXXKDaOqROyy4t<^O5Z=_-(bf zGv?3v{^bL0yTYrizmL7WJjK`E;87kDU^_j_14Hb%sy>qnCXN`FGrqjIk-f*$tHb!o zIR)jnn%Ld#vXW-DqkKiI9pzDWBi`Or9@)a)P`Ui?G<&&Sb~xQmEYEIl53E#nqJ#Zf K`Q?swg8hF(YG6bF diff --git a/app/translations/cy/LC_MESSAGES/messages.po b/app/translations/cy/LC_MESSAGES/messages.po index e94a3240e..61fe63455 100644 --- a/app/translations/cy/LC_MESSAGES/messages.po +++ b/app/translations/cy/LC_MESSAGES/messages.po @@ -1716,6 +1716,9 @@ msgstr "Rhowch 0 os nad oes gennych eitemau gwerthfawr sy’n werth dros £500 y msgid "Exit this page" msgstr "Gadael y dudalen hon" +msgid "Staying safe online" +msgstr "Cadw’n ddiogel ar-lein" + msgid "Sorry, you’re not likely to get legal aid" msgstr "" @@ -2452,6 +2455,134 @@ msgstr "Ymestyn y terfyn amser" msgid "Exit service" msgstr "Gadael y gwasanaeth" +msgid "Stay safe when you use this website" +msgstr "Cadwch yn ddiogel wrth ddefnyddio’r wefan hon" + +msgid "" +"If you need to hide what you’re doing on this website, or protect " +"yourself from someone, it can be safer not to use your home computer or " +"your own mobile phone." +msgstr "Os oes angen i chi guddio’r hyn rydych chi’n ei wneud ar y wefan hon, neu ddiogelu eich hun rhag rhywun, gall fod yn fwy diogel peidio â defnyddio eich cyfrifiadur gartref na’ch ffôn symudol eich hun." + +msgid "" +"For example, use a computer at the library, or borrow a phone from " +"someone you trust." +msgstr "Er enghraifft, defnyddiwch gyfrifiadur yn y llyfrgell, neu fenthyg ffôn gan rywun rydych chi’n ymddiried ynddo." + +msgid "What this website saves to your device" +msgstr "Beth mae'r wefan hon yn ei gadw ar eich dyfais" + +msgid "" +"When you use this website, and every time you use the internet, your " +"device saves a record of:" +msgstr "Pan fyddwch chi’n defnyddio’r wefan hon, a phob tro y byddwch chi’n defnyddio’r rhyngrwyd, bydd eich dyfais yn cadw cofnod o’r canlynol:" + +msgid "" +"the pages you’ve looked at and the files you’ve downloaded - this is " +"called your ‘browsing history’" +msgstr "y tudalennau rydych chi wedi edrych arnyn nhw a'r ffeiliau rydych chi wedi'u llwytho i lawr – gelwir hyn yn 'hanes pori'" + +msgid "small files called ‘cookies’" +msgstr "ffeiliau bach o’r enw ‘cwcis’" + +msgid "How to delete cookies and your browsing history" +msgstr "Sut mae dileu cwcis a'ch hanes pori" + +msgid "Be careful because:" +msgstr "Byddwch yn ofalus oherwydd:" + +msgid "deleting cookies will also delete stored passwords for online accounts" +msgstr "bydd dileu cwcis hefyd yn dileu cyfrineiriau sydd wedi’u storio ar gyfer cyfrifon ar-lein" + +msgid "clearing your history could make someone more suspicious" +msgstr "gallai clirio eich hanes wneud rhywun yn fwy amheus" + +msgid "" +"Try to only remove information about the websites you want to keep " +"private." +msgstr "Ceisiwch ddileu’r wybodaeth am y gwefannau rydych chi am eu cadw'n breifat yn unig." + +msgid "Find out how to do that on:" +msgstr "Dysgwch sut mae gwneud hynny ar:" + +msgid "Google Chrome" +msgstr "" + +msgid "Internet Explorer" +msgstr "" + +msgid "Mozilla Firefox" +msgstr "" + +msgid "Safari" +msgstr "" + +msgid "Samsung internet" +msgstr "" + +msgid "How the ‘Exit this page’ button works on this website" +msgstr "Sut mae’r botwm ‘Gadael y dudalen hon’ yn gweithio ar y wefan hon" + +msgid "" +"There is an ‘Exit this page’ button on some pages. If you click this " +"button, all the information you’ve entered will be deleted. This website " +"will close." +msgstr "Mae botwm ‘Gadael y dudalen hon’ ar rai tudalennau. Os byddwch chi’n clicio’r botwm hwn, bydd yr holl wybodaeth rydych chi wedi’i rhoi yn cael ei dileu. Bydd y wefan hon yn cau." + +msgid "You’ll automatically go to the BBC Weather homepage:" +msgstr "Byddwch yn mynd yn awtomatig i dudalen hafan BBC Weather:" + +msgid "https://www.bbc.co.uk/weather/" +msgstr "" + +msgid "Cookies and browsing history will still be saved to your device." +msgstr "Bydd y cwcis a’r hanes pori yn dal i gael eu cadw ar eich dyfais." + +msgid "" +"On any page where you see the ‘Exit this page’ button, pressing the " +"‘Shift’ key 3 times will work the same way." +msgstr "Ar unrhyw dudalen lle gwelwch y botwm ‘Gadael y dudalen hon’, bydd pwyso’r fysell ‘Shift’ 3 gwaith yn gwneud yr un peth." + +msgid "To find this website again, search ‘Check if you can get legal aid’." +msgstr "I ddod o hyd i’r wefan hon eto, chwiliwch am ‘Gwirio a ydych yn gymwys i gael cymorth cyfreithiol’." + +msgid "How to use this website without storing cookies and browser history" +msgstr "Sut mae defnyddio'r wefan hon heb storio cwcis a hanes pori" + +msgid "" +"Use the ‘private browsing’ settings. Go to the menu on your browser, " +"click on ‘File’ and turn on:" +msgstr "Defnyddiwch y gosodiadau ‘pori’n breifat’. Ewch i’r ddewislen ar eich porwr, cliciwch ‘Ffeil’ a rhoi’r canlynol ar waith:" + +msgid "Incognito on Google Chrome" +msgstr "Incognito ar Google Chrome" + +msgid "Private Window on Safari" +msgstr "Private Window ar Safari" + +msgid "InPrivate on Internet Explorer" +msgstr "InPrivate ar Internet Explorer" + +msgid "Private Browsing on Mozilla Firefox" +msgstr "Private Browsing ar Mozilla Firefox" + +msgid "On Samsung internet, you need to turn on" +msgstr "Ar Samsung Internet, mae angen i chi roi" + +msgid "Secret mode." +msgstr "Secret mode ar waith." + +msgid "Get help to stay safe online" +msgstr "Cael help i gadw’n ddiogel ar-lein" + +msgid "" +"There are other ways someone can track you online, for example by using " +"spying or tracking programmes. See the Refuge website" +msgstr "Mae ffyrdd eraill y gall rhywun eich tracio ar-lein, er enghraifft drwy ddefnyddio rhaglenni tracio neu ysbïo. Ewch i’r dudalen" + +msgid "Secure your tech." +msgstr "Secure your tech ar wefan Refuge." + msgid "Privacy notice" msgstr "Welsh Privacy notice" diff --git a/app/translations/en/LC_MESSAGES/messages.pot b/app/translations/en/LC_MESSAGES/messages.pot index bc4bc046b..3f0d8af67 100644 --- a/app/translations/en/LC_MESSAGES/messages.pot +++ b/app/translations/en/LC_MESSAGES/messages.pot @@ -2153,6 +2153,134 @@ msgstr "" msgid "Exit service" msgstr "" +msgid "Stay safe when you use this website" +msgstr "" + +msgid "" +"If you need to hide what you’re doing on this website, or protect " +"yourself from someone, it can be safer not to use your home computer or " +"your own mobile phone." +msgstr "" + +msgid "" +"For example, use a computer at the library, or borrow a phone from " +"someone you trust." +msgstr "" + +msgid "What this website saves to your device" +msgstr "" + +msgid "" +"When you use this website, and every time you use the internet, your " +"device saves a record of:" +msgstr "" + +msgid "" +"the pages you’ve looked at and the files you’ve downloaded - this is " +"called your ‘browsing history’" +msgstr "" + +msgid "small files called ‘cookies’" +msgstr "" + +msgid "How to delete cookies and your browsing history" +msgstr "" + +msgid "Be careful because:" +msgstr "" + +msgid "deleting cookies will also delete stored passwords for online accounts" +msgstr "" + +msgid "clearing your history could make someone more suspicious" +msgstr "" + +msgid "" +"Try to only remove information about the websites you want to keep " +"private." +msgstr "" + +msgid "Find out how to do that on:" +msgstr "" + +msgid "Google Chrome" +msgstr "" + +msgid "Internet Explorer" +msgstr "" + +msgid "Mozilla Firefox" +msgstr "" + +msgid "Safari" +msgstr "" + +msgid "Samsung internet" +msgstr "" + +msgid "How the ‘Exit this page’ button works on this website" +msgstr "" + +msgid "" +"There is an ‘Exit this page’ button on some pages. If you click this " +"button, all the information you’ve entered will be deleted. This website " +"will close." +msgstr "" + +msgid "You’ll automatically go to the BBC Weather homepage:" +msgstr "" + +msgid "https://www.bbc.co.uk/weather/" +msgstr "" + +msgid "Cookies and browsing history will still be saved to your device." +msgstr "" + +msgid "" +"On any page where you see the ‘Exit this page’ button, pressing the " +"‘Shift’ key 3 times will work the same way." +msgstr "" + +msgid "To find this website again, search ‘Check if you can get legal aid’." +msgstr "" + +msgid "How to use this website without storing cookies and browser history" +msgstr "" + +msgid "" +"Use the ‘private browsing’ settings. Go to the menu on your browser, " +"click on ‘File’ and turn on:" +msgstr "" + +msgid "Incognito on Google Chrome" +msgstr "" + +msgid "Private Window on Safari" +msgstr "" + +msgid "InPrivate on Internet Explorer" +msgstr "" + +msgid "Private Browsing on Mozilla Firefox" +msgstr "" + +msgid "On Samsung internet, you need to turn on" +msgstr "" + +msgid "Secret mode." +msgstr "" + +msgid "Get help to stay safe online" +msgstr "" + +msgid "" +"There are other ways someone can track you online, for example by using " +"spying or tracking programmes. See the Refuge website" +msgstr "" + +msgid "Secure your tech." +msgstr "" + msgid "Privacy notice" msgstr "" diff --git a/tests/unit_tests/test_pages.py b/tests/unit_tests/test_pages.py index db122f8c9..09b23ba27 100644 --- a/tests/unit_tests/test_pages.py +++ b/tests/unit_tests/test_pages.py @@ -1,3 +1,5 @@ +from unittest.mock import patch + import pytest @@ -54,3 +56,17 @@ def test_header_link_clears_session(app, client): with client.session_transaction() as session: assert "test" not in session + + +@patch("app.main.routes.render_template") +def test_privacy_template(mock_render_template, client): + response = client.get("/privacy") + assert response.status_code == 200 + mock_render_template.assert_called_once_with("main/privacy.html") + + +@patch("app.main.routes.render_template") +def test_online_safety_template(mock_render_template, client): + response = client.get("/online-safety") + assert response.status_code == 200 + mock_render_template.assert_called_once_with("main/online-safety.html") From 5099801673e73da2219916a1f40abd80281f1f74 Mon Sep 17 00:00:00 2001 From: Ben Millar Date: Mon, 10 Mar 2025 23:16:50 +0000 Subject: [PATCH 2/2] LGA-3555: Confirmation page (#188) * Add static confirmation page * Refactor to use View * Add callback and email functionality * Update in-scope page to link to the contact page * Add category specific conditional logic * Remove duplicate list entry * Update tests for new confirmation page * Add unit tests for confirmation view * Add functional tests * Use a non-zero padded number for the day of the month * Update unit tests * Add Welsh translations * Add additional Welsh translations * Add functional test for survey link * Update tests to use a valid category code * Update tests to use a valid category code and timeslot --- app/contact/forms.py | 37 ++-- app/contact/helpers.py | 23 +++ app/contact/notify/api.py | 4 +- app/contact/urls.py | 10 +- app/contact/views.py | 44 +++- app/contact/widgets.py | 10 +- app/means_test/widgets.py | 5 +- app/static/src/scss/confirmation.scss | 27 +++ app/static/src/scss/styles.scss | 1 + app/templates/categories/in-scope.html | 7 +- app/templates/contact/confirmation.html | 174 +++++++++++++++- app/translations/cy/LC_MESSAGES/messages.mo | Bin 82962 -> 89708 bytes app/translations/cy/LC_MESSAGES/messages.po | 188 +++++++++++++++++- app/translations/en/LC_MESSAGES/messages.pot | 163 ++++++++++++++- .../discrimination/test_discrimination.py | 2 +- .../contact/test_confirmation.py | 127 ++++++++++++ .../functional_tests/contact/test_contact.py | 31 ++- tests/unit_tests/contact/test_confirmation.py | 94 +++++++++ tests/unit_tests/contact/test_contact.py | 13 +- tests/unit_tests/contact/test_notify.py | 2 +- 20 files changed, 897 insertions(+), 65 deletions(-) create mode 100644 app/contact/helpers.py create mode 100644 app/static/src/scss/confirmation.scss create mode 100644 tests/functional_tests/contact/test_confirmation.py create mode 100644 tests/unit_tests/contact/test_confirmation.py diff --git a/app/contact/forms.py b/app/contact/forms.py index 048ea6887..c256bc6cd 100644 --- a/app/contact/forms.py +++ b/app/contact/forms.py @@ -20,6 +20,7 @@ ContactRadioInput, ContactCheckboxInput, ContactSelectField, + ContactTextInput, ) from wtforms.fields import SubmitField from app.categories.widgets import CategoryCheckboxInput @@ -560,26 +561,6 @@ def get_callback_time(self) -> datetime | None: return None - @staticmethod - def format_callback_time( - start_time: datetime, callback_duration: timedelta = timedelta(minutes=30) - ) -> str | None: - """Helper function to format the callback time string. - - Returns: - str | None: formatted callback time string in the form of "Friday, 3 January at 09:00 - 09:30" - """ - if not start_time or not isinstance(start_time, datetime): - return None - end_time = start_time + callback_duration - - formatted_start_date = start_time.strftime( - "%A, %d %B at %H:%M" - ) # E.g. Monday, 1 January at 09:00 - formatted_end_time = end_time.strftime("%H:%M") # E.g. 09:30 - - return f"{formatted_start_date} - {formatted_end_time}" - def get_payload(self) -> dict: """Returns the contact payload.""" @@ -635,3 +616,19 @@ def get_payload(self) -> dict: payload["requires_action_at"] = requires_action_at return payload + + +class ConfirmationEmailForm(FlaskForm): + email = StringField( + _("Receive this confirmation by email"), + widget=ContactTextInput( + heading_class="govuk-fieldset__legend--s", + hint_text=_("We will use this to send your reference number."), + ), + validators=[ + Length(max=255, message=_("Your address must be 255 characters or less")), + Email(message=_("Enter a valid email address")), + InputRequired(message=_("Tell us what email address to send to")), + ], + ) + submit = SubmitField(_("Send"), widget=GovSubmitInput()) diff --git a/app/contact/helpers.py b/app/contact/helpers.py new file mode 100644 index 000000000..abd0513a2 --- /dev/null +++ b/app/contact/helpers.py @@ -0,0 +1,23 @@ +from datetime import datetime, timedelta +from app.contact import bp + + +@bp.app_template_filter("format_callback_time") +def format_callback_time( + start_time: datetime, callback_duration: timedelta = timedelta(minutes=30) +) -> str | None: + """Helper function to format the callback time string. + + Returns: + str | None: formatted callback time string in the form of "Friday, 3 January at 09:00 - 09:30" + """ + if not start_time or not isinstance(start_time, datetime): + return None + end_time = start_time + callback_duration + + formatted_start_date = start_time.strftime( + "%A, %-d %B at %H:%M" + ) # E.g. Monday, 1 January at 09:00 + formatted_end_time = end_time.strftime("%H:%M") # E.g. 09:30 + + return f"{formatted_start_date} - {formatted_end_time}" diff --git a/app/contact/notify/api.py b/app/contact/notify/api.py index c6c792176..c66db8975 100644 --- a/app/contact/notify/api.py +++ b/app/contact/notify/api.py @@ -5,7 +5,7 @@ from app import get_locale from app.contact.notify.templates import GOVUK_NOTIFY_TEMPLATES -from app.contact.forms import ContactUsForm +from app.contact.helpers import format_callback_time logger = logging.getLogger(__name__) @@ -92,7 +92,7 @@ def generate_confirmation_email_data( third_party_phone_number: str | None = None, ) -> (str, str): """Generates the data used in the sending of the confirmation Gov Notify emails.""" - formatted_callback_time = ContactUsForm.format_callback_time(callback_time) + formatted_callback_time = format_callback_time(callback_time) callback_requested = callback_time is not None template_id = "" diff --git a/app/contact/urls.py b/app/contact/urls.py index a661dfab2..7e54c02b3 100644 --- a/app/contact/urls.py +++ b/app/contact/urls.py @@ -1,8 +1,9 @@ from app.contact import bp from app.contact.address_finder.widgets import FormattedAddressLookup from app.contact.views import ContactUs, ReasonForContacting -from flask import render_template, jsonify +from flask import jsonify import logging +from app.contact.views import ConfirmationPage logger = logging.getLogger(__name__) @@ -13,11 +14,6 @@ ) -@bp.route("/confirmation", methods=["GET"]) -def confirmation(): - return render_template("contact/confirmation.html") - - @bp.route("/addresses/", methods=["GET"]) def geocode(postcode): """Lookup addresses with the specified postcode""" @@ -39,3 +35,5 @@ def geocode(postcode): "eligible", template="contact/eligible.html", attach_eligiblity_data=True ), ) + +bp.add_url_rule("/confirmation", view_func=ConfirmationPage.as_view("confirmation")) diff --git a/app/contact/views.py b/app/contact/views.py index 178b23b7f..cd0dd623d 100644 --- a/app/contact/views.py +++ b/app/contact/views.py @@ -1,5 +1,9 @@ from flask.views import View -from app.contact.forms import ContactUsForm, ReasonsForContactingForm +from app.contact.forms import ( + ContactUsForm, + ReasonsForContactingForm, + ConfirmationEmailForm, +) import logging from flask import session, render_template, request, redirect, url_for from app.api import cla_backend @@ -79,10 +83,12 @@ def dispatch_request(self): case_ref = session.get("case_reference") callback_time = session.get("callback_time") contact_type = session.get("contact_type") + category = session.get("category") session.clear() session["case_reference"] = case_ref session["callback_time"] = callback_time session["contact_type"] = contact_type + session["category"] = category return redirect(url_for("contact.confirmation")) return render_template(self.template, form=form, form_progress=form_progress) @@ -101,3 +107,39 @@ def _attach_rfc_to_case(case_ref: str, rfc_ref: str): "case": case_ref, }, ) + + +class ConfirmationPage(View): + template = "contact/confirmation.html" + methods = ["GET", "POST"] + + @classmethod + def get_context(cls): + return { + "case_reference": session.get("case_reference"), + "callback_time": session.get("callback_time"), + "contact_type": session.get("contact_type"), + "category": session.get("category", {}), + } + + def dispatch_request(self): + form = ConfirmationEmailForm() + context = self.get_context() + email_sent = False + + if form.validate_on_submit(): + notify.create_and_send_confirmation_email( + email_address=form.email.data, + case_reference=context["case_reference"], + callback_time=context["callback_time"], + contact_type=context["contact_type"], + ) + email_sent = True + + return render_template( + self.template, + form=form, + confirmation_email=form.email.data if email_sent else None, + email_sent=email_sent, + **context, + ) diff --git a/app/contact/widgets.py b/app/contact/widgets.py index 22098bf2d..40e3bc5fc 100644 --- a/app/contact/widgets.py +++ b/app/contact/widgets.py @@ -1,4 +1,8 @@ -from govuk_frontend_wtf.wtforms_widgets import GovRadioInput, GovCheckboxesInput +from govuk_frontend_wtf.wtforms_widgets import ( + GovRadioInput, + GovCheckboxesInput, + GovTextInput, +) from app.means_test.widgets import MeansTestInputField from wtforms import SelectField @@ -15,3 +19,7 @@ class ContactSelectField(SelectField): def pre_validate(self, form): """Override to prevent WTForms' internal choice validation""" pass + + +class ContactTextInput(MeansTestInputField, GovTextInput): + pass diff --git a/app/means_test/widgets.py b/app/means_test/widgets.py index b5b3492a1..fbee425c0 100644 --- a/app/means_test/widgets.py +++ b/app/means_test/widgets.py @@ -45,7 +45,10 @@ def map_gov_params(self, field, **kwargs): item["checked"] = True label_class = self.heading_class - params["fieldset"]["legend"]["classes"] = label_class + if "fieldset" in params: + params["fieldset"]["legend"]["classes"] = label_class + else: + params["label"]["classes"] = label_class return params diff --git a/app/static/src/scss/confirmation.scss b/app/static/src/scss/confirmation.scss new file mode 100644 index 000000000..88d4748a2 --- /dev/null +++ b/app/static/src/scss/confirmation.scss @@ -0,0 +1,27 @@ +.confirmation-inset { + background: govuk-colour("white"); + color: $govuk-text-colour; + padding: 20px; + margin: 20px 0 0; +} + +@media print { + .confirmation-actions, + .confirmation-email-form { + display: none; + } +} + +.confirmation-button-link { + cursor: pointer; + background: none; + border: none; + color: govuk-colour("white"); + text-decoration: underline; + &:hover{ + color: govuk-colour("light-grey"); + &:focus{ + color: $govuk-text-colour; + } + } +} diff --git a/app/static/src/scss/styles.scss b/app/static/src/scss/styles.scss index 42f04f3de..549f110d9 100644 --- a/app/static/src/scss/styles.scss +++ b/app/static/src/scss/styles.scss @@ -12,3 +12,4 @@ @import "./modal-dialog"; @import "./progress_bar"; @import "./back-link"; +@import "./confirmation"; diff --git a/app/templates/categories/in-scope.html b/app/templates/categories/in-scope.html index 048beb364..296574bb0 100644 --- a/app/templates/categories/in-scope.html +++ b/app/templates/categories/in-scope.html @@ -37,7 +37,10 @@

{% trans %}What you need to check if you qualify fin

{% trans %}When you do not need to complete the financial assessment{% endtrans %}

-

{% trans %}You should contact CLA without completing the financial assessment if you are:{% endtrans %}

+ {% set contact_us_link %} + contact CLA + {% endset %} +

{% trans %}You should {{ contact_us_link }} without completing the financial assessment if you are:{% endtrans %}

  • {% trans %}under 18{% endtrans %}
  • @@ -48,7 +51,7 @@

    {% trans %}If you use British Sign Language (BSL){%

    {% trans %}You can choose not to complete the financial assessment online, and instead ask for a call with a BSL interpreter.{% endtrans %}

    -

    {% trans %}Fill in the 'Contact CLA' page. Select 'BSL' under 'Communication needs'.{% endtrans %}

    +

    {% trans %}Fill in the '{{ contact_us_link }}' page. Select 'BSL' under 'Communication needs'.{% endtrans %}

    {{ govukButton(params={ "text": _("Check if you qualify financially"), diff --git a/app/templates/contact/confirmation.html b/app/templates/contact/confirmation.html index 419ff5859..5c5dee7da 100644 --- a/app/templates/contact/confirmation.html +++ b/app/templates/contact/confirmation.html @@ -1,16 +1,170 @@ {% extends "base.html" %} -{%- from 'components/back_link.html' import govukBackLink -%} -{%- from 'categories/components/list-item.html' import list_item, list_item_small -%} -{% block beforeContent%} -{{ super() }} -{{ govukBackLink() }} -{% endblock %} +{%- from 'govuk_frontend_jinja/components/panel/macro.html' import govukPanel %} +{%- from 'govuk_frontend_jinja/components/button/macro.html' import govukButton %} +{%- from 'govuk_frontend_jinja/components/warning-text/macro.html' import govukWarningText %} + +{% block pageTitle %}Confirmation - {{ super() }}{% endblock %} + +{% set panelHtml %} + Your reference number is +
    + {{ case_reference }} + {% if not callback_time %} +

    + {{ _('You can now call CLA on') }} 0345 345 4 345.
    + {% trans %}Please quote your reference number when you call. Find out about + call charges.{% endtrans %} +

    + {% endif %} +
    + + +
    +{% endset %} + {% block content %} -
    -
    -

    Confirmation Page

    +
    +
    + {% set panelTitle = _('We will call you back') if callback_time else _("Your details have been submitted") %} + + {{ govukPanel({ + "titleText":panelTitle, + "html": panelHtml + }) }} + + {% if confirmation_email and not form.errors %} +

    + {{ _('Your reference number was sent to') }} + {{ confirmation_email }}. +

    + {% else %} +
    + {{ form.csrf_token }} + {{ form.email }} + {{ form.submit }} +
    + {% endif %} + + {% if category.code in ['debt', 'housing'] %} + {{ govukWarningText({ + "text": _("If you have a court hearing date it is important that you get advice as soon as possible. You may be able to get last-minute help on the day of the hearing from an adviser in the court building.") + }) }} + {% endif %} + +

    {% trans %}What happens next?{% endtrans %}

    + + {% if callback_time %} +

    + {% if contact_type == "thirdparty" %} + {% trans %}Your details have been submitted and an operator will call + the person you nominated at least once during your chosen time, or as close to the time as possible{% endtrans %} + {% else %} + {% trans %}Your details have been submitted and an operator will call + you at least once during your chosen time, or as close to the time as possible{% endtrans %} + {% endif %} + ({{ callback_time|format_callback_time }}). + {% trans %}When a CLA operator calls, the call will come from an anonymous number.{% endtrans %} +

    + {% endif %} + + {% if category.code == 'domestic_abuse' %} +

    + {% trans %}If you need to urgently protect yourself or your family you should try and get advice as soon as possible.{% endtrans %} +

    + {% endif %} + +
      +
    • + {% if contact_type == "thirdparty" %} + {% trans %}The first person they speak to will be an operator who will ask about your problem and your financial circumstances.{% endtrans %} + {% else %} + {% trans %}The first person you speak to will be an operator who will ask about your problem and your financial circumstances.{% endtrans %} + {% endif %} +
    • +
    • + {% if contact_type == "thirdparty" %} + {% trans %}If it looks like you might qualify for legal aid they’ll + be put through to a specialist adviser, who will make the + final decision on your case.{% endtrans %} + {% else %} + {% trans %}If it looks like you might qualify for legal aid you’ll + be put through to a specialist adviser, who will make the + final decision on your case.{% endtrans %} + {% endif %} + + {% if category.code in ['domestic_abuse','family'] %} +
        + {% if category.code == 'domestic_abuse' %} +
      • + {% trans %}Please be aware that the specialist adviser will need + evidence of the domestic violence before they can make a decision + on your case.{% endtrans %} + + {{ _('Find out what you can use as evidence') }}. +
      • + {% elif category.code == 'family' %} +
      • + {% trans %}If your case involves domestic abuse or violence, + the specialist adviser will need evidence of this + before they can make a decision on your case.{% endtrans %} + + {{ _('Find out what you can use as evidence') }}. +
      • + {% endif %} +
      + {% endif %} +
    • + {% if category.code in ['domestic_abuse', 'family'] %} +
    • + {% trans %}You will also need to provide evidence of your financial + circumstances. Your specialist adviser will explain what is + needed.{% endtrans %} +
    • + {% else %} +
    • + {% trans %}You will need to provide evidence of your financial circumstances + and maybe your problem. Your specialist adviser will explain + what is needed.{% endtrans %} +
    • + {% endif %} + +
    • {% trans %}If your specialist adviser thinks you need to speak to someone in person or have someone represent you in court, they will organise this.{% endtrans %}
    • +
    + +

    + {% trans %}If CLA can’t help you, we’ll always suggest where else you might get help.{% endtrans %} +

    +

    + {% trans %}If we can do anything to make it easier for you to communicate with us, please tell the operator.{% endtrans %} +

    +

    + {% trans privacy_link=url_for('main.privacy') %} + Protecting your personal data and your privacy is important to us. Read the full + Civil Legal Advice Privacy Statement. + {% endtrans %} +

    + + {% if callback_time %} +

    {{ _('What if I miss the operator’s call?') }}

    +

    + {% trans %}If you miss the call or you need advice urgently, you can call us on + 0345 345 4 345. Find out about + call charges.{% endtrans %} +

    + {% endif %} + + {{ govukButton({ + "text": _("Finish"), + "href": "https://www.gov.uk/done/check-if-civil-legal-advice-can-help-you", + }) }} + +
    -
    + {% endblock %} \ No newline at end of file diff --git a/app/translations/cy/LC_MESSAGES/messages.mo b/app/translations/cy/LC_MESSAGES/messages.mo index 95773f26352f788257d32cbd023bf043988f2127..2140fa6e5d25b622cb658265796dcec78e1d1a3b 100644 GIT binary patch delta 17255 zcmc)Q33wDm`uOo~2!tyf;l7)2Lzr-%ArS6x$SDv&pfl5%8JNt3ISAu|BZ7h)9t1>C zkV6p^6gNs%Sya>&Wr5X2WpM>jM3lFqy6UaB zs(OZ9v%JFJe_tVSIyGsX#(xi#)3hd7r>>NK`mb6CO*>671yk|w*au~_SjFKA_d#Z}t;ae2GL)YcWjId^ii|;VUQ+=sR2`@m)BP@?$6sDMuK^ zRFt7iLrKojn2;9F=0K9;W~_=EkWOn4VH5lt%I7LDfYO83C_T!?ΝA;1bNk>LWER zg7a_ao)|^^rQ+HoKmfbpZ*dETa3bsKG<*>yyPJ_9<8U(4ChcMT z2tUIo@h@XpHE}f`%E0e%HFg{?W36dVqeS$59EejU5dWPV+&e+d?`+~$jq*rLmk*$X zZYfHH)?!=SgO%}3l#1U)=}4tXj5D@FW~gSOG~_-cEwn$P%%U2MS4$j};6N(O$1ZpW zw!-I89()ezoc5J-eaK|>x%nvBzY}jlDM$koco6T!=W*IpwNf_DRbxLLP0rtn%wR3? z5eE#L)`~cv!XQddMw8+)b^&|=FQMeb3p1FaSm6fNdHfQ$Vc(gWHV02(eH<}MJ#aQk zhgM)4d>kbrZ{Z(!zE*KIz30RcydAsIyoPuHYvTzVfFC1m&^qR+WLkz2(g#r*@;4lW zE;oBU&O;f(r%@vNAzIkLqjK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1Q#ponJ?*S+VQq7V83CFL$0* z!#6+Qkyqd-&dqVel*P|)(mP>dVL@@$#Nwu1(oMsW-Z!mNLROa;$F!`;Iq{AmIr%vg ziybkK4Cx!=m|2jWGs6*+UO08?%!0g$S;cvU1&)H8oa~~Q__Dx^;+1V>tLm1UD|ZqF8jV>i|gbom7cDbwy(22i*gHR=9h=}w?ha0 zcj)dp{QuA$C3(eMR_vHqICWZnPH|qr2r$aK2y(q~bFN*s;r1-of;;m)%8ve)Q?}*L+O9hH zV(hYQzdtNXyT8yi?a!8>QQd@uuoPF>1iLYQJFiyzGMev%$b_ym^Nchwj(=x4lA8oR=O?Zf95m!f94aZ z`8aZOCO9USOvum8ni(^LOy(5jWo47UysUzP!u$@Ed4ui#c4g2|yO~`%Y?xi&`~Lu) CfZzuJ diff --git a/app/translations/cy/LC_MESSAGES/messages.po b/app/translations/cy/LC_MESSAGES/messages.po index 61fe63455..2399b1a62 100644 --- a/app/translations/cy/LC_MESSAGES/messages.po +++ b/app/translations/cy/LC_MESSAGES/messages.po @@ -865,6 +865,18 @@ msgstr "" msgid "Submit details" msgstr "Cyflwyno manylion" +msgid "Receive this confirmation by email" +msgstr "Cael copi o’r cadarnhad hwn drwy e-bost" + +msgid "Enter a valid email address" +msgstr "Rhowch gyfeiriad e-bost dilys" + +msgid "Tell us what email address to send to" +msgstr "Dywedwch wrthym pa gyfeiriad e-bost y dylem ei ddefnyddio i anfon" + +msgid "Send" +msgstr "Anfon" + msgid "There is a problem" msgstr "Mae problem" @@ -1772,12 +1784,11 @@ msgstr "" msgid "When you do not need to complete the financial assessment" msgstr "Pan nad oes angen i chi gwblhau’r asesiad ariannol" +#, python-format msgid "" -"You should contact CLA " -"without completing the financial assessment if you are:" +"You should %(contact_us_link)s without completing the financial " +"assessment if you are:" msgstr "" -"Dyma pryd ddylech gysylltu â " -"Chyngor Cyfreithiol Sifil heb gwblhau'r asesiad ariannol:" msgid "under 18" msgstr "os ydych o dan 18 oed" @@ -1799,13 +1810,11 @@ msgstr "" "Gallwch ddewis peidio â chwblhau’r asesiad ariannol ar-lein, a gofyn yn " "hytrach am alwad gyda dehonglydd BSL." +#, python-format msgid "" -"Fill in the 'Contact CLA' " -"page. Select 'BSL' under 'Communication needs'." +"Fill in the '%(contact_us_link)s' page. Select 'BSL' under 'Communication" +" needs'." msgstr "" -"Llenwch y dudalen 'Cysylltu â " -"Chyngor Cyfreithiol Sifil'. Dewiswch 'BSL' o dan 'Anghenion " -"cyfathrebu'." msgid "Check if you qualify financially" msgstr "Gwirio a ydych yn gymwys yn ariannol" @@ -2207,6 +2216,147 @@ msgstr "cael eich cam-drin yn gorfforol, yn rhywiol neu’n emosiynol" msgid "Back" msgstr "Yn ôl" +msgid "You can now call CLA on" +msgstr "Gallwch ffonio CLA yn awr ar" + +msgid "" +"Please quote your reference number when you call. Find out about\n" +" call charges." +msgstr "Dyfynnwch eich cyfeirnod pan fyddwch yn ffonio. I gael rhagor o wybodaeth am gyfraddau galwadau." + +msgid "Print this page" +msgstr "Argraffu’r dudalen hon" + +msgid "We will call you back" +msgstr "Byddwn yn eich ffonio’n ôl" + +msgid "Your details have been submitted" +msgstr "Cyflwynwyd eich manylion" + +msgid "Your reference number was sent to" +msgstr "Anfonwyd eich cyfeirnod i" + +msgid "" +"If you have a court hearing date it is important that you get advice as " +"soon as possible. You may be able to get last-minute help on the day of " +"the hearing from an adviser in the court building." +msgstr "Os oes gennych ddyddiad gwrandawiad llys, mae’n bwysig eich bod yn cael cyngor cyn gynted â phosib. Efallai y cewch gymorth ar fyr rybudd ar ddiwrnod y gwrandawiad gan gynghorydd yn adeilad y llys." + +msgid "What happens next?" +msgstr "Beth sy’n di?" + +msgid "" +"Your details have been submitted and an operator will call\n" +" the person you nominated at least once during your " +"chosen time, or as close to the time as possible" +msgstr "Mae eich manylion wedi cael eu cyflwyno a bydd gweithredwr yn eich ffonio o leiaf unwaith ar yr adeg o’ch dewis, neu mor agos at yr adeg honno ag sy’n bosibl" + +msgid "" +"Your details have been submitted and an operator will call\n" +" you at least once during your chosen time, or as " +"close to the time as possible" +msgstr "Mae eich manylion wedi cael eu cyflwyno a bydd gweithredwr yn eich ffonio o leiaf unwaith ar yr adeg o’ch dewis, neu mor agos at yr adeg honno ag sy’n bosibl" + +msgid "When a CLA operator calls, the call will come from an anonymous number." +msgstr "Pan fydd gweithredwr CLA yn eich ffonio, bydd rhif anhysbys yn ymddangos ar yr alwad." + +msgid "" +"If you need to urgently protect yourself or your family you should try " +"and get advice as soon as possible." +msgstr "Os oes arnoch angen diogelu chi’ch hun neu eich teulu ar frys, dylech geisio cael cymorth cyn gynted â phosib" + +msgid "" +"The first person they speak to will be an operator who will ask about " +"your problem and your financial circumstances." +msgstr "Yr unigolyn cyntaf fydd yn siarad â hwy fydd gweithredwr a fydd yn gofyn cwestiynau am eich problem a’ch amgylchiadau ariannol" + +msgid "" +"The first person you speak to will be an operator who will ask about your" +" problem and your financial circumstances." +msgstr "Yr unigolyn cyntaf fydd yn siarad â chi fydd gweithredwr a fydd yn gofyn cwestiynau i chi am eich problem a’ch amgylchiadau ariannol." + +msgid "" +"If it looks like you might qualify for legal aid they’ll\n" +" be put through to a specialist adviser, who will " +"make the\n" +" final decision on your case." +msgstr "Os yw’n ymddangos y gallech chi fod yn gymwys am gymorth cyfreithiol, fe’ch trosglwyddir i un o gynghorwyr arbenigol a fydd yn gwneud y penderfyniad terfynol ynghylch eich achos." + +msgid "" +"If it looks like you might qualify for legal aid you’ll\n" +" be put through to a specialist adviser, who will " +"make the\n" +" final decision on your case." +msgstr "Os yw’n ymddangos y gallech chi fod yn gymwys am gymorth cyfreithiol, fe’ch trosglwyddir i un o gynghorwyr arbenigol a fydd yn gwneud y penderfyniad terfynol ynghylch eich achos." + +msgid "" +"Please be aware that the specialist adviser will need\n" +" evidence of the domestic violence before they " +"can make a decision\n" +" on your case." +msgstr "Byddwch yn ymwybodol fod y cynghorydd arbenigol angen tystiolaeth o’r trais domestig cyn y gallant wneud penderfyniad ar eich achos." + +msgid "Find out what you can use as evidence" +msgstr "Canfod beth allwch ei ddefnyddio fel tystiolaeth" + +msgid "" +"If your case involves domestic abuse or violence,\n" +" the specialist adviser will need evidence of " +"this\n" +" before they can make a decision on your case." +msgstr "Os yw eich cais yn ymwneud â cham-drin neu drais domestig, bydd y cynghorydd arbenigol angen tystiolaeth o hyn cyn gwneud penderfyniad ynghylch eich achos." + +msgid "" +"You will also need to provide evidence of your financial\n" +" circumstances. Your specialist adviser will explain " +"what is\n" +" needed." +msgstr "Bydd angen i chi ddarparu tystiolaeth o’ch amgylchiadau ariannol hefyd. Bydd eich cynghorydd arbenigol yn egluro beth sydd ei angen." + +msgid "" +"You will need to provide evidence of your financial circumstances\n" +" and maybe your problem. Your specialist adviser will " +"explain\n" +" what is needed." +msgstr "Bydd angen i chi ddarparu tystiolaeth o’ch amgylchiadau ariannol ac efallai eich problem. Bydd eich cynghorydd arbenigol yn esbonio beth fyddwch ei angen." + +msgid "" +"If your specialist adviser thinks you need to speak to someone in person " +"or have someone represent you in court, they will organise this." +msgstr "Os bydd eich cynghorydd arbenigol yn penderfynu bod angen i chi siarad â rhywun eich hun neu os bydd arnoch angen rhywun i’ch cynrychioli yn y llys, fe fydd yn trefnu hyn." + +msgid "If CLA can’t help you, we’ll always suggest where else you might get help." +msgstr "Os nad yw CLA yn gallu eich helpu, byddwn ni bob amser yn awgrymu rhywle arall allai’ch helpu." + +msgid "" +"If we can do anything to make it easier for you to communicate with us, " +"please tell the operator." +msgstr "Os gallwn wneud unrhyw beth i’w gwneud hi’n haws i chi gyfathrebu gyda ni, dywedwch wrth y gweithredwr." + +#, python-format +msgid "" +"\n" +" Protecting your personal data and your privacy is " +"important to us. Read the full\n" +" Civil" +" Legal Advice Privacy Statement.\n" +" " +msgstr "Mae diogelu’ch data personol a phreifatrwydd yn bwysig i ni. Darllennwch y Datganiad Preifatrwydd Cyngor Cyfreithiol yn llawn." + +msgid "What if I miss the operator’s call?" +msgstr "Beth fydd yn digwydd os byddaf yn methu galwad y gweithredwr?" + +msgid "" +"If you miss the call or you need advice urgently, you can call us on\n" +" 0345 345 4 345. Find out about\n" +" call charges." +msgstr "Os byddwch yn methu’r alwad neu angen cyngor ar frys, gallwch ein ffonio ar 0345 345 4 345. Mae gwybodaeth am gostau’r galwadau i’w cael yma." + +msgid "Finish" +msgstr "Gorffen" + msgid "" "We’ll give you the Civil Legal Advice phone number when you submit your " "details." @@ -2767,3 +2917,23 @@ msgstr "Offerynnau cerddorol, oni bai’ch bod yn gerddor proffesiynol" #~ msgid "Enter your email address" #~ msgstr "Rhowch eich cyfeiriad e-bost" +#~ msgid "" +#~ "You should contact CLA without completing" +#~ " the financial assessment if you are:" +#~ msgstr "" +#~ "Dyma pryd ddylech gysylltu â Chyngor " +#~ "Cyfreithiol Sifil heb gwblhau'r asesiad" +#~ " ariannol:" + +#~ msgid "" +#~ "Fill in the 'Contact CLA' page. Select " +#~ "'BSL' under 'Communication needs'." +#~ msgstr "" +#~ "Llenwch y dudalen 'Cysylltu â Chyngor " +#~ "Cyfreithiol Sifil'. Dewiswch 'BSL' o " +#~ "dan 'Anghenion cyfathrebu'." + diff --git a/app/translations/en/LC_MESSAGES/messages.pot b/app/translations/en/LC_MESSAGES/messages.pot index 3f0d8af67..777038e1a 100644 --- a/app/translations/en/LC_MESSAGES/messages.pot +++ b/app/translations/en/LC_MESSAGES/messages.pot @@ -763,6 +763,18 @@ msgstr "" msgid "Submit details" msgstr "" +msgid "Receive this confirmation by email" +msgstr "" + +msgid "Enter a valid email address" +msgstr "" + +msgid "Tell us what email address to send to" +msgstr "" + +msgid "Send" +msgstr "" + msgid "There is a problem" msgstr "" @@ -1561,9 +1573,10 @@ msgstr "" msgid "When you do not need to complete the financial assessment" msgstr "" +#, python-format msgid "" -"You should contact CLA " -"without completing the financial assessment if you are:" +"You should %(contact_us_link)s without completing the financial " +"assessment if you are:" msgstr "" msgid "under 18" @@ -1582,9 +1595,10 @@ msgid "" "instead ask for a call with a BSL interpreter." msgstr "" +#, python-format msgid "" -"Fill in the 'Contact CLA' " -"page. Select 'BSL' under 'Communication needs'." +"Fill in the '%(contact_us_link)s' page. Select 'BSL' under 'Communication" +" needs'." msgstr "" msgid "Check if you qualify financially" @@ -1934,6 +1948,147 @@ msgstr "" msgid "Back" msgstr "" +msgid "You can now call CLA on" +msgstr "" + +msgid "" +"Please quote your reference number when you call. Find out about\n" +" call charges." +msgstr "" + +msgid "Print this page" +msgstr "" + +msgid "We will call you back" +msgstr "" + +msgid "Your details have been submitted" +msgstr "" + +msgid "Your reference number was sent to" +msgstr "" + +msgid "" +"If you have a court hearing date it is important that you get advice as " +"soon as possible. You may be able to get last-minute help on the day of " +"the hearing from an adviser in the court building." +msgstr "" + +msgid "What happens next?" +msgstr "" + +msgid "" +"Your details have been submitted and an operator will call\n" +" the person you nominated at least once during your " +"chosen time, or as close to the time as possible" +msgstr "" + +msgid "" +"Your details have been submitted and an operator will call\n" +" you at least once during your chosen time, or as " +"close to the time as possible" +msgstr "" + +msgid "When a CLA operator calls, the call will come from an anonymous number." +msgstr "" + +msgid "" +"If you need to urgently protect yourself or your family you should try " +"and get advice as soon as possible." +msgstr "" + +msgid "" +"The first person they speak to will be an operator who will ask about " +"your problem and your financial circumstances." +msgstr "" + +msgid "" +"The first person you speak to will be an operator who will ask about your" +" problem and your financial circumstances." +msgstr "" + +msgid "" +"If it looks like you might qualify for legal aid they’ll\n" +" be put through to a specialist adviser, who will " +"make the\n" +" final decision on your case." +msgstr "" + +msgid "" +"If it looks like you might qualify for legal aid you’ll\n" +" be put through to a specialist adviser, who will " +"make the\n" +" final decision on your case." +msgstr "" + +msgid "" +"Please be aware that the specialist adviser will need\n" +" evidence of the domestic violence before they " +"can make a decision\n" +" on your case." +msgstr "" + +msgid "Find out what you can use as evidence" +msgstr "" + +msgid "" +"If your case involves domestic abuse or violence,\n" +" the specialist adviser will need evidence of " +"this\n" +" before they can make a decision on your case." +msgstr "" + +msgid "" +"You will also need to provide evidence of your financial\n" +" circumstances. Your specialist adviser will explain " +"what is\n" +" needed." +msgstr "" + +msgid "" +"You will need to provide evidence of your financial circumstances\n" +" and maybe your problem. Your specialist adviser will " +"explain\n" +" what is needed." +msgstr "" + +msgid "" +"If your specialist adviser thinks you need to speak to someone in person " +"or have someone represent you in court, they will organise this." +msgstr "" + +msgid "If CLA can’t help you, we’ll always suggest where else you might get help." +msgstr "" + +msgid "" +"If we can do anything to make it easier for you to communicate with us, " +"please tell the operator." +msgstr "" + +#, python-format +msgid "" +"\n" +" Protecting your personal data and your privacy is " +"important to us. Read the full\n" +" Civil" +" Legal Advice Privacy Statement.\n" +" " +msgstr "" + +msgid "What if I miss the operator’s call?" +msgstr "" + +msgid "" +"If you miss the call or you need advice urgently, you can call us on\n" +" 0345 345 4 345. Find out about\n" +" call charges." +msgstr "" + +msgid "Finish" +msgstr "" + msgid "" "We’ll give you the Civil Legal Advice phone number when you submit your " "details." diff --git a/tests/functional_tests/categories/discrimination/test_discrimination.py b/tests/functional_tests/categories/discrimination/test_discrimination.py index 53e022eb1..0d99c28bb 100644 --- a/tests/functional_tests/categories/discrimination/test_discrimination.py +++ b/tests/functional_tests/categories/discrimination/test_discrimination.py @@ -114,7 +114,7 @@ def test_are_you_under_18_form_yes(self, page: Page): ).to_be_visible() @pytest.mark.usefixtures("live_server") - def test_are_you_over_18_form_no(self, page: Page): + def test_are_you_under_18_form_no(self, page: Page): self.navigate_to_form(page) page.get_by_label("No").check() page.get_by_role("button", name="Continue").click() diff --git a/tests/functional_tests/contact/test_confirmation.py b/tests/functional_tests/contact/test_confirmation.py new file mode 100644 index 000000000..3227c5741 --- /dev/null +++ b/tests/functional_tests/contact/test_confirmation.py @@ -0,0 +1,127 @@ +import pytest +from playwright.sync_api import Page, expect + + +@pytest.mark.usefixtures("live_server") +def test_confirmation_page_email(page: Page): + page.get_by_role("link", name="Contact us").click() + + page.get_by_role("button", name="Continue to contact CLA").click() + + expect( + page.get_by_role("heading", name="Contact Civil Legal Advice") + ).to_be_visible() + + page.get_by_role("textbox", name="Your full name").fill("Test") + + page.get_by_role("radio", name="I will call you").check() + + page.get_by_role("button", name="Submit details").click() + + expect( + page.get_by_role("heading", name="Your details have been submitted") + ).to_be_visible() + + # This email address is provided by GOV.UK Notify for testing purposes + page.get_by_role("textbox", name="Receive this confirmation by").fill( + "simulate-delivered@notifications.service.gov.uk" + ) + + page.get_by_role("button", name="Send").click() + + expect( + page.get_by_text( + "Your reference number was sent to simulate-delivered@notifications.service.gov.uk." + ) + ).to_be_visible() + + +@pytest.mark.usefixtures("live_server") +def test_family_category(page: Page): + page.get_by_role("link", name="Children, families,").click() + page.get_by_role("link", name="Children and social services").click() + page.get_by_role("textbox", name="Your full name").fill("John Doe") + page.get_by_role("radio", name="I will call you").check() + page.get_by_role("button", name="Submit details").click() + expect( + page.get_by_text( + "If your case involves domestic abuse or violence, the specialist adviser will need evidence of this" + ) + ).to_be_visible() + + +@pytest.mark.usefixtures("live_server") +def test_domestic_abuse_category(page: Page): + page.get_by_role("link", name="Domestic abuse").click() + page.get_by_role("link", name="Help to keep yourself safe").click() + page.get_by_role("radio", name="Yes").check() + page.get_by_role("button", name="Continue").click() + page.get_by_role("textbox", name="Your full name").fill("John Doe") + page.get_by_role("radio", name="I will call you").check() + page.get_by_role("button", name="Submit details").click() + expect( + page.get_by_text( + "Please be aware that the specialist adviser will need evidence of the domestic violence" + ) + ).to_be_visible() + + +@pytest.mark.usefixtures("live_server") +def test_housing_category(page: Page): + page.get_by_role("link", name="Housing, homelessness, losing").click() + page.get_by_role("link", name="Homelessness").click() + page.get_by_role("paragraph").filter( + has_text="Fill in the ' contact CLA '" + ).get_by_role("link").click() + page.get_by_role("textbox", name="Your full name").fill("John Doe") + page.get_by_role("radio", name="I will call you").check() + page.get_by_role("button", name="Submit details").click() + expect( + page.get_by_text( + "Warning If you have a court hearing date it is important that you get advice as soon as possible." + ) + ).to_be_visible() + + +@pytest.mark.usefixtures("live_server") +def test_thirdparty_callback(page: Page): + page.get_by_role("link", name="Contact us").click() + page.get_by_role("button", name="Continue to contact CLA").click() + page.get_by_role("textbox", name="Your full name").fill("John Doe") + page.get_by_role("radio", name="Call someone else instead of").check() + page.get_by_role("textbox", name="Full name of the person to").fill("Jane Doe") + page.get_by_label("Relationship to you").select_option("family_friend") + page.get_by_role("textbox", name="Phone number").fill("12345") + page.get_by_role("radio", name="Call on another day").check() + page.get_by_role("group", name="Select a time for us to call").get_by_label( + "Day", exact=True + ).select_option(index=1) + page.get_by_role("group", name="Select a time for us to call").get_by_label( + "Time" + ).select_option(index=1) + page.get_by_role("button", name="Submit details").click() + expect( + page.get_by_text( + "Your details have been submitted and an operator will call the person you nominated at least once during your chosen time, or as close to the time as possible" + ) + ).to_be_visible() + expect( + page.get_by_text("The first person they speak to will be an operator") + ).to_be_visible() + expect( + page.get_by_text( + "If it looks like you might qualify for legal aid they’ll be put through to a specialist adviser, who will make the final decision on your case." + ) + ).to_be_visible() + + +@pytest.mark.usefixtures("live_server") +def test_survey_link(page: Page): + page.get_by_role("link", name="Contact us").click() + page.get_by_role("button", name="Continue to contact CLA").click() + page.get_by_role("textbox", name="Your full name").fill("John Doe") + page.get_by_role("radio", name="I will call you").check() + page.get_by_role("button", name="Submit details").click() + expect(page.get_by_role("button", name="Finish")).to_have_attribute( + "href", value="https://www.gov.uk/done/check-if-civil-legal-advice-can-help-you" + ) diff --git a/tests/functional_tests/contact/test_contact.py b/tests/functional_tests/contact/test_contact.py index 82edb9752..d4a2631d5 100644 --- a/tests/functional_tests/contact/test_contact.py +++ b/tests/functional_tests/contact/test_contact.py @@ -184,4 +184,33 @@ def test_contact_page_routing(page: Page, contact_answers: dict): page.get_by_role("button", name="Submit details").click() - expect(page.get_by_role("heading", name="Confirmation Page")).to_be_visible() + expected_heading = ( + "We will call you back" + if "Call me back" in contact_answers["Select a contact option"] + else "Your details have been submitted" + ) + expect(page.get_by_role("heading", name=expected_heading)).to_be_visible() + + if "I will call you" in contact_answers["Select a contact option"]: + expect( + page.get_by_text("You can now call CLA on 0345 345 4 345.") + ).to_be_visible() + expect( + page.get_by_text( + "Your details have been submitted and an operator will call you at least once during your chosen time" + ) + ).not_to_be_visible() + if "Call me back" in contact_answers["Select a contact option"]: + expect( + page.get_by_text("You can now call CLA on 0345 345 4 345.") + ).not_to_be_visible() + expect( + page.get_by_text( + "Your details have been submitted and an operator will call you at least once during your chosen time" + ) + ).to_be_visible() + expect( + page.get_by_text( + "When a CLA operator calls, the call will come from an anonymous number." + ) + ).to_be_visible() diff --git a/tests/unit_tests/contact/test_confirmation.py b/tests/unit_tests/contact/test_confirmation.py new file mode 100644 index 000000000..158195a68 --- /dev/null +++ b/tests/unit_tests/contact/test_confirmation.py @@ -0,0 +1,94 @@ +import pytest +from unittest.mock import patch, ANY +from datetime import datetime, timezone +from app.contact.views import ConfirmationPage + + +class TestConfirmationPage: + session_data = { + "case_reference": "AB-1234-5678", + "callback_time": datetime(2025, 3, 10, 10, 30, 0, tzinfo=timezone.utc), + "contact_type": "callback", + "category": {"code": "asylum_and_immigration"}, + } + + @pytest.fixture + def mock_notify(self): + with patch("app.contact.views.notify") as mock_notify: + yield mock_notify + + def test_get_context(self, client): + with client.session_transaction() as session: + session.update(self.session_data) + + with client.application.test_request_context(): + with patch("app.contact.views.session", dict(session)): + context = ConfirmationPage.get_context() + + assert context["case_reference"] == "AB-1234-5678" + assert context["callback_time"] == datetime( + 2025, 3, 10, 10, 30, 0, tzinfo=timezone.utc + ) + assert context["contact_type"] == "callback" + assert context["category"] == {"code": "asylum_and_immigration"} + + def test_get_confirmation_page(self, client): + with client.session_transaction() as session: + session.update(self.session_data) + + with patch("app.contact.views.render_template") as mock_render: + mock_render.return_value = "Rendered Template" + + client.get("/confirmation") + + mock_render.assert_called_once_with( + "contact/confirmation.html", + form=ANY, + case_reference="AB-1234-5678", + callback_time=datetime(2025, 3, 10, 10, 30, 0, tzinfo=timezone.utc), + contact_type="callback", + category={"code": "asylum_and_immigration"}, + confirmation_email=None, + email_sent=False, + ) + + def test_post_confirmation_page_valid_form(self, client, mock_notify): + with client.session_transaction() as session: + session.update(self.session_data) + + test_email = "test@example.com" + + with patch("app.contact.views.render_template") as mock_render: + mock_render.return_value = "Rendered Template" + + client.post( + "/confirmation", data={"email": test_email}, follow_redirects=True + ) + + mock_notify.create_and_send_confirmation_email.assert_called_once_with( + email_address=test_email, + case_reference="AB-1234-5678", + callback_time=datetime(2025, 3, 10, 10, 30, 0, tzinfo=timezone.utc), + contact_type="callback", + ) + + mock_render.assert_called_once_with( + "contact/confirmation.html", + form=ANY, + case_reference="AB-1234-5678", + callback_time=datetime(2025, 3, 10, 10, 30, 0, tzinfo=timezone.utc), + contact_type="callback", + category=ANY, + confirmation_email=test_email, + email_sent=True, + ) + + def test_post_confirmation_page_invalid_form(self, client, mock_notify): + with client.session_transaction() as session: + session.update(self.session_data) + + client.post( + "/confirmation", data={"email": "invalid-email"}, follow_redirects=True + ) + + mock_notify.create_and_send_confirmation_email.assert_not_called() diff --git a/tests/unit_tests/contact/test_contact.py b/tests/unit_tests/contact/test_contact.py index a84d4edcf..9770e0b09 100644 --- a/tests/unit_tests/contact/test_contact.py +++ b/tests/unit_tests/contact/test_contact.py @@ -4,6 +4,7 @@ from wtforms.fields.choices import SelectField from app.api import cla_backend, BackendAPIClient from app.contact.forms import ReasonsForContactingForm, ContactUsForm +from app.contact.helpers import format_callback_time import requests from datetime import datetime from app.contact.address_finder.widgets import AddressLookup, FormattedAddressLookup @@ -421,22 +422,22 @@ def test_get_callback_time_invalid_selection(self, app, client): @patch("app.contact.forms.cla_backend") def test_format_callback_time_none_input(self, app, client): - result = ContactUsForm.format_callback_time(None) + result = format_callback_time(None) assert result is None @patch("app.contact.forms.cla_backend") def test_format_callback_time_invalid_input(self, app, client): - result = ContactUsForm.format_callback_time("not a datetime") + result = format_callback_time("not a datetime") assert result is None @patch("app.contact.forms.cla_backend") def test_format_callback_time_valid(self, app, client): test_time = datetime(2024, 1, 1, 9, 0) - result = ContactUsForm.format_callback_time(test_time) - assert result == "Monday, 01 January at 09:00 - 09:30" + result = format_callback_time(test_time) + assert result == "Monday, 1 January at 09:00 - 09:30" @patch("app.contact.forms.cla_backend") def test_format_callback_time_with_midnight_crossing(self, app, client): test_time = datetime(2024, 1, 1, 23, 45) - result = ContactUsForm.format_callback_time(test_time) - assert result == "Monday, 01 January at 23:45 - 00:15" + result = format_callback_time(test_time) + assert result == "Monday, 1 January at 23:45 - 00:15" diff --git a/tests/unit_tests/contact/test_notify.py b/tests/unit_tests/contact/test_notify.py index a7c22cfe3..33897bee6 100644 --- a/tests/unit_tests/contact/test_notify.py +++ b/tests/unit_tests/contact/test_notify.py @@ -266,7 +266,7 @@ def test_generate_confirmation_email_data( with ( patch("app.contact.notify.api.get_locale") as mock_get_locale, patch( - "app.contact.forms.ContactUsForm.format_callback_time", + "app.contact.notify.api.format_callback_time", return_value="formatted-time", ), patch(