|
1 | 1 | {% extends "wizard_step.jinja" %} |
2 | 2 | {% from "nhsuk/components/button/macro.jinja" import button %} |
3 | | -{% from "nhsuk/components/card/macro.jinja" import card %} |
4 | 3 | {% from "nhsuk/components/inset-text/macro.jinja" import insetText %} |
5 | 4 | {% from "nhsuk/components/summary-list/macro.jinja" import summaryList %} |
6 | 5 | {% from "components/participant-details/summary_list_rows.jinja" import last_mammogram_html %} |
7 | 6 | {% from "mammograms/medical_information/medical_history/cards/breast_cancer_history_card.jinja" import breast_cancer_history_card %} |
| 7 | +{% from "mammograms/components/card_with_status.jinja" import card_with_status %} |
8 | 8 |
|
9 | 9 | {% block step_content %} |
10 | 10 |
|
11 | | -{% call card({"heading": "Mammogram history"}) %} |
| 11 | +{% call card_with_status( |
| 12 | + section=sections.MAMMOGRAM_HISTORY, |
| 13 | + anchor=presenter.get_anchor(sections.MAMMOGRAM_HISTORY), |
| 14 | + status_tag_properties=presenter.review_status_tag_properties(sections.MAMMOGRAM_HISTORY), |
| 15 | + action_button_properties=presenter.review_action_button_properties(sections.MAMMOGRAM_HISTORY), |
| 16 | + csrf_input=csrf_input, |
| 17 | + ) %} |
12 | 18 | <p>The last confirmed mammogram and any added manually since then</p> |
13 | 19 |
|
14 | 20 | {{ summaryList({ |
|
29 | 35 | "href": presenter.add_mammogram_button.href, |
30 | 36 | "classes": "nhsuk-button--secondary nhsuk-button--small" |
31 | 37 | }) }} |
32 | | - |
33 | 38 | {% endcall %} |
34 | 39 |
|
35 | | -{% call card({ |
36 | | - "heading": "Symptoms", |
37 | | -}) %} |
| 40 | +{% call card_with_status( |
| 41 | + section=sections.SYMPTOMS, |
| 42 | + anchor=presenter.get_anchor(sections.SYMPTOMS), |
| 43 | + status_tag_properties=presenter.review_status_tag_properties(sections.SYMPTOMS), |
| 44 | + action_button_properties=presenter.review_action_button_properties(sections.SYMPTOMS), |
| 45 | + csrf_input=csrf_input, |
| 46 | + ) %} |
38 | 47 | <p {%- if not presenter.symptom_rows %} class="nhsuk-u-margin-bottom-3"{% endif %}>Any problems or symptoms, including lumps, swelling, rashes or nipple changes</p> |
39 | 48 | {% if presenter.symptom_rows %} |
40 | 49 | {{ summaryList({ |
|
64 | 73 | </div> |
65 | 74 | {% endcall %} |
66 | 75 |
|
67 | | -{% set medical_history_card_html %} |
| 76 | +{% call card_with_status( |
| 77 | + section=sections.MEDICAL_HISTORY, |
| 78 | + anchor=presenter.get_anchor(sections.MEDICAL_HISTORY), |
| 79 | + status_tag_properties=presenter.review_status_tag_properties(sections.MEDICAL_HISTORY), |
| 80 | + action_button_properties=presenter.review_action_button_properties(sections.MEDICAL_HISTORY), |
| 81 | + csrf_input=csrf_input, |
| 82 | + ) %} |
| 83 | + |
68 | 84 | {% set mastectomy_or_lumpectomy_history_html %} |
69 | 85 | {% for presented_item in presenter.mastectomy_or_lumpectomy_history %} |
70 | 86 | <a style="float: right" class="nhsuk-link nhsuk-link--no-visited-state" href="{{ presented_item.change_link.href}}"> |
|
199 | 215 | }) }} |
200 | 216 | {% endfor %} |
201 | 217 | </div> |
202 | | -{% endset %} |
203 | | - |
204 | | -{{ card({ |
205 | | - "heading": "Medical history", |
206 | | - "descriptionHtml": medical_history_card_html |
207 | | -}) }} |
| 218 | +{% endcall %} |
208 | 219 |
|
209 | | -{% set breast_features_card_html %} |
| 220 | +{% call card_with_status( |
| 221 | + section=sections.BREAST_FEATURES, |
| 222 | + anchor=presenter.get_anchor(sections.BREAST_FEATURES), |
| 223 | + status_tag_properties=presenter.review_status_tag_properties(sections.BREAST_FEATURES), |
| 224 | + action_button_properties=presenter.review_action_button_properties(sections.BREAST_FEATURES), |
| 225 | + csrf_input=csrf_input, |
| 226 | + ) %} |
210 | 227 | {% set breast_features_recorded = false %} |
211 | 228 |
|
212 | 229 | {% set insetHtml %} |
|
220 | 237 | <p class="nhsuk-u-margin-top-4 nhsuk-u-margin-bottom-0"> |
221 | 238 | <a href="#" class="nhsuk-link nhsuk-link--no-visited-state">{{ "Add another feature" if breast_features_recorded else "Add a feature" }}</a> |
222 | 239 | </p> |
223 | | -{% endset %} |
224 | | -{{ card({ |
225 | | - "heading": "Breast features", |
226 | | - "descriptionHtml": breast_features_card_html |
227 | | -}) }} |
228 | 240 |
|
229 | | -{% set other_information_card_html %} |
| 241 | + {% if presenter.breast_features_action_button %} |
| 242 | + {% if presenter.breast_features_action_button.is_anchor %} |
| 243 | + <a href="{{ presenter.breast_features_action_button.href }}" class="nhsuk-link {{ presenter.breast_features_action_button.classes }}"> |
| 244 | + {{ presenter.breast_features_action_button.text }} |
| 245 | + </a> |
| 246 | + {% else %} |
| 247 | + <form method="post" action="{{ presenter.breast_features_action_button.href }}" class="app-inline-form"> |
| 248 | + {{ csrf_input }} |
| 249 | + <button type="submit" class="nhsuk-link-button {{ presenter.breast_features_action_button.classes }}"> |
| 250 | + {{ presenter.breast_features_action_button.text }} |
| 251 | + </button> |
| 252 | + </form> |
| 253 | + {% endif %} |
| 254 | + {% endif %} |
| 255 | +{% endcall %} |
| 256 | + |
| 257 | +{% call card_with_status( |
| 258 | + section=sections.OTHER_INFORMATION, |
| 259 | + anchor=presenter.get_anchor(sections.OTHER_INFORMATION), |
| 260 | + status_tag_properties=presenter.review_status_tag_properties(sections.OTHER_INFORMATION), |
| 261 | + action_button_properties=presenter.review_action_button_properties(sections.OTHER_INFORMATION), |
| 262 | + csrf_input=csrf_input, |
| 263 | + ) %} |
230 | 264 | {% set hrt_link %} |
231 | 265 | <a class="nhsuk-link" href="#">Enter hormone replacement therapy (HRT)</a> |
232 | 266 | {% endset %} |
233 | 267 | {% set pregnancy_and_breastfeeding_link %} |
234 | 268 | <a class="nhsuk-link" href="#">Enter pregnancy and breastfeeding</a> |
235 | 269 | {% endset %} |
236 | | -{% endset %} |
237 | | -{{ card({ |
238 | | - "heading": "Other information", |
239 | | - "descriptionHtml": other_information_card_html |
240 | | -}) }} |
| 270 | + |
| 271 | + {% if presenter.other_information_action_button %} |
| 272 | + {% if presenter.other_information_action_button.is_anchor %} |
| 273 | + <a href="{{ presenter.other_information_action_button.href }}" class="nhsuk-link {{ presenter.other_information_action_button.classes }}"> |
| 274 | + {{ presenter.other_information_action_button.text }} |
| 275 | + </a> |
| 276 | + {% else %} |
| 277 | + <form method="post" action="{{ presenter.other_information_action_button.href }}" class="app-inline-form"> |
| 278 | + {{ csrf_input }} |
| 279 | + <button type="submit" class="nhsuk-link-button {{ presenter.other_information_action_button.classes }}"> |
| 280 | + {{ presenter.other_information_action_button.text }} |
| 281 | + </button> |
| 282 | + </form> |
| 283 | + {% endif %} |
| 284 | + {% endif %} |
| 285 | +{% endcall %} |
241 | 286 |
|
242 | 287 | {% endblock %} |
0 commit comments