-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.html
318 lines (286 loc) · 13.3 KB
/
index.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
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
---
layout: default
---
<div class="row">
<div class='col-md-10 col-md-offset-1'>
<br />
<br />
<div class="input-group input-group-lg col-sm-8 col-sm-offset-2">
<input type="text" class="form-control" placeholder="Enter your address to find who represents you" id="address" name="address" >
<span class="input-group-btn">
<button class="btn btn-info" type="submit" id="address-search"><i class='fa fa-search'></i> <span class='hidden-xs hidden-sm'>Search</span></button>
<button class="btn btn-default" type="submit" id="find-me"><i class='fa fa-crosshairs'></i> <span class='hidden-xs hidden-sm'>Find me</span> </button>
</span>
</div>
<br />
</div>
</div>
<div class="row">
<div class='col-md-10 col-md-offset-1'>
<div id='no-response-container' class='text-center' style="display:none;">
<h1><i class='fa fa-exclamation-triangle'></i> </h1>
<h3>No representatives found</h3>
<p>We couldn't find any representatives for that address. Please try again.</p>
</div>
<div id='response-container' style="display:none;">
<div class='text-center' id='address-image'></div>
<br />
<br />
<p class="lead text-center" id='results-nav'>
Levels of local government<br />
<span id='local-nav' style='display: none;'>
<a id="local-name-nav" href="#local-name"></a>
</span>
<span id='county-nav' style='display: none;'>
<a id="county-name-nav" href="#county-name"></a>
<!-- <i class='fa fa-long-arrow-right'></i> -->
</span>
<!-- <span id='state-nav' style='display: none;'>
<a id="state-name-nav" href="#state-name"></a>
<i class='fa fa-long-arrow-right'></i>
</span>
<a href="#federal-name">Federal</a></li> -->
</ul>
</p>
<hr />
<div id='local-container'>
<br />
<h3 class='text-center' id="local-name"></h3>
<table id="local-results" class="table table-striped table-responsive">
<thead>
<tr>
<th></th>
<th>Representative</th>
<th class='hidden-xs hidden-sm'><i class='fa fa-institution'></i> Office</th>
<th class='hidden-xs'><i class='fa fa-map-marker'></i> Address</th>
<th><i class='fa fa-external-link'></i> Links</th>
<th></th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<div id='local-container-not-found' style='display: none;' class='text-center'>
<h3 class='text-center' id="local-name-not-found"></h3>
<p>We couldn't find any representatives for this area</p>
</div>
<div id='county-container'>
<br />
<h3 class='text-center' id="county-name"></h3>
<table id="county-results" class="table table-striped table-responsive">
<thead>
<tr>
<th></th>
<th>Representative</th>
<th class='hidden-xs hidden-sm'><i class='fa fa-institution'></i> Office</th>
<th class='hidden-xs'><i class='fa fa-map-marker'></i> Address</th>
<th><i class='fa fa-external-link'></i> Links</th>
<th></th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<div id='county-container-not-found' style='display: none;' class='text-center'>
<h3 class='text-center' id="county-name-not-found"></h3>
<p>We couldn't find any representatives for this area</p>
</div>
<!-- <div id='state-container'>
<br />
<h3 class='text-center' id="state-name"></h3>
<table id="state-results" class="table table-striped table-responsive">
<thead>
<tr>
<th></th>
<th>Representative</th>
<th class='hidden-xs hidden-sm'><i class='fa fa-institution'></i> Office</th>
<th class='hidden-xs'><i class='fa fa-map-marker'></i> Address</th>
<th><i class='fa fa-external-link'></i> Links</th>
<th></th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<h3 id='federal-name' class='text-center'>United States Federal Government</h3>
<table id="federal-results" class="table table-striped table-responsive">
<thead>
<tr>
<th></th>
<th>Representative</th>
<th class='hidden-xs hidden-sm'><i class='fa fa-institution'></i> Office</th>
<th class='hidden-xs'><i class='fa fa-map-marker'></i> Address</th>
<th><i class='fa fa-external-link'></i> Links</th>
<th></th>
</tr>
</thead>
<tbody></tbody>
</table> -->
</div>
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="contactModal" tabindex="-1" role="dialog" aria-labelledby="contactModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="contactModalLabel"></h4>
</div>
<div class="modal-body" id='modalContent'>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal"><i class='fa fa-times'></i> Close</button>
</div>
</div>
</div>
</div>
<script id="tableGuts" type="text/EJS">
<% $.each(people, function(i, info){ %>
<tr>
<td>
<% if (info.person.photoUrl) { %>
<img class="img-rounded headshot" src="<%= info.person.photoUrl %>" alt="<%= info.person.name %>" title="<%= info.person.name %>" />
<% } else { %>
<img class="img-rounded headshot" src="/images/blank-person.jpg" alt="<%= info.person.name %>" title="<%= info.person.name %>" />
<% } %>
</td>
<td>
<%= info.person.name %> <%= formatParty(info.person.party) %>
<span class='visible-xs-block visible-sm-block'><%= info.office.name %></span>
</td>
<td class='hidden-xs hidden-sm'><%= info.office.name %></td>
<td class='hidden-xs'>
<% if (info.address) { %>
<% $.each(info.address, function(i, addr){ %>
<p>
<%= toTitleCase(addr.line1) %><br />
<% if (addr.line2) { %>
<%= toTitleCase(addr.line2) %><br />
<% } %>
<% if (addr.line3) { %>
<%= toTitleCase(addr.line3) %><br />
<% } %>
<%= toTitleCase(addr.city) %>, <%= addr.state.toUpperCase() %> <%= addr.zip %>
</p>
<% }) %>
<% } %>
</td>
<td>
<% if (info.channels || info.urls){ %>
<span class='hidden-xs hidden-sm'>
<% if (info.channels){ %>
<% $.each(info.channels, function(i, channel){ %>
<a href="<%= channel.link %>" target="_blank"><i class="fa fa-fw fa-<%= channel.icon %>"> </i></a>
<% }) %>
<% } %>
<% if (info.urls){ %>
<% $.each(info.urls, function(i, url){ %>
<a href="<%= url %>" target="_blank"><i class="fa fa-fw fa-globe"> </i></a>
<% }) %>
<% } %>
</span>
<span class='visible-xs-inline visible-sm-inline'>
<% if (info.channels){ %>
<% $.each(info.channels, function(i, channel){ %>
<a href="<%= channel.link %>" target="_blank"><i class="fa fa-fw fa-<%= channel.icon %>"> </i></a>
<% }) %>
<% } %>
<% if (info.urls){ %>
<% $.each(info.urls, function(i, url){ %>
<a href="<%= url %>" target="_blank"><i class="fa fa-fw fa-globe"> </i></a>
<% }) %>
<% } %>
</span>
<% } %>
</td>
<% if (info.phones || info.emails){ %>
<td class='nowrap'>
<button type="button" class="btn btn-default btn-contact" data-toggle="modal" data-id="<%= info.pseudo_id %>">
Contact <i class='fa fa-chevron-right'></i>
</button>
</td>
<% } else { %>
<td></td>
<% } %>
</tr>
<% }) %>
</script>
<script id="modalGuts" type="text/EJS">
<div class='row'>
<div class='col-xs-4'>
<% if (info.person.photoUrl) { %>
<img class="img-rounded img-responsive" src="<%= info.person.photoUrl %>" alt="<%= info.person.name %>" title="<%= info.person.name %>" />
<% } else { %>
<img class="img-rounded img-responsive" src="/images/blank-person.jpg" alt="<%= info.person.name %>" title="<%= info.person.name %>" />
<% } %>
<br />
<strong><%= info.person.name %> <%= formatParty(info.person.party) %></strong><br />
<%= info.office.name %><br />
<%= info.jurisdiction %>
</div>
<div class='col-xs-8'>
<p><strong>Tell <%= info.person.name %> to support participatory budgeting!</strong></p>
<p>The most effective way to engage with an elected official is to <strong>send them an email or call their office</strong> to schedule a meeting.</p>
<p>Tell them why your community needs greater say over how funds are spent. Here’s a <a href='https://docs.google.com/document/d/1wzJlmpDI4fDP9yCwpFH7fgMH1Pt2gAlvjv1nSsrRaVU/edit' target='_blank'>sample email</a> template to get you started.
<hr />
<% if (info.phones){ %>
<% $.each(info.phones, function(i, phone){ %>
<% if ((i + 1) < info.phones.length){ %>
<i class='fa fa-fw fa-phone'></i> <%= phone %><br />
<% } else { %>
<i class='fa fa-fw fa-phone'></i> <%= phone %>
<% } %>
<% }) %>
<br />
<% } %>
<% if (info.emails){ %>
<% $.each(info.emails, function(i, email){ %>
<% if ((i + 1) < info.emails.length){ %>
<i class='fa fa-fw fa-envelope'></i> <a href='mailto:<%= email %>'><%= email %></a><br />
<% } else { %>
<i class='fa fa-fw fa-envelope'></i> <a href='mailto:<%= email %>'><%= email %></a>
<% } %>
<% }) %>
<% } %>
</div>
</div>
</script>
<script src="/js/lookup_tool.js"></script>
<script type='text/javascript'>
//<![CDATA[
$(function() {
var autocomplete = new google.maps.places.Autocomplete(document.getElementById('address'));
$("#address").val(convertToPlainString($.address.parameter('address')));
if ($("#address").val())
addressSearch();
$('#address-search').click(function(){
addressSearch();
});
$("#results-nav a").click(function(e) {
e.preventDefault();
var scroll_to = $($("#" + e.target.id).attr('href'));
$('html, body').animate({
scrollTop: scroll_to.offset().top
}, 1000);
});
$('#find-me').click(function(){
findMe();
return false;
});
// $('#reset').click(function(){
// myMap.reset();
// return false;
// });
$(":text").keydown(function(e){
var key = e.keyCode ? e.keyCode : e.which;
if(key === 13) {
$('#address-search').click();
return false;
}
});
});
//]]>
</script>