Skip to content

Commit dd2c80b

Browse files
committed
Create body of smoking page and update options
1 parent 9089cf5 commit dd2c80b

File tree

5 files changed

+26
-31
lines changed

5 files changed

+26
-31
lines changed

lung_cancer_screening/questions/forms/have_you_ever_smoked_form.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@ def __init__(self, *args, **kwargs):
1515
widget=forms.RadioSelect,
1616
label="Have you ever smoked?",
1717
label_classes="nhsuk-fieldset__legend--m",
18-
label_is_page_heading=True,
19-
coerce=int
18+
hint="This includes social smoking",
19+
coerce=int,
20+
error_messages={
21+
'required': 'Select if you have ever smoked'
22+
}
2023
)
2124

2225
class Meta:
Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,19 @@
1-
{% extends 'layout.jinja' %}
2-
{% from 'nhsuk/components/button/macro.jinja' import button %}
3-
{% from 'nhsuk/components/radios/macro.jinja' import radios %}
4-
{% from 'nhsuk/components/back-link/macro.jinja' import backLink %}
1+
{% extends 'question_form.jinja' %}
52

6-
{% block beforeContent %}
7-
{{
8-
backLink({
9-
"href": url("questions:start"),
10-
"text": "Back"
11-
})
12-
}}
13-
{% endblock beforeContent %}
3+
{% block prelude %}
144

15-
{% block content %}
16-
<div class="nhsuk-grid-row">
17-
<div class="nhsuk-grid-column-two-thirds">
18-
<form action="{{ request.path }}" method="POST">
19-
{{ csrf_input }}
5+
<h1 class="nhsuk-heading-l">Tobacco smoking</h1>
206

21-
{{ form.have_you_ever_smoked.as_field_group() }}
7+
<p>We will ask you questions about your smoking habits. This includes different types of tobacco smoking such as:
228

23-
{{ button({
24-
"text": "Continue"
25-
}) }}
26-
</form>
27-
</div>
28-
</div>
29-
{% endblock %}
9+
<ul>
10+
<li>cigarettes from a packet</li>
11+
<li>rolled cigarettes, or roll ups</li>
12+
<li>a pipe</li>
13+
<li>cigars</li>
14+
<li>hookah or shisha</li>
15+
</ul>
16+
17+
<p>It does not currently include vaping or e-cigarettes.
18+
19+
{% endblock prelude %}

lung_cancer_screening/questions/jinja2/question_form.jinja

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
<form action="{{ request.path }}" method="POST">
1414
{{ csrf_input }}
1515

16+
{% block prelude %}
17+
{% endblock%}
18+
1619
{{ form }}
1720

1821
{{ button({

lung_cancer_screening/questions/models/response_set.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111

1212
class HaveYouEverSmokedValues(models.IntegerChoices):
1313
YES_I_CURRENTLY_SMOKE = 0, 'Yes, I currently smoke'
14-
YES_I_USED_TO_SMOKE_REGULARLY = 1, 'Yes, I used to smoke regularly'
15-
YES_BUT_ONLY_A_FEW_TIMES = 2, 'Yes, but only a few times'
14+
YES_I_USED_TO_SMOKE_REGULARLY = 1, 'Yes, I used to smoke'
15+
YES_BUT_ONLY_A_FEW_TIMES = 2, 'Yes, but I have smoked fewer than 100 cigarettes in my lifetime'
1616
NO_I_HAVE_NEVER_SMOKED = 3, 'No, I have never smoked'
1717

1818
class SexAtBirthValues(models.TextChoices):

lung_cancer_screening/questions/views/have_you_ever_smoked.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,10 @@ def post(self, request):
4040
status=422
4141
)
4242

43-
4443
def render_template(request, form, status=200):
4544
return render(
4645
request,
47-
"question_form.jinja",
46+
"have_you_ever_smoked.jinja",
4847
{
4948
"form": form,
5049
"back_link_url": reverse("questions:start")

0 commit comments

Comments
 (0)