3 TIME_FORMAT = '%l:%M %p';
6 time_format = TIME_FORMAT;
8 USE date (format = time_format);
9 today = date.format(format = '%Y-%m-%d ');
10 # We need to add "today" to the opening/closing hours for Date input
13 <h3>[% l('Opening hours') %]</h3>
15 <table title="[% l('Open Hours') %]" class="table table-striped w-auto">
18 <th scope="col">[% l('Day') %]</th>
19 <th scope="col">[% l('Hours') %]</th>
23 <td>[% l('Monday') %]</td>
26 open = today _ ctx.hours.dow_0_open;
27 close = today _ ctx.hours.dow_0_close;
28 note = ctx.hours.dow_0_note;
32 <div class="opening-hours">[% l('Closed') %]</div>
34 <div class="opening-hours" property="openingHoursSpecification" typeof="OpeningHoursSpecification"><link property="dayOfWeek" href="http://purl.org/goodrelations/v1#Monday" />[%
35 l('[_1] - [_2]', '<time property="opens" content="' _ date.format(open, format => '%H:%M:%S') _ '">' _ date.format(open) _ '</time>',
36 '<time property="closes" content="' _ date.format(close, format => '%H:%M:%S') _ '">' _ date.format(close) _ '</time>')
38 [% IF ctx.hours.dow_0_note %]
39 <span>[%l('(' _ note _ ')')%]</span>
46 <td>[% l('Tuesday') %]</td>
49 open = today _ ctx.hours.dow_1_open;
50 close = today _ ctx.hours.dow_1_close;
51 note = ctx.hours.dow_1_note;
54 <div class="opening-hours">[% l('Closed') %]</div>
56 <div class="opening-hours" property="openingHoursSpecification" typeof="OpeningHoursSpecification"><link property="dayOfWeek" href="http://purl.org/goodrelations/v1#Tuesday" />[%
57 l('[_1] - [_2]', '<time property="opens" content="' _ date.format(open, format => '%H:%M:%S') _ '">' _ date.format(open) _ '</time>',
58 '<time property="closes" content="' _ date.format(close, format => '%H:%M:%S') _ '">' _ date.format(close) _ '</time>')
60 [% IF ctx.hours.dow_1_note %]
61 <span>[%l('(' _ note _ ')')%]</span>
68 <td>[% l('Wednesday') %]</td>
71 open = today _ ctx.hours.dow_2_open;
72 close = today _ ctx.hours.dow_2_close;
73 note = ctx.hours.dow_2_note;
76 <div class="opening-hours">[% l('Closed') %]</div>
78 <div class="opening-hours" property="openingHoursSpecification" typeof="OpeningHoursSpecification"><link property="dayOfWeek" href="http://purl.org/goodrelations/v1#Wednesday" />[%
79 l('[_1] - [_2]', '<time property="opens" content="' _ date.format(open, format => '%H:%M:%S') _ '">' _ date.format(open) _ '</time>',
80 '<time property="closes" content="' _ date.format(close, format => '%H:%M:%S') _ '">' _ date.format(close) _ '</time>')
82 [% IF ctx.hours.dow_2_note %]
83 <span>[%l('(' _ note _ ')')%]</span>
90 <td>[% l('Thursday') %]</td>
93 open = today _ ctx.hours.dow_3_open;
94 close = today _ ctx.hours.dow_3_close;
95 note = ctx.hours.dow_3_note;
98 <div class="opening-hours">[% l('Closed') %]</div>
100 <div class="opening-hours" property="openingHoursSpecification" typeof="OpeningHoursSpecification"><link property="dayOfWeek" href="http://purl.org/goodrelations/v1#Thursday" />[%
101 l('[_1] - [_2]', '<time property="opens" content="' _ date.format(open, format => '%H:%M:%S') _ '">' _ date.format(open) _ '</time>',
102 '<time property="closes" content="' _ date.format(close, format => '%H:%M:%S') _ '">' _ date.format(close) _ '</time>')
104 [% IF ctx.hours.dow_3_note %]
105 <span>[%l('(' _ note _ ')')%]</span>
112 <td>[% l('Friday') %]</td>
115 open = today _ ctx.hours.dow_4_open;
116 close = today _ ctx.hours.dow_4_close;
117 note = ctx.hours.dow_4_note;
120 <div class="opening-hours">[% l('Closed') %]</div>
122 <div class="opening-hours" property="openingHoursSpecification" typeof="OpeningHoursSpecification"><link property="dayOfWeek" href="http://purl.org/goodrelations/v1#Friday" />[%
123 l('[_1] - [_2]', '<time property="opens" content="' _ date.format(open, format => '%H:%M:%S') _ '">' _ date.format(open) _ '</time>',
124 '<time property="closes" content="' _ date.format(close, format => '%H:%M:%S') _ '">' _ date.format(close) _ '</time>')
126 [% IF ctx.hours.dow_4_note %]
127 <span>[%l('(' _ note _ ')')%]</span>
134 <td>[% l('Saturday') %]</td>
137 open = today _ ctx.hours.dow_5_open;
138 close = today _ ctx.hours.dow_5_close;
139 note = ctx.hours.dow_5_note;
142 <div class="opening-hours">[% l('Closed') %]</div>
144 <div class="opening-hours" property="openingHoursSpecification" typeof="OpeningHoursSpecification"><link property="dayOfWeek" href="http://purl.org/goodrelations/v1#Saturday" />[%
145 l('[_1] - [_2]', '<time property="opens" content="' _ date.format(open, format => '%H:%M:%S') _ '">' _ date.format(open) _ '</time>',
146 '<time property="closes" content="' _ date.format(close, format => '%H:%M:%S') _ '">' _ date.format(close) _ '</time>')
148 [% IF ctx.hours.dow_5_note %]
149 <span>[%l('(' _ note _ ')')%]</span>
156 <td>[% l('Sunday') %]</td>
159 open = today _ ctx.hours.dow_6_open;
160 close = today _ ctx.hours.dow_6_close;
161 note = ctx.hours.dow_6_note;
164 <div class="opening-hours">[% l('Closed') %]</div>
166 <div class="opening-hours" property="openingHoursSpecification" typeof="OpeningHoursSpecification"><link property="dayOfWeek" href="http://purl.org/goodrelations/v1#Sunday" />[%
167 l('[_1] - [_2]', '<time property="opens" content="' _ date.format(open, format => '%H:%M:%S') _ '">' _ date.format(open) _ '</time>',
168 '<time property="closes" content="' _ date.format(close, format => '%H:%M:%S') _ '">' _ date.format(close) _ '</time>')
170 [% IF ctx.hours.dow_6_note %]
171 <span>[%l('(' _ note _ ')')%]</span>
180 <h3>[% l('Upcoming closures') %]</h3>
182 [% IF ctx.closed_dates.size %]
183 <table title="[% l('Closed Dates') %]" class="table table-striped w-auto">
186 <th scope="col">[% l('Date') %]</th>
187 <th scope="col">[% l('Reason for Closure') %]</th>
190 [% FOR cdate IN ctx.closed_dates %]
193 [% display_start_date = date.format(ctx.parse_datetime(cdate.close_start), DATE_FORMAT) %]
194 [% display_end_date = date.format(ctx.parse_datetime(cdate.close_end), DATE_FORMAT) %]
195 [% display_start_time = date.format(ctx.parse_datetime(cdate.close_start), TIME_FORMAT) %]
196 [% display_end_time = date.format(ctx.parse_datetime(cdate.close_end), TIME_FORMAT) %]
198 [% display_start_date %]
199 [% IF cdate.full_day == 'f'; %]
200 [% display_start_time %] -
201 [% IF display_start_date != display_end_date %]
202 [% display_end_date %]
204 [% display_end_time %]
206 [% IF cdate.multi_day == 't' %]
207 - [% display_end_date %]
210 <td>[% cdate.reason %]</td>
215 [% l("No closures scheduled") %]