Skip to content

Commit 8c00a81

Browse files
authored
PPHA-670: Updated page title on periods when you stopped smoking page (#425)
# What is the change? * Edited page title to be both current and past tense # Why are we making this change? Improve usability and align with prototype v 1.4
2 parents 149d115 + 4c637bb commit 8c00a81

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

lung_cancer_screening/questions/forms/periods_when_you_stopped_smoking_form.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ def label_classes(self):
7272
else:
7373
return "nhsuk-fieldset__legend--m"
7474

75+
def page_title(self):
76+
return f"{self.label()} – NHS"
77+
7578

7679
def stopped_or_quit(self):
7780
if self.response_set().current_smoker():

lung_cancer_screening/questions/jinja2/periods_when_you_stopped_smoking.jinja

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
{% from 'nhsuk/components/button/macro.jinja' import button %}
44

5-
{% block pageTitle %}Have you ever stopped smoking for periods of 1 year or longer? - NHS{% endblock %}
6-
75
{% if error %}
86
{% set error_message = { "text": error } %}
97
{% endif %}

lung_cancer_screening/questions/views/periods_when_you_stopped_smoking.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,10 @@ class PeriodsWhenYouStoppedSmokingView(LoginRequiredMixin, EnsureResponseSet, En
1414
model = PeriodsWhenYouStoppedSmokingResponse
1515
success_url = reverse_lazy("questions:types_tobacco_smoking")
1616
back_link_url = reverse_lazy("questions:age_when_started_smoking")
17+
18+
def get_context_data(self, **kwargs):
19+
context = super().get_context_data(**kwargs)
20+
form = context.get("form") or self.get_form()
21+
context["page_title"] = form.page_title()
22+
return context
23+

0 commit comments

Comments
 (0)