Skip to content

Commit c81877f

Browse files
Update index page
1 parent bbbfe3b commit c81877f

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

app/routes/regions.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,17 @@ module.exports = router => {
22

33
router.get('/regions', (req, res) => {
44
const data = req.session.data
5-
const organisations = data.organisations.filter((organisation) => (organisation.region === "Y61") && (organisation.status != "Closed"))
5+
const organisations = data.organisations.filter((organisation) => (organisation.region === "Y61") && (["Active", "Deactivated"].includes(organisation.status)))
66

77
const closedOrganisationsCount = data.organisations.filter((organisation) => (organisation.region === "Y61" && organisation.status == "Closed")).length
88

9+
const awaitingApprovalOrganisationsCount = data.organisations.filter((organisation) => (organisation.region === "Y61" && organisation.status == "Applied")).length
10+
11+
912
res.render('regions/index', {
1013
organisations,
11-
closedOrganisationsCount
14+
closedOrganisationsCount,
15+
awaitingApprovalOrganisationsCount
1216
})
1317
})
1418

app/views/regions/index.html

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ <h1 class="nhsuk-heading-xl">North West</h1>
1818

1919
<p class="nhsuk-body-l">Once they’re set up, they can add other users and vaccination sites.</p>
2020

21-
<p class="nhsuk-body-l">You have <a href="/regions/awaiting-approval">4 organisations</a> awaiting approval.</p>
21+
{% if awaitingApprovalOrganisationsCount > 0 %}
22+
<p class="nhsuk-body-l">You have <a href="/regions/awaiting-approval">{{ awaitingApprovalOrganisationsCount | plural("organisation") }}</a> awaiting approval.</p>
23+
{% endif %}
2224

2325

2426
{% from 'inset-text/macro.njk' import insetText %}
@@ -38,14 +40,14 @@ <h1 class="nhsuk-heading-xl">North West</h1>
3840
<div class="nhsuk-grid-column-full">
3941

4042
<table class="nhsuk-table">
41-
<caption class="nhsuk-table__caption nhsuk-table__caption--m">Organisations added</caption>
43+
<caption class="nhsuk-table__caption nhsuk-table__caption--m">Current organisations</caption>
4244
<thead role="rowgroup" class="nhsuk-table__head">
4345
<tr role="row">
4446
<th role="columnheader" class="" scope="col">
45-
Organisation
47+
Name
4648
</th>
4749
<th role="columnheader" class="" scope="col">
48-
ODS code
50+
ODS&nbsp;code
4951
</th>
5052
<th role="columnheader" class="" scope="col">
5153
Type

0 commit comments

Comments
 (0)