Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ def label_classes(self):
else:
return "nhsuk-fieldset__legend--m"

def page_title(self):
return f"{self.label()} – NHS"


def stopped_or_quit(self):
if self.response_set().current_smoker():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

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

{% block pageTitle %}Have you ever stopped smoking for periods of 1 year or longer? - NHS{% endblock %}

{% if error %}
{% set error_message = { "text": error } %}
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,10 @@ class PeriodsWhenYouStoppedSmokingView(LoginRequiredMixin, EnsureResponseSet, En
model = PeriodsWhenYouStoppedSmokingResponse
success_url = reverse_lazy("questions:types_tobacco_smoking")
back_link_url = reverse_lazy("questions:age_when_started_smoking")

def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
form = context.get("form") or self.get_form()
context["page_title"] = form.page_title()
return context

Loading