diff --git a/lung_cancer_screening/questions/jinja2/relative_age_when_diagnosed.jinja b/lung_cancer_screening/questions/jinja2/relative_age_when_diagnosed.jinja
index e1ff8bc4..2ea10ecf 100644
--- a/lung_cancer_screening/questions/jinja2/relative_age_when_diagnosed.jinja
+++ b/lung_cancer_screening/questions/jinja2/relative_age_when_diagnosed.jinja
@@ -1,5 +1,7 @@
{% extends 'question_form.jinja' %}
+{% block pageTitle %}If your relatives were under 60 when diagnosed - NHS{% endblock %}
+
{% block prelude %}
diff --git a/lung_cancer_screening/questions/jinja2/responses.jinja b/lung_cancer_screening/questions/jinja2/responses.jinja
index dfe4b7ee..5938a4c6 100644
--- a/lung_cancer_screening/questions/jinja2/responses.jinja
+++ b/lung_cancer_screening/questions/jinja2/responses.jinja
@@ -3,6 +3,7 @@
{% from "nhsuk/components/summary-list/macro.jinja" import summaryList %}
{% from 'nhsuk/components/button/macro.jinja' import button %}
+{% block pageTitle %} Check your answers - Check if you need a lung scan - NHS {% endblock %}
{% block page_content %}
diff --git a/lung_cancer_screening/questions/jinja2/sex_at_birth.jinja b/lung_cancer_screening/questions/jinja2/sex_at_birth.jinja
index a14a24f7..9a7b1460 100644
--- a/lung_cancer_screening/questions/jinja2/sex_at_birth.jinja
+++ b/lung_cancer_screening/questions/jinja2/sex_at_birth.jinja
@@ -1,5 +1,5 @@
{% extends 'question_form.jinja' %}
-
+{% block pageTitle %}Your sex at birth – Check if you need a lung scan – NHS{% endblock %}
{% block prelude %}
Your sex at birth
diff --git a/lung_cancer_screening/questions/jinja2/start.jinja b/lung_cancer_screening/questions/jinja2/start.jinja
index a2e81f2c..d41d37da 100644
--- a/lung_cancer_screening/questions/jinja2/start.jinja
+++ b/lung_cancer_screening/questions/jinja2/start.jinja
@@ -1,6 +1,6 @@
{% extends 'layout.jinja' %}
{% from 'nhsuk/components/button/macro.jinja' import button %}
-
+{% block pageTitle %}Check if you need a lung scan – NHS{% endblock %}
{% block content %}
diff --git a/lung_cancer_screening/questions/jinja2/terms_of_use.jinja b/lung_cancer_screening/questions/jinja2/terms_of_use.jinja
index b4eed733..ad361e3d 100644
--- a/lung_cancer_screening/questions/jinja2/terms_of_use.jinja
+++ b/lung_cancer_screening/questions/jinja2/terms_of_use.jinja
@@ -1,4 +1,5 @@
{% extends 'layout.jinja' %}
+{% block pageTitle %}NHS check if you need a lung scan terms of use - NHS{% endblock %}
{% block content %}
@@ -168,4 +169,5 @@
+
{% endblock %}
diff --git a/lung_cancer_screening/questions/jinja2/types_tobacco_smoking.jinja b/lung_cancer_screening/questions/jinja2/types_tobacco_smoking.jinja
index 285ad096..484ed3f4 100644
--- a/lung_cancer_screening/questions/jinja2/types_tobacco_smoking.jinja
+++ b/lung_cancer_screening/questions/jinja2/types_tobacco_smoking.jinja
@@ -1,5 +1,7 @@
{% extends 'question_form.jinja' %}
+{% block pageTitle %}What do you or have you smoked? - Check if you need a lung scan - NHS{% endblock %}
+
{% block prelude %}
The type of tobacco you smoke or used to smoke
diff --git a/lung_cancer_screening/questions/jinja2/weight.jinja b/lung_cancer_screening/questions/jinja2/weight.jinja
index ce06dbca..79da19b0 100644
--- a/lung_cancer_screening/questions/jinja2/weight.jinja
+++ b/lung_cancer_screening/questions/jinja2/weight.jinja
@@ -3,6 +3,8 @@
{% from 'nhsuk/components/back-link/macro.jinja' import backLink %}
{% from 'nhsuk/components/fieldset/macro.jinja' import fieldset %}
+{% block pageTitle %}What is your weight? – Check if you need a lung scan – NHS{% endblock %}
+
{% set WEIGHT_UNIT = {
'imperial': 'stone and pounds',
'metric': 'kilograms'
diff --git a/lung_cancer_screening/questions/presenters/tobacco_smoking_history_presenter.py b/lung_cancer_screening/questions/presenters/tobacco_smoking_history_presenter.py
index 5c3ddae2..24f4c0fd 100644
--- a/lung_cancer_screening/questions/presenters/tobacco_smoking_history_presenter.py
+++ b/lung_cancer_screening/questions/presenters/tobacco_smoking_history_presenter.py
@@ -70,6 +70,12 @@ def more_or_fewer(self):
elif self.tobacco_smoking_history.is_decreased():
return "fewer"
+ def increased_or_decreased(self):
+ if self.tobacco_smoking_history.is_increased():
+ return "increased"
+ elif self.tobacco_smoking_history.is_decreased():
+ return "decreased"
+
def currently_or_previously(self):
if self.is_present_tense():
diff --git a/lung_cancer_screening/questions/tests/unit/views/test_date_of_birth.py b/lung_cancer_screening/questions/tests/unit/views/test_date_of_birth.py
index a636ace8..e26a86c9 100644
--- a/lung_cancer_screening/questions/tests/unit/views/test_date_of_birth.py
+++ b/lung_cancer_screening/questions/tests/unit/views/test_date_of_birth.py
@@ -81,6 +81,15 @@ def test_responds_successfully(self):
self.assertEqual(response.status_code, 200)
+ def test_renders_page_title(self):
+ response = self.client.get(reverse("questions:date_of_birth"))
+
+ self.assertEqual(response.status_code, 200)
+ self.assertContains(
+ response,
+ "
What is your date of birth? – Check if you need a lung scan – NHS",
+ html=True,
+ )
@tag("DateOfBirth")
class TestPostDateOfBirth(TestCase):
diff --git a/lung_cancer_screening/questions/tests/unit/views/test_smoked_total_years.py b/lung_cancer_screening/questions/tests/unit/views/test_smoked_total_years.py
index 4742451f..06911a0d 100644
--- a/lung_cancer_screening/questions/tests/unit/views/test_smoked_total_years.py
+++ b/lung_cancer_screening/questions/tests/unit/views/test_smoked_total_years.py
@@ -172,6 +172,17 @@ def test_has_a_back_link_to_smoking_amount_if_the_level_is_not_normal(self):
}),
)
+ def test_renders_page_title(self):
+ response = self.client.get(reverse("questions:smoked_total_years", kwargs={
+ "tobacco_type": TobaccoSmokingHistoryTypes.CIGARETTES.value.lower()
+ }))
+
+ self.assertContains(
+ response,
+ "
Number of years you have smoked cigarettes - NHS",
+ html=True,
+ )
+
@tag("SmokedTotalYears")
class TestPostSmokedTotalYears(TestCase):
diff --git a/lung_cancer_screening/questions/views/age_when_started_smoking.py b/lung_cancer_screening/questions/views/age_when_started_smoking.py
index 86167c84..f75444bf 100644
--- a/lung_cancer_screening/questions/views/age_when_started_smoking.py
+++ b/lung_cancer_screening/questions/views/age_when_started_smoking.py
@@ -13,6 +13,7 @@ class AgeWhenStartedSmokingView(LoginRequiredMixin, EnsureResponseSet, EnsureEli
model = AgeWhenStartedSmokingResponse
success_url = reverse_lazy("questions:periods_when_you_stopped_smoking")
back_link_url = reverse_lazy("questions:relatives_age_when_diagnosed")
+ page_title = "How old were you when you started smoking? – NHS"
def get_success_url(self):
if self.should_redirect_to_responses(self.request):
diff --git a/lung_cancer_screening/questions/views/date_of_birth.py b/lung_cancer_screening/questions/views/date_of_birth.py
index e8c71419..5059c74f 100644
--- a/lung_cancer_screening/questions/views/date_of_birth.py
+++ b/lung_cancer_screening/questions/views/date_of_birth.py
@@ -26,6 +26,7 @@ class DateOfBirthView(LoginRequiredMixin, EnsureResponseSet, EnsureAcceptedTerms
model = DateOfBirthResponse
success_url = reverse_lazy("questions:check_need_appointment")
back_link_url = reverse_lazy("questions:have_you_ever_smoked")
+ page_title: str = "What is your date of birth? – Check if you need a lung scan – NHS"
def get_success_url(self):
if self.object.is_eligible():
diff --git a/lung_cancer_screening/questions/views/gender.py b/lung_cancer_screening/questions/views/gender.py
index 1399b596..c4bb2a36 100644
--- a/lung_cancer_screening/questions/views/gender.py
+++ b/lung_cancer_screening/questions/views/gender.py
@@ -14,3 +14,4 @@ class GenderView(LoginRequiredMixin, EnsureResponseSet, EnsureEligibleMixin, Que
model = GenderResponse
success_url = reverse_lazy("questions:ethnicity")
back_link_url = reverse_lazy("questions:sex_at_birth")
+ page_title: str = "Your gender identity – Check if you need a lung scan – NHS"
diff --git a/lung_cancer_screening/questions/views/question_base_view.py b/lung_cancer_screening/questions/views/question_base_view.py
index 7d802bed..1ffe5e16 100644
--- a/lung_cancer_screening/questions/views/question_base_view.py
+++ b/lung_cancer_screening/questions/views/question_base_view.py
@@ -4,6 +4,7 @@
class QuestionBaseView(UpdateView):
+ page_title = "Check if you need a lung scan – NHS"
def should_redirect_to_responses(self, request):
return bool(request.POST.get("change"))
@@ -20,6 +21,7 @@ def get_back_link_url(self):
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context["back_link_url"] = self.get_back_link_url()
+ context["page_title"] = self.page_title
return context
def get_success_url(self):
diff --git a/lung_cancer_screening/questions/views/respiratory_conditions.py b/lung_cancer_screening/questions/views/respiratory_conditions.py
index 1a30b757..6d4c8c68 100644
--- a/lung_cancer_screening/questions/views/respiratory_conditions.py
+++ b/lung_cancer_screening/questions/views/respiratory_conditions.py
@@ -14,3 +14,4 @@ class RespiratoryConditionsView(LoginRequiredMixin, EnsureResponseSet, EnsureEli
model = RespiratoryConditionsResponse
success_url = reverse_lazy("questions:asbestos_exposure")
back_link_url = reverse_lazy("questions:education")
+ page_title = "Respiratory conditions – Check if you need a lung scan – NHS"
diff --git a/lung_cancer_screening/questions/views/smoked_amount.py b/lung_cancer_screening/questions/views/smoked_amount.py
index 66cb5c50..479cd988 100644
--- a/lung_cancer_screening/questions/views/smoked_amount.py
+++ b/lung_cancer_screening/questions/views/smoked_amount.py
@@ -63,3 +63,9 @@ def prerequisite_responses(self):
result.append("smoking_current_response")
return result
+
+ def get_context_data(self, **kwargs):
+ context = super().get_context_data(**kwargs)
+ context["page_title"] = f"{context['form'].page_title()} - NHS"
+
+ return context
diff --git a/lung_cancer_screening/questions/views/smoked_total_years.py b/lung_cancer_screening/questions/views/smoked_total_years.py
index efe1e805..b4afa00a 100644
--- a/lung_cancer_screening/questions/views/smoked_total_years.py
+++ b/lung_cancer_screening/questions/views/smoked_total_years.py
@@ -39,6 +39,13 @@ def get_form_kwargs(self):
kwargs["tobacco_smoking_history"] = self.tobacco_smoking_history_item()
return kwargs
+ def get_context_data(self, **kwargs):
+ context = super().get_context_data(**kwargs)
+ human_type = self.tobacco_smoking_history_item().human_type().lower()
+ context["human_type"] = human_type
+ context["page_title"] = f"Number of years you have smoked {human_type} - NHS"
+ return context
+
def get_success_url(self):
if self.tobacco_smoking_history_item().is_normal():
diff --git a/lung_cancer_screening/questions/views/smoking_change.py b/lung_cancer_screening/questions/views/smoking_change.py
index 0d22fff5..cdb9f3f4 100644
--- a/lung_cancer_screening/questions/views/smoking_change.py
+++ b/lung_cancer_screening/questions/views/smoking_change.py
@@ -42,6 +42,7 @@ def get_form_kwargs(self):
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context["back_link_url"] = self.get_back_link_url()
+ context["page_title"] = f"{context['form'].page_title()} - NHS"
return context
def get_back_link_url(self):
diff --git a/lung_cancer_screening/questions/views/smoking_current.py b/lung_cancer_screening/questions/views/smoking_current.py
index ed292b1b..40dc0699 100644
--- a/lung_cancer_screening/questions/views/smoking_current.py
+++ b/lung_cancer_screening/questions/views/smoking_current.py
@@ -49,7 +49,12 @@ def get_back_link_url(self):
return reverse("questions:types_tobacco_smoking")
-
+ def get_context_data(self, **kwargs):
+ context = super().get_context_data(**kwargs)
+ human_type = self.tobacco_smoking_history_item().human_type().lower()
+ context["human_type"] = human_type
+ context["page_title"] = f"Do you currently smoke {human_type}? – NHS"
+ return context
def get_form_kwargs(self):
kwargs = super().get_form_kwargs()
diff --git a/lung_cancer_screening/questions/views/smoking_frequency.py b/lung_cancer_screening/questions/views/smoking_frequency.py
index bc44ef87..bd20e456 100644
--- a/lung_cancer_screening/questions/views/smoking_frequency.py
+++ b/lung_cancer_screening/questions/views/smoking_frequency.py
@@ -34,6 +34,7 @@ def get_form_kwargs(self):
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context["back_link_url"] = self.get_back_link_url()
+ context["page_title"] = f"{context['form'].page_title()} – NHS"
return context
def get_success_url(self):