Skip to content

Commit a74dea3

Browse files
committed
change add links to small buttons
This leaves some empty summary list rows in the medical info summary list, but this is only a placeholder that we will soon be replacing with the proper design. We've added horizontal rules between the summary lists and button groups because there have been updates to the design system to remove extra space below summary lists within cards, and these are conceptually different so need separating a bit.
1 parent 3a5890c commit a74dea3

File tree

4 files changed

+83
-53
lines changed

4 files changed

+83
-53
lines changed

manage_breast_screening/mammograms/jinja2/mammograms/medical_information/medical_history/forms/mastectomy_or_lumpectomy_history.jinja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
{% block form %}
77
<p>
88
This is designed to capture information on prophylactic or elective surgery.
9-
<a href="{{ presenter.add_breast_cancer_history_link.href }}" class="nhsuk-link">
9+
<a href="{{ presenter.add_breast_cancer_history_button.href }}" class="nhsuk-link">
1010
Add breast cancer details
1111
</a>
1212
if that was the reason for this surgery.

manage_breast_screening/mammograms/jinja2/mammograms/record_medical_information.jinja

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{% extends "wizard_step.jinja" %}
2+
{% from "nhsuk/components/button/macro.jinja" import button %}
23
{% from "nhsuk/components/card/macro.jinja" import card %}
34
{% from "nhsuk/components/inset-text/macro.jinja" import insetText %}
45
{% from "nhsuk/components/summary-list/macro.jinja" import summaryList %}
@@ -23,13 +24,18 @@
2324
}) }}
2425
{% endif %}
2526

26-
<p class="nhsuk-u-margin-top-4 nhsuk-u-margin-bottom-0">
27-
<a href="{{ presenter.add_lump_link.href }}" class="nhsuk-link nhsuk-link--no-visited-state">{{ presenter.add_lump_link.text }}</a><br>
28-
<a href="{{ presenter.add_swelling_or_shape_change_link.href }}" class="nhsuk-link nhsuk-link--no-visited-state">{{ presenter.add_swelling_or_shape_change_link.text }}</a><br>
29-
<a href="{{ presenter.add_skin_change_link.href }}" class="nhsuk-link nhsuk-link--no-visited-state">{{ presenter.add_skin_change_link.text }}</a><br>
30-
<a href="{{ presenter.add_nipple_change_link.href }}" class="nhsuk-link nhsuk-link--no-visited-state">{{ presenter.add_nipple_change_link.text }}</a><br>
31-
<a href="{{ presenter.add_other_symptom_link.href }}" class="nhsuk-link nhsuk-link--no-visited-state">{{ presenter.add_other_symptom_link.text }}</a>
32-
</p>
27+
<hr>
28+
<h3>Add symptoms</h3>
29+
30+
<div class="nhsuk-button-group app-button-group--small">
31+
{% for button_info in presenter.symptom_buttons %}
32+
{{ button({
33+
"text": button_info.text,
34+
"href": button_info.href,
35+
"classes": "nhsuk-button--secondary nhsuk-button--small"
36+
}) }}
37+
{% endfor %}
38+
</div>
3339
{% endcall %}
3440

3541
{% set medical_history_card_html %}
@@ -40,7 +46,6 @@
4046
</a><br>
4147
{{ summaryList(presented_item.summary_list_params) }}
4248
{% endfor %}
43-
<a href="{{ presenter.add_breast_cancer_history_link.href }}" class="nhsuk-link nhsuk-link--no-visited-state">{{ presenter.add_breast_cancer_history_link.text }}</a><br>
4449
{% endset %}
4550

4651
{% set mastectomy_or_lumpectomy_history_html %}
@@ -50,7 +55,6 @@
5055
</a><br>
5156
{{ summaryList(presented_item.summary_list_params) }}
5257
{% endfor %}
53-
<a href="{{ presenter.add_mastectomy_or_lumpectomy_history_link.href }}" class="nhsuk-link nhsuk-link--no-visited-state">{{ presenter.add_mastectomy_or_lumpectomy_history_link.text }}</a><br>
5458
{% endset %}
5559

5660
{% set implanted_medical_device_history_html %}
@@ -60,7 +64,6 @@
6064
</a><br>
6165
{{ summaryList(presented_item.summary_list_params) }}
6266
{% endfor %}
63-
<a href="{{ presenter.add_implanted_medical_device_history_link.href }}" class="nhsuk-link nhsuk-link--no-visited-state">{{ presenter.add_implanted_medical_device_history_link.text }}</a><br>
6467
{% endset %}
6568

6669
{% set breast_augmentation_history_html %}
@@ -70,7 +73,6 @@
7073
</a><br>
7174
{{ summaryList(presented_item.summary_list_params) }}
7275
{% endfor %}
73-
<a href="{{ presenter.add_breast_augmentation_history_link.href }}" class="nhsuk-link nhsuk-link--no-visited-state">{{ presenter.add_breast_augmentation_history_link.text }}</a><br>
7476
{% endset %}
7577

7678
{% set other_procedure_history_html %}
@@ -80,7 +82,6 @@
8082
</a><br>
8183
{{ summaryList(presented_item.summary_list_params) }}
8284
{% endfor %}
83-
<a href="{{ presenter.add_other_procedure_history_link.href }}" class="nhsuk-link nhsuk-link--no-visited-state">{{ presenter.add_other_procedure_history_link.text }}</a><br>
8485
{% endset %}
8586

8687
{% set cyst_history_html %}
@@ -90,22 +91,15 @@
9091
</a><br>
9192
{{ summaryList(presented_item.summary_list_params) }}
9293
{% endfor %}
93-
<a href="{{ presenter.add_cyst_history_link.href }}" class="nhsuk-link nhsuk-link--no-visited-state">{{ presenter.add_cyst_history_link.text }}</a><br>
9494
{% endset %}
9595

96-
{% set non_cancerous_lump_diagnosis_link %}
97-
<a class="nhsuk-link" href="#">Enter non-cancerous lump diagnosis</a>
98-
{% endset %}
9996
{% set benign_lump_history_html %}
10097
{% for presented_item in presenter.benign_lump_history %}
10198
{{ summaryList(presented_item.summary_list_params) }}
10299
<p><a href="{{ presented_item.change_link.href }}" class="nhsuk-link nhsuk-link--no-visited-state">{{ presented_item.change_link.text }}</a></p>
103100
{% endfor %}
104-
<a href="{{ presenter.add_benign_lump_history_link.href }}" class="nhsuk-link nhsuk-link--no-visited-state">{{ presenter.add_benign_lump_history_link.text }}</a><br>
105-
{% endset %}
106-
{% set chest_procedures_link %}
107-
<a class="nhsuk-link" href="#">Enter other breast or chest procedures</a>
108101
{% endset %}
102+
109103
{{ summaryList({
110104
"rows": [
111105
{
@@ -206,6 +200,20 @@
206200
}
207201
]
208202
}) }}
203+
204+
<hr>
205+
<h3>Add medical history</h3>
206+
207+
<div class="nhsuk-button-group app-button-group--small">
208+
{% for button_info in presenter.medical_history_buttons %}
209+
{{ button({
210+
"text": button_info.text,
211+
"href": button_info.href,
212+
"classes": "nhsuk-button--secondary nhsuk-button--small"
213+
}) }}
214+
{% endfor %}
215+
</div>
216+
209217
{% endset %}
210218
{{ card({
211219
"heading": "Medical history",

manage_breast_screening/mammograms/presenters/medical_information_presenter.py

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,29 @@ def symptom_rows(self):
7979
return [symptom.summary_list_row for symptom in self.symptoms]
8080

8181
@property
82-
def add_lump_link(self):
82+
def symptom_buttons(self):
83+
return [
84+
self.add_lump_button,
85+
self.add_swelling_or_shape_change_button,
86+
self.add_skin_change_button,
87+
self.add_nipple_change_button,
88+
self.add_other_symptom_button,
89+
]
90+
91+
@property
92+
def medical_history_buttons(self):
93+
return [
94+
self.add_breast_cancer_history_button,
95+
self.add_implanted_medical_device_history_button,
96+
self.add_breast_augmentation_history_button,
97+
self.add_mastectomy_or_lumpectomy_history_button,
98+
self.add_cyst_history_button,
99+
self.add_benign_lump_history_button,
100+
self.add_other_procedure_history_button,
101+
]
102+
103+
@property
104+
def add_lump_button(self):
83105
url = reverse("mammograms:add_symptom_lump", kwargs={"pk": self.appointment.pk})
84106

85107
return {
@@ -92,7 +114,7 @@ def add_lump_link(self):
92114
}
93115

94116
@property
95-
def add_swelling_or_shape_change_link(self):
117+
def add_swelling_or_shape_change_button(self):
96118
url = reverse(
97119
"mammograms:add_symptom_swelling_or_shape_change",
98120
kwargs={"pk": self.appointment.pk},
@@ -109,7 +131,7 @@ def add_swelling_or_shape_change_link(self):
109131
}
110132

111133
@property
112-
def add_skin_change_link(self):
134+
def add_skin_change_button(self):
113135
url = reverse(
114136
"mammograms:add_symptom_skin_change",
115137
kwargs={"pk": self.appointment.pk},
@@ -125,7 +147,7 @@ def add_skin_change_link(self):
125147
}
126148

127149
@property
128-
def add_nipple_change_link(self):
150+
def add_nipple_change_button(self):
129151
url = reverse(
130152
"mammograms:add_symptom_nipple_change",
131153
kwargs={"pk": self.appointment.pk},
@@ -141,7 +163,7 @@ def add_nipple_change_link(self):
141163
}
142164

143165
@property
144-
def add_other_symptom_link(self):
166+
def add_other_symptom_button(self):
145167
url = reverse(
146168
"mammograms:add_symptom_other",
147169
kwargs={"pk": self.appointment.pk},
@@ -157,7 +179,7 @@ def add_other_symptom_link(self):
157179
}
158180

159181
@property
160-
def add_breast_cancer_history_link(self):
182+
def add_breast_cancer_history_button(self):
161183
url = reverse(
162184
"mammograms:add_breast_cancer_history_item",
163185
kwargs={"pk": self.appointment.pk},
@@ -169,7 +191,7 @@ def add_breast_cancer_history_link(self):
169191
}
170192

171193
@property
172-
def add_implanted_medical_device_history_link(self):
194+
def add_implanted_medical_device_history_button(self):
173195
url = reverse(
174196
"mammograms:add_implanted_medical_device_history_item",
175197
kwargs={"pk": self.appointment.pk},
@@ -181,7 +203,7 @@ def add_implanted_medical_device_history_link(self):
181203
}
182204

183205
@property
184-
def add_cyst_history_link(self):
206+
def add_cyst_history_button(self):
185207
url = reverse(
186208
"mammograms:add_cyst_history_item",
187209
kwargs={"pk": self.appointment.pk},
@@ -193,7 +215,7 @@ def add_cyst_history_link(self):
193215
}
194216

195217
@property
196-
def add_breast_augmentation_history_link(self):
218+
def add_breast_augmentation_history_button(self):
197219
url = reverse(
198220
"mammograms:add_breast_augmentation_history_item",
199221
kwargs={"pk": self.appointment.pk},
@@ -205,7 +227,7 @@ def add_breast_augmentation_history_link(self):
205227
}
206228

207229
@property
208-
def add_benign_lump_history_link(self):
230+
def add_benign_lump_history_button(self):
209231
url = reverse(
210232
"mammograms:add_benign_lump_history_item",
211233
kwargs={"pk": self.appointment.pk},
@@ -217,7 +239,7 @@ def add_benign_lump_history_link(self):
217239
}
218240

219241
@property
220-
def add_mastectomy_or_lumpectomy_history_link(self):
242+
def add_mastectomy_or_lumpectomy_history_button(self):
221243
url = reverse(
222244
"mammograms:add_mastectomy_or_lumpectomy_history_item",
223245
kwargs={"pk": self.appointment.pk},
@@ -229,7 +251,7 @@ def add_mastectomy_or_lumpectomy_history_link(self):
229251
}
230252

231253
@property
232-
def add_other_procedure_history_link(self):
254+
def add_other_procedure_history_button(self):
233255
url = reverse(
234256
"mammograms:add_other_procedure_history_item",
235257
kwargs={"pk": self.appointment.pk},

manage_breast_screening/mammograms/tests/presenters/test_medical_information_presenter.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ def test_formats_symptoms_summary_list(self):
7878
},
7979
]
8080

81-
def test_add_lump_link(self):
81+
def test_add_lump_button(self):
8282
appointment = AppointmentFactory()
8383

84-
assert MedicalInformationPresenter(appointment).add_lump_link == {
84+
assert MedicalInformationPresenter(appointment).add_lump_button == {
8585
"href": f"/mammograms/{appointment.pk}/record-medical-information/lump/",
8686
"text": "Add a lump",
8787
}
@@ -93,15 +93,15 @@ def test_add_lump_link(self):
9393
area=SymptomAreas.BOTH_BREASTS,
9494
)
9595

96-
assert MedicalInformationPresenter(appointment).add_lump_link == {
96+
assert MedicalInformationPresenter(appointment).add_lump_button == {
9797
"href": f"/mammograms/{appointment.pk}/record-medical-information/lump/",
9898
"text": "Add another lump",
9999
}
100100

101-
def test_add_nipple_change_link(self):
101+
def test_add_nipple_change_button(self):
102102
appointment = AppointmentFactory()
103103

104-
assert MedicalInformationPresenter(appointment).add_nipple_change_link == {
104+
assert MedicalInformationPresenter(appointment).add_nipple_change_button == {
105105
"href": f"/mammograms/{appointment.pk}/record-medical-information/nipple-change/",
106106
"text": "Add a nipple change",
107107
}
@@ -113,27 +113,27 @@ def test_add_nipple_change_link(self):
113113
area=SymptomAreas.BOTH_BREASTS,
114114
)
115115

116-
assert MedicalInformationPresenter(appointment).add_nipple_change_link == {
116+
assert MedicalInformationPresenter(appointment).add_nipple_change_button == {
117117
"href": f"/mammograms/{appointment.pk}/record-medical-information/nipple-change/",
118118
"text": "Add another nipple change",
119119
}
120120

121-
def test_add_breast_cancer_history_link(self):
121+
def test_add_breast_cancer_history_button(self):
122122
appointment = AppointmentFactory()
123123

124124
assert MedicalInformationPresenter(
125125
appointment
126-
).add_breast_cancer_history_link == {
126+
).add_breast_cancer_history_button == {
127127
"href": f"/mammograms/{appointment.pk}/record-medical-information/breast-cancer-history/",
128128
"text": "Add breast cancer history",
129129
}
130130

131-
def test_implanted_medical_device_history_link(self):
131+
def test_implanted_medical_device_history_button(self):
132132
appointment = AppointmentFactory()
133133

134134
assert MedicalInformationPresenter(
135135
appointment
136-
).add_implanted_medical_device_history_link == {
136+
).add_implanted_medical_device_history_button == {
137137
"href": f"/mammograms/{appointment.pk}/record-medical-information/implanted-medical-device-history/",
138138
"text": "Add implanted medical device history",
139139
}
@@ -188,40 +188,40 @@ def test_single_cyst_history_item_has_no_counter(self):
188188

189189
assert counters == [None]
190190

191-
def test_cyst_history_link(self):
191+
def test_cyst_history_button(self):
192192
appointment = AppointmentFactory()
193193

194-
assert MedicalInformationPresenter(appointment).add_cyst_history_link == {
194+
assert MedicalInformationPresenter(appointment).add_cyst_history_button == {
195195
"href": f"/mammograms/{appointment.pk}/record-medical-information/cyst-history/",
196196
"text": "Add cyst history",
197197
}
198198

199-
def test_breast_augmentation_history_link(self):
199+
def test_breast_augmentation_history_button(self):
200200
appointment = AppointmentFactory()
201201

202202
assert MedicalInformationPresenter(
203203
appointment
204-
).add_breast_augmentation_history_link == {
204+
).add_breast_augmentation_history_button == {
205205
"href": f"/mammograms/{appointment.pk}/record-medical-information/breast-augmentation-history/",
206206
"text": "Add breast augmentation history",
207207
}
208208

209-
def test_add_benign_lump_history_link(self):
209+
def test_add_benign_lump_history_button(self):
210210
appointment = AppointmentFactory()
211211

212212
assert MedicalInformationPresenter(
213213
appointment
214-
).add_benign_lump_history_link == {
214+
).add_benign_lump_history_button == {
215215
"href": f"/mammograms/{appointment.pk}/record-medical-information/benign-lump-history/",
216216
"text": "Add benign lump history",
217217
}
218218

219-
def test_mastectomy_or_lumpectomy_history_link(self):
219+
def test_mastectomy_or_lumpectomy_history_button(self):
220220
appointment = AppointmentFactory()
221221

222222
assert MedicalInformationPresenter(
223223
appointment
224-
).add_mastectomy_or_lumpectomy_history_link == {
224+
).add_mastectomy_or_lumpectomy_history_button == {
225225
"href": f"/mammograms/{appointment.pk}/record-medical-information/mastectomy-or-lumpectomy-history/",
226226
"text": "Add mastectomy or lumpectomy history",
227227
}
@@ -254,12 +254,12 @@ def test_single_mastectomy_or_lumpectomy_history_item_has_no_counter(self):
254254

255255
assert counters == [None]
256256

257-
def test_other_procedure_history_link(self):
257+
def test_other_procedure_history_button(self):
258258
appointment = AppointmentFactory()
259259

260260
assert MedicalInformationPresenter(
261261
appointment
262-
).add_other_procedure_history_link == {
262+
).add_other_procedure_history_button == {
263263
"href": f"/mammograms/{appointment.pk}/record-medical-information/other-procedure-history/",
264264
"text": "Add other procedure history",
265265
}

0 commit comments

Comments
 (0)