|
| 1 | +{% from "tables/macro.jinja" import table %} |
| 2 | +{% from "components/filters.jinja" import filters %} |
| 3 | +{% from "card/macro.jinja" import card %} |
| 4 | + |
| 5 | + |
| 6 | +{% extends 'layouts/dashboard.jinja' %} |
| 7 | + |
| 8 | +{% block pageTitle %}Consent report | {{ app_title }}{% endblock %} |
| 9 | + |
| 10 | +{% block dashboard_content %} |
| 11 | + |
| 12 | +<div class="nhsuk-grid-row"> |
| 13 | + <div class="app-grid-column-filters"> |
| 14 | + {{ filters({ |
| 15 | + "programmes": programmes, |
| 16 | + "year_groups": year_groups, |
| 17 | + "genders": genders, |
| 18 | + "current_filters": current_filters or {}, |
| 19 | + "form_action": url_for('main.consents', workgroup=team.workgroup) |
| 20 | + }) }} |
| 21 | + </div> |
| 22 | + |
| 23 | + <div id="dashboard" class="app-grid-column-content"> |
| 24 | + |
| 25 | + <div class="nhsuk-card-group nhsuk-grid-row app-card-group"> |
| 26 | + <div class="nhsuk-grid-column-one-third nhsuk-card-group__item app-card-group__item"> |
| 27 | + {{ card({ |
| 28 | + "classes": "app-card app-card--blue", |
| 29 | + "heading": "Cohort", |
| 30 | + "headingClasses": "nhsuk-heading-xs", |
| 31 | + "headingLevel": 3, |
| 32 | + "descriptionHtml": "<p class='nhsuk-card__description'>" ~ data.cohort | thousands ~ "<span class='nhsuk-card__caption'>children</span></p>", |
| 33 | + }) }} |
| 34 | + </div> |
| 35 | + |
| 36 | + <div class="nhsuk-grid-column-one-third nhsuk-card-group__item app-card-group__item"> |
| 37 | + {{ card({ |
| 38 | + "classes": "app-card app-card--red", |
| 39 | + "heading": "No consent", |
| 40 | + "headingClasses": "nhsuk-heading-xs", |
| 41 | + "headingLevel": 3, |
| 42 | + "descriptionHtml": "<p class='nhsuk-card__description'>" ~ data.no_consent_percentage | percentage ~ "<span class='nhsuk-card__caption'>" ~ data.no_consent | thousands ~ " children</span></p>", |
| 43 | + }) }} |
| 44 | + </div> |
| 45 | + |
| 46 | + <div class="nhsuk-grid-column-one-third nhsuk-card-group__item app-card-group__item"> |
| 47 | + {{ card({ |
| 48 | + "classes": "app-card app-card--green", |
| 49 | + "heading": "Consent given", |
| 50 | + "headingClasses": "nhsuk-heading-xs", |
| 51 | + "headingLevel": 3, |
| 52 | + "descriptionHtml": "<p class='nhsuk-card__description'>" ~ data.consent_given_percentage | percentage ~ "<span class='nhsuk-card__caption'>" ~ data.consent_given | thousands ~ " children</span></p>", |
| 53 | + }) }} |
| 54 | + </div> |
| 55 | + |
| 56 | + <div class="nhsuk-grid-column-one-half nhsuk-card-group__item app-card-group__item"> |
| 57 | + {{ card({ |
| 58 | + "classes": "app-card", |
| 59 | + "heading": "Consent requested", |
| 60 | + "headingClasses": "nhsuk-heading-xs", |
| 61 | + "headingLevel": 3, |
| 62 | + "descriptionHtml": "<p class='nhsuk-card__description'>" ~ data.consent_requested_percentage | percentage ~ "<span class='nhsuk-card__caption'>" ~ data.consent_requested | thousands ~ " children</span></p>", |
| 63 | + }) }} |
| 64 | + </div> |
| 65 | + |
| 66 | + <div class="nhsuk-grid-column-one-half nhsuk-card-group__item app-card-group__item"> |
| 67 | + {{ card({ |
| 68 | + "classes": "app-card", |
| 69 | + "heading": "No response", |
| 70 | + "headingClasses": "nhsuk-heading-xs", |
| 71 | + "headingLevel": 3, |
| 72 | + "descriptionHtml": "<p class='nhsuk-card__description'>" ~ data.consent_no_response_percentage | percentage ~ "<span class='nhsuk-card__caption'>" ~ data.consent_no_response | thousands ~ " children</span></p>", |
| 73 | + }) }} |
| 74 | + </div> |
| 75 | + |
| 76 | + <div class="nhsuk-grid-column-one-third nhsuk-card-group__item app-card-group__item"> |
| 77 | + {{ card({ |
| 78 | + "classes": "app-card", |
| 79 | + "heading": "Parent refused", |
| 80 | + "headingClasses": "nhsuk-heading-xs", |
| 81 | + "headingLevel": 3, |
| 82 | + "descriptionHtml": "<p class='nhsuk-card__description'>" ~ data.parent_refused_consent_percentage | percentage ~ "<span class='nhsuk-card__caption'>" ~ data.parent_refused_consent | thousands ~ " children</span></p>", |
| 83 | + }) }} |
| 84 | + </div> |
| 85 | + |
| 86 | + <div class="nhsuk-grid-column-one-third nhsuk-card-group__item app-card-group__item"> |
| 87 | + {{ card({ |
| 88 | + "classes": "app-card", |
| 89 | + "heading": "Child refused", |
| 90 | + "headingClasses": "nhsuk-heading-xs", |
| 91 | + "headingLevel": 3, |
| 92 | + "descriptionHtml": "<p class='nhsuk-card__description'>" ~ data.child_refused_vaccination_percentage | percentage ~ "<span class='nhsuk-card__caption'>" ~ data.child_refused_vaccination | thousands ~ " children</span></p>", |
| 93 | + }) }} |
| 94 | + </div> |
| 95 | + |
| 96 | + <div class="nhsuk-grid-column-one-third nhsuk-card-group__item app-card-group__item"> |
| 97 | + {{ card({ |
| 98 | + "classes": "app-card", |
| 99 | + "heading": "Conflicting consent", |
| 100 | + "headingClasses": "nhsuk-heading-xs", |
| 101 | + "headingLevel": 3, |
| 102 | + "descriptionHtml": "<p class='nhsuk-card__description'>" ~ data.consent_conflicts_percentage | percentage ~ "<span class='nhsuk-card__caption'>" ~ data.consent_conflicts | thousands ~ " children</span></p>", |
| 103 | + }) }} |
| 104 | + </div> |
| 105 | + </div> |
| 106 | + |
| 107 | + {% set refusal_rows = [] %} |
| 108 | + {% if data.refusal_reasons %} |
| 109 | + {% for reason, count in data.refusal_reasons.items() %} |
| 110 | + {% set _ = refusal_rows.append([ |
| 111 | + { "text": reason | humanize }, |
| 112 | + { "text": count | thousands, "format": "numeric" } |
| 113 | + ]) %} |
| 114 | + {% endfor %} |
| 115 | + {% else %} |
| 116 | + {% set _ = refusal_rows.append([ |
| 117 | + { "text": "No data", "colspan": 2 } |
| 118 | + ]) %} |
| 119 | + {% endif %} |
| 120 | + |
| 121 | + {{ table({ |
| 122 | + "heading": "Reasons for parental refusal", |
| 123 | + "tableClasses": "nhsuk-table--data nhsuk-table--green", |
| 124 | + "panel": true, |
| 125 | + "head": [ |
| 126 | + { "text": "Reason"}, |
| 127 | + { "text": "Count", "format": "numeric" } |
| 128 | + ], |
| 129 | + "rows": refusal_rows |
| 130 | + }) }} |
| 131 | + |
| 132 | + {% set consent_rows = [] %} |
| 133 | + {% if data.consent_routes %} |
| 134 | + {% for method, count in data.consent_routes.items() %} |
| 135 | + {% set _ = consent_rows.append([ |
| 136 | + { "text": method | humanize }, |
| 137 | + { "text": count | thousands, "format": "numeric" } |
| 138 | + ]) %} |
| 139 | + {% endfor %} |
| 140 | + {% else %} |
| 141 | + {% set _ = consent_rows.append([ |
| 142 | + { "text": "No data", "colspan": 2 } |
| 143 | + ]) %} |
| 144 | + {% endif %} |
| 145 | + |
| 146 | + {{ table({ |
| 147 | + "heading": "Types of consent", |
| 148 | + "tableClasses": "nhsuk-table--data nhsuk-table--green", |
| 149 | + "panel": true, |
| 150 | + "head": [ |
| 151 | + { "text": "Method"}, |
| 152 | + { "text": "Count", "format": "numeric" } |
| 153 | + ], |
| 154 | + "rows": consent_rows |
| 155 | + }) }} |
| 156 | + |
| 157 | + <p class="nhsuk-body-m nhsuk-u-margin-bottom-6"> |
| 158 | + This data was last updated on <strong>{{ last_updated_time }}</strong>. |
| 159 | + </p> |
| 160 | + |
| 161 | + </div> |
| 162 | +</div> |
| 163 | + |
| 164 | +{% endblock %} |
0 commit comments