forked from hackforla/food-oasis-la
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathlocation-details.html
256 lines (215 loc) · 9.32 KB
/
location-details.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
---
layout: default
include_map: true
include_back: true
stylesheets:
- "https://api.tiles.mapbox.com/mapbox-gl-js/v0.48.0/mapbox-gl.css"
---
<header class="location-summary">
{% assign category = page['category'] | downcase | replace: ' ', '-' %}
{% if
category == 'food-pantry' or
category == 'summer-lunch' or
category == 'community-garden' or
category == 'farmers-market' or
category == 'supermarket' or
category == 'restaurant' or
category == 'orchard' or
category == 'pop-up-market' %}
<img src="/assets/images/home/{{ category }}.svg" width="100" alt="" />
{% elsif category == 'cultivate-la' %}
<img src="/assets/images/home/community-garden.svg" width="100" alt="" />
{% else %}
<img src="/assets/images/home/supermarket.svg" width="100" alt="" />
{% endif %}
<h1>{{ page.name }}</h1>
<p class="address">
{{ page['address_1'] }}
{% if page['address_2'] and page['address_2'] != '' %}
<br />
{{ page['address_2'] }}
{% endif %}
<br />
{{ page['city'] }}, California {{ page['zip'] }}
</p>
{% if
category == 'food-pantry' or
category == 'summer-lunch' or
category == 'community-garden' or
category == 'farmers-market' or
category == 'supermarket' %}
<p class="type"><a href="/{{ category }}">{{ page['category'] }}</a></p>
{% else %}
<p class="type">{{ page['category'] }}</p>
{% endif %}
<script type="text/template" class="open-template">
<p class="open">Open Now</p>
</script>
<script type="text/template" class="distance-template" data-latitude="{{ data['latitude'] }}" data-longitude="{{ data['longitude'] }}">
<p class="distance"><span></span> <abbr title="miles">mi</abbr></p>
</script>
</header>
{% include location-details-options.html %}
{% comment %}
{% if page['formatted_daycode1'] %}
<section class="hours">
<h2>Hours</h2>
{% assign days = "Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday" | split: ", " %}
<dl>
{% assign i = 0 %}
{% for day in days %}
{% assign i = i | plus:1 %}
{% assign daycodei = 'daycode' | append: i %}
{% assign formatted_daycodei = 'formatted_daycode' | append: i %}
{% assign dayi_open = 'day' | append: i | append: '_open' %}
{% assign dayi_close = 'day' | append: i | append: '_close' %}
{% assign formatted_dayi_open = 'formatted_day' | append: i | append: '_open' %}
{% assign formatted_dayi_close = 'formatted_day' | append: i | append: '_close' %}
<dt data-day="{{ page[daycodei] }}">{{ day }}</dt>
{% if page[formatted_daycodei] == day %}
<dd data-day="{{ page[daycodei] }}" data-open="{{ page[dayi_open] }}" data-close="{{ page[dayi_close] }}"><span>{{ page[formatted_dayi_open] }} – {{ page[formatted_dayi_close] }}</span></dd>
{% else %}
<dd><i>Closed</i></dd>
{% endif %}
{% endfor %}
</dl>
</section>
{% endif %}
{% endcomment %}
{% comment %}
TODO: Consider updating generate-locations.js to make a simple loop like this possible (and then replace the “SHIM” below)…
{% if page['formatted_days'] %}
<section class="hours">
<h2>Hours</h2>
<dl>
{% for day in page['formatted_days'] %}
{% if page['daycode'] %}
<dt data-day="{{ page['daycode'] }}">{{ page['formatted_daycode'] }}</dt>
<dd data-day="{{ page['daycode'] }}" data-open="{{ day['open'] }}" data-close="{{ day['close'] }}"><span>{{ page['formatted_open'] }} – {{ page['formatted_close'] }}</span></dd>
{% else %}
<dd><i>Closed</i></dd>
{% endif %}
{% endfor %}
</dl>
</section>
{% endif %}
{% endcomment %}
{% if page['season_open'] and page['season_open'] != '' and page['season_close'] and page['season_close'] != '' %}
<section class="dates">
<h2>Dates</h2>
<p>{{ page['season_open'] }} – {{ page['season_close'] }}</p>
</section>
{% endif %}
{% comment %}
SHIM: Support days in any order, in the spreadsheet.
{% endcomment %}
{% if
page['formatted_daycode1'] or
page['formatted_daycode2'] or
page['formatted_daycode3'] or
page['formatted_daycode4'] or
page['formatted_daycode5'] or
page['formatted_daycode6'] or
page['formatted_daycode7'] %}
<section class="hours">
<h2>Hours</h2>
{% assign days = "Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday" | split: ", " %}
<dl>
{% for day in days %}
{% if page['formatted_daycode1'] == day %}
<dt data-day="{{ page['daycode1'] }}">{{ day }}</dt>
<dd data-day="{{ page['daycode1'] }}" data-open="{{ page['day1_open'] }}" data-close="{{ page['day1_close'] }}"><span>{{ page['formatted_day1_open'] }} – {{ page['formatted_day1_close'] }}</span></dd>
{% elsif page['formatted_daycode2'] == day %}
<dt data-day="{{ page['daycode2'] }}">{{ day }}</dt>
<dd data-day="{{ page['daycode2'] }}" data-open="{{ page['day2_open'] }}" data-close="{{ page['day2_close'] }}"><span>{{ page['formatted_day2_open'] }} – {{ page['formatted_day2_close'] }}</span></dd>
{% elsif page['formatted_daycode3'] == day %}
<dt data-day="{{ page['daycode3'] }}">{{ day }}</dt>
<dd data-day="{{ page['daycode3'] }}" data-open="{{ page['day3_open'] }}" data-close="{{ page['day3_close'] }}"><span>{{ page['formatted_day3_open'] }} – {{ page['formatted_day3_close'] }}</span></dd>
{% elsif page['formatted_daycode4'] == day %}
<dt data-day="{{ page['daycode4'] }}">{{ day }}</dt>
<dd data-day="{{ page['daycode4'] }}" data-open="{{ page['day4_open'] }}" data-close="{{ page['day4_close'] }}"><span>{{ page['formatted_day4_open'] }} – {{ page['formatted_day4_close'] }}</span></dd>
{% elsif page['formatted_daycode5'] == day %}
<dt data-day="{{ page['daycode5'] }}">{{ day }}</dt>
<dd data-day="{{ page['daycode5'] }}" data-open="{{ page['day5_open'] }}" data-close="{{ page['day5_close'] }}"><span>{{ page['formatted_day5_open'] }} – {{ page['formatted_day5_close'] }}</span></dd>
{% elsif page['formatted_daycode6'] == day %}
<dt data-day="{{ page['daycode6'] }}">{{ day }}</dt>
<dd data-day="{{ page['daycode6'] }}" data-open="{{ page['day6_open'] }}" data-close="{{ page['day6_close'] }}"><span>{{ page['formatted_day6_open'] }} – {{ page['formatted_day6_close'] }}</span></dd>
{% elsif page['formatted_daycode7'] == day %}
<dt data-day="{{ page['daycode7'] }}">{{ day }}</dt>
<dd data-day="{{ page['daycode7'] }}" data-open="{{ page['day7_open'] }}" data-close="{{ page['day7_close'] }}"><span>{{ page['formatted_day7_open'] }} – {{ page['formatted_day7_close'] }}</span></dd>
{% else %}
<dt>{{ day }}</dt>
<dd><i>Closed</i></dd>
{% endif %}
{% endfor %}
</dl>
</section>
{% endif %}
{% if page['website'] != '' or page['phone'] != '' %}
<section class="information">
<h2>Information</h2>
<dl>
{% if page['website'] and page['website'] != '' %}
<dt>Website</dt>
<dd><a href="{{ page['website'] }}">{{ page['website'] }}</a></dd>
{% endif %}
{% if page['phone'] and page['phone'] != '' %}
<dt>Phone</dt>
<dd>{{ page['phone'] }}</dd>
{% endif %}
{% if page['facebook'] and page['facebook'] != '' %}
<dt>Facebook</dt>
<dd><a href="{{ page['facebook'] }}">{{ page['facebook'] }}</a></dd>
{% endif %}
{% if page['instagram'] and page['instagram'] != '' %}
<dt>Instagram</dt>
<dd><a href="{{ page['instagram'] }}">{{ page['instagram'] }}</a></dd>
{% endif %}
{% if page['twitter'] and page['twitter'] != '' %}
<dt>Twitter</dt>
<dd><a href="{{ page['twitter'] }}">{{ page['twitter'] }}</a></dd>
{% endif %}
</dl>
</section>
{% endif %}
{{ page['notes'] | markdownify }}
{{ content }}
<section class="note">
<h2>This location’s address and hours may have changed.</h2>
{% if page['phone'] != '' %}
<p>
Before you visit, please call this location’s phone number: {{ page['phone'] }} and ask them for their address and hours.
</p>
{% else %}
<p>
Before you visit, please contact this location and ask them for their address and hours.
</p>
{% endif %}
</section>
<section class="location-details-options">
<h2>Options</h2>
<ul class="options action secondary">
<li><a href="mailto:contact@foodoasis.la?subject=Claim Business, {{ page.name }}, Food Oasis LA&body=Hello team at Food Oasis LA. I’d like to claim this business… {{ page.name }}: https://foodoasis.la{{ page.url }}">Claim Business</a></li>
<li><a href="https://form.jotform.com/62638504761156?businessName={{ page.name }}&address={{ page.address_1 }}&category={{ page.category }}&longitude={{ page.longitude }}&latitude={{ page.latitude }}">Report Issue</a></li>
</ul>
</section>
<script src="https://api.tiles.mapbox.com/mapbox-gl-js/v0.48.0/mapbox-gl.js"></script>
<!-- For location-details.js -->
<script type="text/template" id="marker-template">
<div class="marker {{ page['category'] | downcase | replace: ' ', '-' }}-marker active"></div>
</script>
<script>
var LOCATION_DETAILS = {
latitude: {{ page['latitude'] }},
longitude: {{ page['longitude'] }}
}
</script>
<!-- Jim’s Google Maps API key -->
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBP5KxqO9v1sLhXlkrG3vDiDdOJvYLJ0H4"></script>
<script src="/assets/js/helpers.js"></script>
<script src="/assets/js/geolocate.js"></script>
<script src="/assets/js/location-details.js"></script>
<!-- MailChimp subscription popup -->
<!--
<script type="text/javascript" src="//s3.amazonaws.com/downloads.mailchimp.com/js/signup-forms/popup/embed.js" data-dojo-config="usePlainJson: true, isDebug: false"></script><script type="text/javascript">require(["mojo/signup-forms/Loader"], function(L) { L.start({"baseUrl":"mc.us15.list-manage.com","uuid":"cc58c677c486e6ca3ca80afe6","lid":"e77a0f6b67"}) })</script>
-->