Skip to content

Commit

Permalink
LGA-3556: Stay safe when you use this website (#192)
Browse files Browse the repository at this point in the history
* Add online safety page

* Add Welsh translation to link footer

* Add unit tests
  • Loading branch information
BenMillar-MOJ authored Mar 10, 2025
1 parent 70a19ab commit 23f86cd
Show file tree
Hide file tree
Showing 7 changed files with 355 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/main/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"])
Expand Down
4 changes: 4 additions & 0 deletions app/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
70 changes: 70 additions & 0 deletions app/templates/main/online-safety.html
Original file line number Diff line number Diff line change
@@ -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 %}
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<h1 class="govuk-heading-xl">{{ _('Stay safe when you use this website') }}</h1>

<p class="govuk-body">{{ _('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.') }}</p>
<p class="govuk-body">{{ _('For example, use a computer at the library, or borrow a phone from someone you trust.') }}</p>


<h2 class="govuk-heading-l">{{ _('What this website saves to your device') }}</h2>
<p class="govuk-body">{{ _('When you use this website, and every time you use the internet, your device saves a record of:') }}</p>
<ul class="govuk-list govuk-list--bullet">
<li>{{ _('the pages you’ve looked at and the files you’ve downloaded - this is called your ‘browsing history’') }}</li>
<li>{{ _('small files called ‘cookies’') }}</li>
</ul>

<h2 class="govuk-heading-l">{{ _('How to delete cookies and your browsing history') }}</h2>
<p class="govuk-body">{{ _('Be careful because:') }}</p>
<ul class="govuk-list govuk-list--bullet">
<li>{{ _('deleting cookies will also delete stored passwords for online accounts') }}</li>
<li>{{ _('clearing your history could make someone more suspicious') }}</li>
</ul>
<p class="govuk-body">{{ _('Try to only remove information about the websites you want to keep private.') }}</p>
<p class="govuk-body">{{ _('Find out how to do that on:') }}</p>

<ul class="govuk-list govuk-list--bullet">
<li><a class="govuk-link" href="https://support.google.com/chrome/answer/95589?hl=en&rd=1" rel="external">{{ _('Google Chrome') }}</a></li>
<li><a class="govuk-link" href="https://support.microsoft.com/en-us/windows/view-and-delete-your-browsing-history-in-internet-explorer-098ffe52-5ac9-a449-c296-c735c32c8678" rel="external">{{ _('Internet Explorer') }}</a></li>
<li><a class="govuk-link" href="https://support.mozilla.org/en-US/kb/delete-browsing-search-download-history-firefox" rel="external">{{ _('Mozilla Firefox') }}</a></li>
<li><a class="govuk-link" href="https://support.apple.com/kb/PH19215?locale=en_US&viewlocale=en_US" rel="external">{{ _('Safari') }}</a></li>
<li><a class="govuk-link" href="https://www.samsung.com/uk/support/mobile-devices/using-the-samsung-internet-app/" rel="external">{{ _('Samsung internet') }}</a></li>
</ul>

<h2 class="govuk-heading-l">{{ _('How the ‘Exit this page’ button works on this website') }}</h2>
<p class="govuk-body">
{{ _('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.')}}
</p>
<p class="govuk-body">
{{ _('You’ll automatically go to the BBC Weather homepage:') }} <a class="govuk-link" href="https://www.bbc.co.uk/weather/" rel="external">{{ _('https://www.bbc.co.uk/weather/') }}</a>
</p>

<p class="govuk-body">{{ _('Cookies and browsing history will still be saved to your device.') }}</p>
<p class="govuk-body">{{ _('On any page where you see the ‘Exit this page’ button, pressing the ‘Shift’ key 3 times will work the same way.') }}</p>
<p class="govuk-body">{{ _('To find this website again, search ‘Check if you can get legal aid’.') }}</p>

<h2 class="govuk-heading-l">{{ _('How to use this website without storing cookies and browser history') }}</h2>
<p class="govuk-body">{{ _('Use the ‘private browsing’ settings. Go to the menu on your browser, click on ‘File’ and turn on:') }}</p>
<ul class="govuk-list govuk-list--bullet">
<li>{{ _('<strong>Incognito</strong> on Google Chrome') }}</li>
<li>{{ _('<strong>Private Window</strong> on Safari') }}</li>
<li>{{ _('<strong>InPrivate</strong> on Internet Explorer') }}</li>
<li>{{ _('<strong>Private Browsing</strong> on Mozilla Firefox') }}</li>
</ul>
<p class="govuk-body">{{ _('On Samsung internet, you need to turn on') }} <a class="govuk-link" href="https://www.samsung.com/uk/support/mobile-devices/using-the-samsung-internet-app/" rel="external">{{ _('Secret mode.') }}</a></p>

<h2 class="govuk-heading-l">{{ _('Get help to stay safe online') }}</h2>
<p class="govuk-body">{{ _('There are other ways someone can track you online, for example by using spying or tracking programmes. See the Refuge website') }} <a class="govuk-link" href="https://refugetechsafety.org/secure-your-tech/" rel="external">{{ _('Secure your tech.') }}</a></p>
</div>
</div>
{% endblock %}
Binary file modified app/translations/cy/LC_MESSAGES/messages.mo
Binary file not shown.
131 changes: 131 additions & 0 deletions app/translations/cy/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""

Expand Down Expand Up @@ -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 "<strong>Incognito</strong> on Google Chrome"
msgstr "<strong>Incognito</strong> ar Google Chrome"

msgid "<strong>Private Window</strong> on Safari"
msgstr "<strong>Private Window</strong> ar Safari"

msgid "<strong>InPrivate</strong> on Internet Explorer"
msgstr "<strong>InPrivate</strong> ar Internet Explorer"

msgid "<strong>Private Browsing</strong> on Mozilla Firefox"
msgstr "<strong>Private Browsing</strong> 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"

Expand Down
128 changes: 128 additions & 0 deletions app/translations/en/LC_MESSAGES/messages.pot
Original file line number Diff line number Diff line change
Expand Up @@ -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 "<strong>Incognito</strong> on Google Chrome"
msgstr ""

msgid "<strong>Private Window</strong> on Safari"
msgstr ""

msgid "<strong>InPrivate</strong> on Internet Explorer"
msgstr ""

msgid "<strong>Private Browsing</strong> 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 ""

Expand Down
16 changes: 16 additions & 0 deletions tests/unit_tests/test_pages.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from unittest.mock import patch

import pytest


Expand Down Expand Up @@ -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")

0 comments on commit 23f86cd

Please sign in to comment.