|
1 |
| -{% extends 'layouts/base.html' %} |
2 |
| -{% from "govuk_frontend_jinja/components/table/macro.html" import govukTable %} |
3 |
| -{%- from "components/filter-group/macro.jinja" import dlFilterGroup %} |
4 |
| - |
5 |
| -{% set containerClasses = 'reporting-page' %} |
6 |
| - |
7 |
| -{% block beforeContent %} |
8 |
| -<div class="govuk-breadcrumbs reporting-overview-container"> |
9 |
| - <ol class="govuk-breadcrumbs__list"> |
10 |
| - <li class="govuk-breadcrumbs__list-item"> |
11 |
| - <a class="govuk-breadcrumbs__link" href="{{ url_for('base.index') }}">Home</a> |
12 |
| - </li> |
13 |
| - <li class="govuk-breadcrumbs__list-item"> |
14 |
| - ODP Summary |
15 |
| - </li> |
16 |
| - </ol> |
17 |
| -</div> |
18 |
| -{% endblock beforeContent %} |
19 |
| - |
20 |
| -{% block content %} |
21 |
| - |
22 |
| -<div class="reporting-overview-container"> |
23 |
| - |
24 |
| - <div class="govuk-grid-row govuk-heading-l"> |
25 |
| - <div class="govuk-grid-column-one-third govuk-!-text-align-centre"> |
26 |
| - <a href="{{ url_for('reporting.odp_status_summary')}}" class="govuk-link govuk-link--no-visited-state">Status</a> |
27 |
| - </div> |
28 |
| - <div class="govuk-grid-column-one-third govuk-!-text-align-centre"> |
29 |
| - <a href="{{ url_for('reporting.odp_issue_summary')}}" class="govuk-link govuk-link--no-visited-state govuk-link--no-underline">Issue</a> |
30 |
| - </div> |
31 |
| - <div class="govuk-grid-column-one-third govuk-!-text-align-centre"> |
32 |
| - <a href="{{ url_for('reporting.odp_conformance_summary')}}" class="govuk-link govuk-link--no-visited-state govuk-link--no-underline">Conformance</a> |
33 |
| - </div> |
34 |
| - </div> |
35 |
| - |
36 |
| - <hr class="govuk-section-break--visible govuk-section-break--l" /> |
37 |
| - |
38 |
| - <div class="govuk-grid-row"> |
39 |
| - <div class="govuk-grid-column-one-half"> |
40 |
| - <form action="?cohort=cohortSelection&dataset_type=" method="GET"> |
41 |
| - <legend class="govuk-fieldset__legend govuk-fieldset__legend--l"> |
42 |
| - <h1 class="govuk-fieldset__heading"> |
43 |
| - Filter dataset type and cohort |
44 |
| - </h1> |
45 |
| - </legend> |
46 |
| - |
47 |
| - <div class="govuk-grid-row govuk-!-padding-bottom-2"> |
48 |
| - <div class="govuk-grid-column-one-half"> |
49 |
| - {% call dlFilterGroup({ |
50 |
| - "title": "Dataset type:", |
51 |
| - "is_open": True, |
52 |
| - "selected": odp_statuses_summary.params.selected_dataset_types|length |
53 |
| - }) %} |
54 |
| - <div class="govuk-checkboxes" data-module="govuk-checkboxes"> |
55 |
| - {% for dataset_type in odp_statuses_summary.params.dataset_types %} |
56 |
| - <div class="govuk-checkboxes__item"> |
57 |
| - <input class="govuk-checkboxes__input" id="{{dataset_type.id}}Dataset" name="dataset_type" type="checkbox" value="{{dataset_type.id}}"> |
58 |
| - <label class="govuk-label govuk-checkboxes__label" for="dataset_type"> |
59 |
| - {{dataset_type.name}} |
60 |
| - </label> |
61 |
| - </div> |
62 |
| - {% endfor %} |
63 |
| - </div> |
64 |
| - {% endcall %} |
65 |
| - </div> |
66 |
| - <div class="govuk-grid-column-one-half"> |
67 |
| - {% call dlFilterGroup({ |
68 |
| - "title": "Cohort:", |
69 |
| - "is_open": True, |
70 |
| - "selected": odp_statuses_summary.params.selected_cohorts|length |
71 |
| - }) %} |
72 |
| - <div class="govuk-checkboxes" data-module="govuk-checkboxes"> |
73 |
| - {% for cohort in odp_statuses_summary.params.cohorts %} |
74 |
| - <div class="govuk-checkboxes__item"> |
75 |
| - <input class="govuk-checkboxes__input" id="{{cohort.id}}" name="cohort" type="checkbox" value="{{cohort.id}}"> |
76 |
| - <label class="govuk-label govuk-checkboxes__label" for="cohort"> |
77 |
| - {{cohort.name}} |
78 |
| - </label> |
79 |
| - </div> |
80 |
| - {% endfor %} |
81 |
| - </div> |
82 |
| - {% endcall %} |
83 |
| - </div> |
84 |
| - </div> |
85 |
| - |
86 |
| - <div class="govuk-button-group"> |
87 |
| - <button type="submit" class="govuk-button" data-module="govuk-button"> |
88 |
| - Apply Filter |
89 |
| - </button> |
90 |
| - <a class="govuk-link" href="{{ url_for('reporting.download_csv')}}?type=odp-status" id="download-button"> |
91 |
| - Download Current Table |
92 |
| - </a> |
93 |
| - </div> |
94 |
| - </form> |
95 |
| - </div> |
96 |
| - <div class="govuk-grid-column-one-half"> |
97 |
| - <h1 class="govuk-heading-l">Overview stats:</h1> |
98 |
| - <div class="govuk-grid-row"> |
99 |
| - <p class="govuk-body govuk-grid-column-two-thirds">No. of LPAs: |
100 |
| - <p class="govuk-body govuk-grid-column-one-third govuk-!-font-size-19">{{odp_statuses_summary.number_of_lpas}}</p> |
101 |
| - </div> |
102 |
| - <div class="govuk-grid-row"> |
103 |
| - <p class="govuk-body govuk-grid-column-two-thirds">No. of datasets added: |
104 |
| - <p class="govuk-body govuk-grid-column-one-third govuk-!-font-size-19">{{odp_statuses_summary.datasets_added}}/{{odp_statuses_summary.max_datasets}}</p> |
105 |
| - </div> |
106 |
| - <div class="govuk-grid-row"> |
107 |
| - <p class="govuk-body govuk-grid-column-two-thirds">% of datasets added:</p> |
108 |
| - <p class="govuk-body govuk-grid-column-one-third">{{ odp_statuses_summary.percentage_datasets_added }}</p> |
109 |
| - </div> |
110 |
| - </div> |
111 |
| - </div> |
112 |
| -</div> |
113 |
| - |
114 |
| -<div class="reporting-table-container"> |
115 |
| - {{ govukTable({ |
116 |
| - "head": odp_statuses_summary.headers, |
117 |
| - "rows": odp_statuses_summary.rows, |
118 |
| - "classes": "reporting-table" |
119 |
| - }) }} |
120 |
| -</div> |
121 |
| - |
122 |
| -<script {% if config["ENV"] == "production" %}nonce="{{ csp_nonce() }}"{% endif %}> |
123 |
| - // autofill form with current filters based on query parameters and generate download link |
124 |
| - const url = new URL(window.location.href) |
125 |
| - const dataset_type_params = url.searchParams.getAll("dataset_type") |
126 |
| - const cohort_params = url.searchParams.getAll("cohort") |
127 |
| - |
128 |
| - let dataset_type_string = "" |
129 |
| - dataset_type_params.forEach((dataset_type) => { |
130 |
| - document.getElementById(dataset_type.concat("Dataset")).checked="checked" |
131 |
| - if (dataset_type_string == "") { |
132 |
| - dataset_type_string = "dataset_type=".concat(dataset_type) |
133 |
| - } else { |
134 |
| - dataset_type_string += "&dataset_type=".concat(dataset_type) |
135 |
| - } |
136 |
| - }) |
137 |
| - |
138 |
| - let cohort_string = "" |
139 |
| - cohort_params.forEach((cohort) => { |
140 |
| - document.getElementById(cohort).checked="checked" |
141 |
| - if (cohort_string == "") { |
142 |
| - cohort_string = "cohort=".concat(cohort) |
143 |
| - } else { |
144 |
| - cohort_string += "&cohort=".concat(cohort) |
145 |
| - } |
146 |
| - }) |
147 |
| - // set download link href |
148 |
| - let search_params= "" |
149 |
| - if (dataset_type_string && cohort_string) { |
150 |
| - search_params = "&".concat(dataset_type_string).concat("&").concat(cohort_string) |
151 |
| - } else if (dataset_type_string) { |
152 |
| - search_params = "&".concat(dataset_type_string) |
153 |
| - } else if (cohort_string) { |
154 |
| - search_params = "&".concat(cohort_string) |
155 |
| - } else { |
156 |
| - search_params = "" |
157 |
| - } |
158 |
| - const link = "{{ url_for('reporting.download_csv') | safe}}".concat("?type=odp-status").concat(search_params) |
159 |
| - document.getElementById("download-button").setAttribute("href", link) |
160 |
| -</script> |
161 |
| - |
162 |
| -{% endblock content %} |
| 1 | +{% extends 'layouts/base.html' %} |
| 2 | +{% from "govuk_frontend_jinja/components/table/macro.html" import govukTable %} |
| 3 | +{%- from "components/filter-group/macro.jinja" import dlFilterGroup %} |
| 4 | + |
| 5 | +{% set containerClasses = 'reporting-page' %} |
| 6 | + |
| 7 | +{% block beforeContent %} |
| 8 | +<div class="govuk-breadcrumbs reporting-overview-container"> |
| 9 | + <ol class="govuk-breadcrumbs__list"> |
| 10 | + <li class="govuk-breadcrumbs__list-item"> |
| 11 | + <a class="govuk-breadcrumbs__link" href="{{ url_for('base.index') }}">Home</a> |
| 12 | + </li> |
| 13 | + <li class="govuk-breadcrumbs__list-item"> |
| 14 | + ODP Summary |
| 15 | + </li> |
| 16 | + </ol> |
| 17 | +</div> |
| 18 | +{% endblock beforeContent %} |
| 19 | + |
| 20 | +{% block content %} |
| 21 | + |
| 22 | +<div class="reporting-overview-container"> |
| 23 | + |
| 24 | + <div class="govuk-grid-row govuk-heading-l"> |
| 25 | + <div class="govuk-grid-column-one-third govuk-!-text-align-centre"> |
| 26 | + <a href="{{ url_for('reporting.odp_status_summary')}}" class="govuk-link govuk-link--no-visited-state">Status</a> |
| 27 | + </div> |
| 28 | + <div class="govuk-grid-column-one-third govuk-!-text-align-centre"> |
| 29 | + <a href="{{ url_for('reporting.odp_issue_summary')}}" class="govuk-link govuk-link--no-visited-state govuk-link--no-underline">Issue</a> |
| 30 | + </div> |
| 31 | + <div class="govuk-grid-column-one-third govuk-!-text-align-centre"> |
| 32 | + <a href="{{ url_for('reporting.odp_conformance_summary')}}" class="govuk-link govuk-link--no-visited-state govuk-link--no-underline">Conformance</a> |
| 33 | + </div> |
| 34 | + </div> |
| 35 | + |
| 36 | + <hr class="govuk-section-break--visible govuk-section-break--l" /> |
| 37 | + |
| 38 | + <div class="govuk-grid-row"> |
| 39 | + <div class="govuk-grid-column-one-half"> |
| 40 | + <form action="?cohort=cohortSelection&dataset_type=" method="GET"> |
| 41 | + <legend class="govuk-fieldset__legend govuk-fieldset__legend--l"> |
| 42 | + <h1 class="govuk-fieldset__heading"> |
| 43 | + Filter dataset type and cohort |
| 44 | + </h1> |
| 45 | + </legend> |
| 46 | + |
| 47 | + <div class="govuk-grid-row govuk-!-padding-bottom-2"> |
| 48 | + <div class="govuk-grid-column-one-half"> |
| 49 | + {% call dlFilterGroup({ |
| 50 | + "title": "Dataset type:", |
| 51 | + "is_open": True, |
| 52 | + "selected": odp_statuses_summary.params.selected_dataset_types|length |
| 53 | + }) %} |
| 54 | + <div class="govuk-checkboxes" data-module="govuk-checkboxes"> |
| 55 | + {% for dataset_type in odp_statuses_summary.params.dataset_types %} |
| 56 | + <div class="govuk-checkboxes__item"> |
| 57 | + <input class="govuk-checkboxes__input" id="{{dataset_type.id}}Dataset" name="dataset_type" type="checkbox" value="{{dataset_type.id}}"> |
| 58 | + <label class="govuk-label govuk-checkboxes__label" for="dataset_type"> |
| 59 | + {{dataset_type.name}} |
| 60 | + </label> |
| 61 | + </div> |
| 62 | + {% endfor %} |
| 63 | + </div> |
| 64 | + {% endcall %} |
| 65 | + </div> |
| 66 | + <div class="govuk-grid-column-one-half"> |
| 67 | + {% call dlFilterGroup({ |
| 68 | + "title": "Cohort:", |
| 69 | + "is_open": True, |
| 70 | + "selected": odp_statuses_summary.params.selected_cohorts|length |
| 71 | + }) %} |
| 72 | + <div class="govuk-checkboxes" data-module="govuk-checkboxes"> |
| 73 | + {% for cohort in odp_statuses_summary.params.cohorts %} |
| 74 | + <div class="govuk-checkboxes__item"> |
| 75 | + <input class="govuk-checkboxes__input" id="{{cohort.id}}" name="cohort" type="checkbox" value="{{cohort.id}}"> |
| 76 | + <label class="govuk-label govuk-checkboxes__label" for="cohort"> |
| 77 | + {{cohort.name}} |
| 78 | + </label> |
| 79 | + </div> |
| 80 | + {% endfor %} |
| 81 | + </div> |
| 82 | + {% endcall %} |
| 83 | + </div> |
| 84 | + </div> |
| 85 | + |
| 86 | + <div class="govuk-button-group"> |
| 87 | + <button type="submit" class="govuk-button" data-module="govuk-button"> |
| 88 | + Apply Filter |
| 89 | + </button> |
| 90 | + <a class="govuk-link" href="{{ url_for('reporting.download_csv')}}?type=odp-status" id="download-button"> |
| 91 | + Download Current Table |
| 92 | + </a> |
| 93 | + </div> |
| 94 | + </form> |
| 95 | + </div> |
| 96 | + <div class="govuk-grid-column-one-half"> |
| 97 | + <h1 class="govuk-heading-l">Overview stats:</h1> |
| 98 | + <div class="govuk-grid-row"> |
| 99 | + <p class="govuk-body govuk-grid-column-two-thirds">No. of LPAs: |
| 100 | + <p class="govuk-body govuk-grid-column-one-third govuk-!-font-size-19">{{odp_statuses_summary.number_of_lpas}}</p> |
| 101 | + </div> |
| 102 | + <div class="govuk-grid-row"> |
| 103 | + <p class="govuk-body govuk-grid-column-two-thirds">No. of LPAs with some <data value=""></data>: |
| 104 | + <p class="govuk-body govuk-grid-column-one-third govuk-!-font-size-19">{{odp_statuses_summary.lpa_some_data_provided}}</p> |
| 105 | + </div> |
| 106 | + <div class="govuk-grid-row"> |
| 107 | + <p class="govuk-body govuk-grid-column-two-thirds">No. of LPAs with 100% data: |
| 108 | + <p class="govuk-body govuk-grid-column-one-third govuk-!-font-size-19">{{odp_statuses_summary.lpa_all_data_provided}}</p> |
| 109 | + </div> |
| 110 | + <div class="govuk-grid-row"> |
| 111 | + <p class="govuk-body govuk-grid-column-two-thirds">No. of datasets added: |
| 112 | + <p class="govuk-body govuk-grid-column-one-third govuk-!-font-size-19">{{odp_statuses_summary.datasets_added}}/{{odp_statuses_summary.max_datasets}}</p> |
| 113 | + </div> |
| 114 | + <div class="govuk-grid-row"> |
| 115 | + <p class="govuk-body govuk-grid-column-two-thirds">% of datasets added:</p> |
| 116 | + <p class="govuk-body govuk-grid-column-one-third">{{ odp_statuses_summary.percentage_datasets_added }}</p> |
| 117 | + </div> |
| 118 | + </div> |
| 119 | + </div> |
| 120 | +</div> |
| 121 | + |
| 122 | +<div class="reporting-table-container"> |
| 123 | + {{ govukTable({ |
| 124 | + "head": odp_statuses_summary.headers, |
| 125 | + "rows": odp_statuses_summary.rows, |
| 126 | + "classes": "reporting-table" |
| 127 | + }) }} |
| 128 | +</div> |
| 129 | + |
| 130 | +<script {% if config["ENV"] == "production" %}nonce="{{ csp_nonce() }}"{% endif %}> |
| 131 | + // autofill form with current filters based on query parameters and generate download link |
| 132 | + const url = new URL(window.location.href) |
| 133 | + const dataset_type_params = url.searchParams.getAll("dataset_type") |
| 134 | + const cohort_params = url.searchParams.getAll("cohort") |
| 135 | + |
| 136 | + let dataset_type_string = "" |
| 137 | + dataset_type_params.forEach((dataset_type) => { |
| 138 | + document.getElementById(dataset_type.concat("Dataset")).checked="checked" |
| 139 | + if (dataset_type_string == "") { |
| 140 | + dataset_type_string = "dataset_type=".concat(dataset_type) |
| 141 | + } else { |
| 142 | + dataset_type_string += "&dataset_type=".concat(dataset_type) |
| 143 | + } |
| 144 | + }) |
| 145 | + |
| 146 | + let cohort_string = "" |
| 147 | + cohort_params.forEach((cohort) => { |
| 148 | + document.getElementById(cohort).checked="checked" |
| 149 | + if (cohort_string == "") { |
| 150 | + cohort_string = "cohort=".concat(cohort) |
| 151 | + } else { |
| 152 | + cohort_string += "&cohort=".concat(cohort) |
| 153 | + } |
| 154 | + }) |
| 155 | + // set download link href |
| 156 | + let search_params= "" |
| 157 | + if (dataset_type_string && cohort_string) { |
| 158 | + search_params = "&".concat(dataset_type_string).concat("&").concat(cohort_string) |
| 159 | + } else if (dataset_type_string) { |
| 160 | + search_params = "&".concat(dataset_type_string) |
| 161 | + } else if (cohort_string) { |
| 162 | + search_params = "&".concat(cohort_string) |
| 163 | + } else { |
| 164 | + search_params = "" |
| 165 | + } |
| 166 | + const link = "{{ url_for('reporting.download_csv') | safe}}".concat("?type=odp-status").concat(search_params) |
| 167 | + document.getElementById("download-button").setAttribute("href", link) |
| 168 | +</script> |
| 169 | + |
| 170 | +{% endblock content %} |
0 commit comments