File tree Expand file tree Collapse file tree 3 files changed +51
-14
lines changed
Expand file tree Collapse file tree 3 files changed +51
-14
lines changed Original file line number Diff line number Diff line change 11module . exports = router => {
22
33
4+ router . get ( '/lists' , ( req , res ) => {
5+
6+ const currentOrganisation = res . locals . currentOrganisation ;
7+ const lists = currentOrganisation . lists || [ ]
8+
9+ res . render ( 'lists/index' , {
10+ lists
11+ } )
12+
13+ } )
14+
15+ router . post ( '/lists/add-numbers' , ( req , res ) => {
16+
17+ const currentOrganisation = res . locals . currentOrganisation ;
18+ currentOrganisation . lists ||= [ ]
19+
20+ // This bit isn’t working yet so faked for now.
21+ currentOrganisation . lists . push ( {
22+ siteCode : "TODO"
23+ } )
24+
25+ res . redirect ( '/lists/list' )
26+
27+ } )
428
529}
Original file line number Diff line number Diff line change 1919 }) }}
2020 {% endif %}
2121
22+ < form action ="/lists/add-numbers " method ="post " novalidate >
23+
2224< h1 class ="nhsuk-heading-l "> Add a list of NHS numbers</ h1 >
2325
2426< p class ="nhsuk-body-m "> Copy and paste NHS numbers from a spreadsheet or another source.</ p >
@@ -43,10 +45,9 @@ <h1 class="nhsuk-heading-l">Add a list of NHS numbers</h1>
4345
4446
4547 {{ button({
46- text: "Confirm",
47- href: "/lists/list"
48+ text: "Confirm"
4849 }) }}
49-
50+ </ form >
5051
5152{% endblock %}
5253
Original file line number Diff line number Diff line change @@ -17,22 +17,34 @@ <h1 class="nhsuk-heading-l">Lists</h1>
1717
1818 < p class ="nhsuk-body-m "> To save time when you record vaccinations, you can add a list of NHS numbers.</ p >
1919
20- < h2 class ="nhsuk-heading-m "> How it works</ h2 >
21-
22- < p > Add a list of NHS numbers and we will match them to patient details.</ p >
23- < p > This means you will not have to input each patient's NHS number when you record vaccinations.</ p >
24- {{ button({
25- text: "Add a list",
26- href: "/lists/team"
20+ {% set howItWorksHtml %}
21+ < p > Add a list of NHS numbers and we will match them to patient details.</ p >
22+ < p > This means you will not have to input each patient's NHS number when you record vaccinations.</ p >
23+ {% endset %}
24+
25+ {% if (lists | length) > 0 %}
26+ {{ details({
27+ text: "How it works",
28+ html: howItWorksHtml
2729 }) }}
2830
29- < br > < br >
31+ < ul class ="nhsuk-list xnhsuk-u-margin-top-6 nhsuk-u-margin-bottom-6 ">
32+ < li > < a href ="/lists/team-lists "> Anne Ward Maternity Unit</ a > </ li >
33+ < li > < a href ="/lists/team-lists "> St Mary’s Hospital </ a > </ li >
34+ </ ul >
35+
36+ {% else %}
37+ < h2 class ="nhsuk-heading-m "> How it works</ h2 >
38+
39+ {{ howItWorksHtml | safe }}
3040
31- < h2 class =" nhsuk-heading-m " > Sites or teams </ h2 >
41+ {% endif %}
3242
33- < p class ="nhsuk-body-m "> < a href ="/lists/team-lists "> Anne Ward Maternity Unit</ a > </ p >
3443
35- < p class ="nhsuk-body-m "> < a href ="/lists/team-lists "> St Mary’s Hospital</ a > </ p >
44+ {{ button({
45+ text: "Add a list",
46+ href: "/lists/team"
47+ }) }}
3648
3749 </ div >
3850 </ div >
You can’t perform that action at this time.
0 commit comments