44{% from '_components/count/macro.jinja' import appCount %}
55{% from '_components/secondary-navigation/macro.jinja' import appSecondaryNavigation %}
66
7- {% set pageHeading %}
8- {% if filter == 'today' %}
9- Today’s clinics
10- {% elif filter == 'upcoming' %}
11- Upcoming clinics
12- {% elif filter == 'completed' %}
13- Completed clinics this week
14- {% else %}
15- All clinics this week
16- {% endif %}
17- {% endset %}
18-
197{% block content %}
20- < h1 > {{pageHeading }}</ h1 >
8+ < h1 > {{ presenter.heading }}</ h1 >
219
2210{% set ns = namespace() %}
2311{% set ns.secondaryNavItems = [] %}
2412
2513{% for item in [
26- { "id": 'today', "label": 'Today' },
27- { "id": 'upcoming', "label": 'Upcoming' },
28- { "id": 'completed', "label": 'Completed' },
29- { "id": 'all', "label": 'All' }
14+ { "id": 'today', "label": 'Today' },
15+ { "id": 'upcoming', "label": 'Upcoming' },
16+ { "id": 'completed', "label": 'Completed' },
17+ { "id": 'all', "label": 'All' }
3018] %}
3119{% set href %}/clinics/{{ item.id }}{% endset %}
3220{% set ns.secondaryNavItems = ns.secondaryNavItems + [{
33- "text": (item.label + " " + appCount(filteredClinicCounts [item.id])) | safe,
34- "href": href | trim,
35- "current": true if item.id == filter
21+ "text": (item.label + " " + appCount(presenter.counts_by_filter [item.id])) | safe,
22+ "href": href | trim,
23+ "current": true if item.id == presenter. filter
3624}] %}
3725{% endfor %}
3826
3927{{ appSecondaryNavigation({
40- "visuallyHiddenTitle": "Secondary menu",
41- "items": ns.secondaryNavItems
28+ "visuallyHiddenTitle": "Secondary menu",
29+ "items": ns.secondaryNavItems
4230}) }}
4331
44- {% if filteredClinics | length == 0 %}
32+ {% if presenter.clinics | length == 0 %}
4533< p > No clinics found.</ p >
4634{% else %}
4735< table class ="nhsuk-table ">
@@ -55,39 +43,31 @@ <h1>{{pageHeading}}</h1>
5543 </ tr >
5644 </ thead >
5745 < tbody class ="nhsuk-table__body ">
58- {% for clinic in filteredClinics | sort(false, false, 'starts_at') %}
59- {% set location = clinic.setting %}
60- {% set events = clinic.slots %}
46+ {% for clinic in presenter.clinics %}
6147 < tr >
6248 < td >
6349 < a href ="/clinics/{{ clinic.id }} " class ="nhsuk-link ">
64- {#- FIXME-#}
65- {% if location.type == 'mobile_unit' %}
66- {{ location.name }} at {{ clinic.siteName }}
67- {% else %}
68- {{ location.name }}
69- {% endif %}
50+ {{ clinic.location_name }}
7051 < br >
71- ({{ clinic.session_type() | capitalize }})
52+ ({{ clinic.session_type }})
7253 </ a >
7354 </ td >
74- < td > {{ clinic.starts_at | format_date | noWrap }}< br >
75- {{clinic.time_range() | format_time_range | as_hint }}
55+ < td > {{ clinic.starts_at | no_wrap }}< br >
56+ {{clinic.time_range | as_hint }}
7657 </ td >
7758 < td >
78- {{ clinic.get_type_display() | capitalize }}
59+ {{ clinic.type }}
7960 < br >
80- < span class ="app-text-grey "> {{ clinic.get_risk_type_display() | capitalize }}</ span >
81-
61+ < span class ="app-text-grey "> {{ clinic.risk_type }}</ span >
8262 </ td >
8363
8464 < td class ="nhsuk-table__cell--numeric ">
85- {{ events | length }}
65+ {{ clinic.number_of_slots }}
8666 </ td >
87- < td class =" nhsuk-table__cell--numeric " >
67+ < td >
8868 {{ tag({
89- "html": clinic.get_state_display() | noWrap ,
90- "classes": "nhsuk-tag--" + STATUS_COLORS[ clinic.state]
69+ "html": clinic.state.text | no_wrap ,
70+ "classes": clinic.state.classes
9171 })}}
9272 </ td >
9373 </ tr >
0 commit comments