1
- <!-- Use this page as the index for your project -->
2
-
3
- <!-- ADDING CUSTOM CSS - Add your custom CSS or Sass in /app/assets/sass/main.scss -->
4
-
5
- <!-- Extends the layout from /views/layout.html -->
1
+ <!-- File: app/views/test-page.html -->
6
2
{% extends 'layout.html' %}
7
- <!--
8
- In /views/layout.html you can:
9
- - change the header and footer
10
- - add custom CSS and JavaScript
11
- -->
12
-
13
- <!-- Set the page title -->
14
- {% block pageTitle %}
15
- Manage appointments
16
- {% endblock %}
17
-
18
- <!-- For adding a breadcrumb -->
19
- <!-- Code examples can be found at https://service-manual.nhs.uk/design-system/components/breadcrumbs -->
20
- {% block beforeContent %}
21
- {% endblock %}
22
3
23
- <!-- For adding a back link -->
24
- <!-- Code examples can be found at https://service-manual.nhs.uk/design-system/components/back-link -->
25
- {% block outerContent %}
4
+ {% block head %}
5
+ <!-- Include the accessible-autocomplete CSS from CDN -->
6
+ < link rel =" stylesheet " href =" https://cdn.jsdelivr.net/npm/[email protected] /dist/accessible-autocomplete.min.css " >
26
7
{% endblock %}
27
8
28
- <!-- For adding page content -->
29
- <!-- Page layout code can be found at https://service-manual.nhs.uk/design-system/styles/layout -->
30
9
{% block content %}
31
- < div class ="nhsuk-grid-row ">
32
- < div class ="nhsuk-grid-column-two-thirds ">
33
-
34
- <!-- Change the page title here -->
35
- < h1 >
36
- Choose a site
37
- </ h1 >
38
-
39
- <!--<p><a class="nhsuk-link" href="month">Hornsey Central Pharmacy</a></p>-->
40
- < p > < a class ="nhsuk-link " href ="site-overview "> Hornsey Central Pharmacy</ a > </ p >
41
- < p > < a class ="nhsuk-link " href ="site-overview "> Knightons Pharmacy</ a > </ p >
42
- < p > < a class ="nhsuk-link " href ="site-overview "> Whinchat Pharmacy</ a > </ p >
43
-
44
-
45
- <!-- End of content -->
46
-
10
+ < div class ="nhsuk-width-container ">
11
+ < main class ="nhsuk-main-wrapper " id ="main-content ">
12
+ < div class ="nhsuk-grid-row ">
13
+ < div class ="nhsuk-grid-column-two-thirds ">
14
+ < h1 > Site selection</ h1 >
15
+
16
+ < form method ="post " action ="site-overview ">
17
+ < div class ="nhsuk-form-group ">
18
+ < label class ="nhsuk-label " for ="location ">
19
+ Enter your location
20
+ </ label >
21
+
22
+ < div class ="nhsuk-hint " id ="location-hint ">
23
+ Start typing to see suggestions
24
+ </ div >
25
+
26
+ < div id ="location-container "> </ div >
27
+ < input type ="hidden " name ="location " id ="location-hidden ">
28
+ </ div >
29
+
30
+ < button class ="nhsuk-button " type ="submit "> Continue</ button >
31
+ </ form >
32
+ </ div >
47
33
</ div >
48
- </ div >
34
+ </ main >
35
+ </ div >
49
36
{% endblock %}
37
+
38
+ {% block bodyEnd %}
39
+ <!-- Include the accessible-autocomplete JS from CDN -->
40
+ < script src ="
https://cdn.jsdelivr.net/npm/[email protected] /dist/accessible-autocomplete.min.js "
> </ script >
41
+
42
+ < script >
43
+ document . addEventListener ( 'DOMContentLoaded' , function ( ) {
44
+ if ( typeof accessibleAutocomplete !== 'undefined' ) {
45
+ // Initialize the autocomplete directly
46
+ accessibleAutocomplete ( {
47
+ element : document . getElementById ( 'location-container' ) ,
48
+ id : 'location' ,
49
+ source : [ 'London' , 'Manchester' , 'Birmingham' , 'Hornsea Central Pharmacy' , 'Leeds' , 'Liverpool' ] ,
50
+ displayMenu : 'overlay' ,
51
+ confirmOnBlur : true ,
52
+ onConfirm : function ( selectedItem ) {
53
+ document . getElementById ( 'location-hidden' ) . value = selectedItem ;
54
+ }
55
+ } ) ;
56
+ } else {
57
+ console . error ( 'Accessible Autocomplete library not loaded' ) ;
58
+ }
59
+ } ) ;
60
+ </ script >
61
+ {% endblock %}
0 commit comments