-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy path_template.html
233 lines (212 loc) · 10.1 KB
/
_template.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
{%- extends "bootstrap/base.html" %}
{% import "bootstrap/utils.html" as utils %}
{% block title %}Nomad: Share your ride!{% endblock %}
{% block scripts %}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/moment.min.js" integrity="sha256-1hjUhpc44NwiNg8OwMu2QzJXhD8kcj+sJA3aCQZoUjg=" crossorigin="anonymous"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js/date-time-picker.min.js') }}"></script>
<!--[if lt IE 9]>
<script type="text/javascript" src="{{ url_for('static', filename='js/es5-shim.min.js') }}"></script>
<![endif]-->
<script type="text/javascript" src="{{ url_for('static', filename='js/map-styles.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js/script.js') }}"></script>
<script type="text/javascript">
function updateHeaderSearchTarget() {
var rideSelect = $("#ride-select").val();
if (rideSelect == "find-ride") {
$("#ride-select-form").attr("action", "{{ url_for('carpool.find') }}");
} else if (rideSelect == "give-ride") {
$("#ride-select-form").attr("action", "{{ url_for('carpool.new') }}");
}
}
$(function() {
var csrf_token = "{{ csrf_token() }}";
$.ajaxSetup({
beforeSend: function(xhr, settings) {
if (!/^(GET|HEAD|OPTIONS|TRACE)$/i.test(settings.type) && !this.crossDomain) {
xhr.setRequestHeader("X-CSRFToken", csrf_token);
}
}
});
$("#ride-select").change(function() {
updateHeaderSearchTarget();
});
});
function initMap() {
const fromOptions = {
types: ['(regions)'],
componentRestrictions: {country: 'us'},
};
$('.location-input').each(function (idx, el) {
const fromAutocomplete = new google.maps.places.Autocomplete(el, fromOptions);
fromAutocomplete.addListener('place_changed', function() {
const place = fromAutocomplete.getPlace().geometry;
if (!place) { // autocomplete did not geocode user text; clear coords
$('.ride-form input[name="lat"]').val();
$('.ride-form input[name="lng"]').val();
return;
}
const loc = place.location;
if (location.href.indexOf($('#ride-select-form').attr('action')) >= 0) {
// if on find page already, re-order and re-zoom
setLatLng(loc.lat(), loc.lng());
} else {
// go to find/give with lat/lng params
$('.ride-form input[name="lat"]').val(loc.lat());
$('.ride-form input[name="lng"]').val(loc.lng());
$('.ride-form').submit();
}
});
});
if (typeof localInitMap === "function") {
localInitMap();
}
}
function doLogout() {
$.post("{{ url_for('auth.logout') }}")
.done(function (data) {
location.href = data;
});
}
</script>
<script src="https://maps.googleapis.com/maps/api/js?key={{config.get('GOOGLE_MAPS_API_KEY')}}&libraries=places&callback=initMap" async defer></script>
{% if config.get('INTERCOM_KEY') %}
<script>
window.intercomSettings = {
app_id: "{{config.get('INTERCOM_KEY')}}"
};
</script>
<script>(function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',intercomSettings);}else{var d=document;var i=function(){i.c(arguments)};i.q=[];i.c=function(args){i.q.push(args)};w.Intercom=i;function l(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/{{config.get('INTERCOM_KEY')}}';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);}if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})()</script>
{% endif %}
{% if config.get('GOOGLE_ANALYTICS_ID') %}
<!-- Global Site Tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id={{ config.get('GOOGLE_ANALYTICS_ID') }}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '{{ config.get("GOOGLE_ANALYTICS_ID") }}');
</script>
{% endif %}
{% endblock %}
{% block styles %}
{{super()}}
<link href="https://fonts.googleapis.com/css?family=Merriweather:400,700|Source+Sans+Pro:300,400,600,700" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/styles.css') }}">
{% if config.get('BRANDING_CSS_URL') %}
<link rel="stylesheet" type="text/css" href="{{config.get('BRANDING_CSS_URL')}}">
{% endif %}
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="{{ url_for('static', filename='img/favicon/apple-touch-icon-144x144.png') }}" />
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="{{ url_for('static', filename='img/favicon/apple-touch-icon-152x152.png') }}" />
<link rel="icon" type="image/png" href="{{ url_for('static', filename='img/favicon/favicon-32x32.png') }}" sizes="32x32" />
<link rel="icon" type="image/png" href="{{ url_for('static', filename='img/favicon/favicon-16x16.png') }}" sizes="16x16" />
<meta name="application-name" content="Nomad"/>
<meta name="msapplication-TileColor" content="#FFFFFF" />
<meta name="msapplication-TileImage" content="{{ url_for('static', filename='img/favicon/mstile-144x144.png') }}" />
{% endblock %}
{% import "bootstrap/fixes.html" as fixes %}
{% block head %}
{{super()}}
{{fixes.ie8()}}
{%- endblock %}
{% block content %}
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header ">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#mobile-nav" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a href="{{ url_for('carpool.index') }}" class="navbar-brand logo generic">
</a>
</div>
<div class="collapse navbar-collapse" id="mobile-nav">
<ul class="nav navbar-nav visible-xs">
<li><a href="{{ url_for('carpool.index') }}">Home</a></li>
<li><a href="{{ url_for('carpool.find') }}">Find a ride</a></li>
<li><a href="{{ url_for('carpool.new') }}">Give a ride</a></li>
<li><a href="{{ config.get('BRANDING_PRIVACY_URL') }}">Privacy & Terms</a></li>
<li role="separator" class="divider"></li>
{% if current_user.is_authenticated %}
<li><a href="{{ url_for('carpool.mine') }}">My rides</a></li>
<li><a href="{{ url_for('auth.profile') }}">Profile</a></li>
{% if current_user.has_roles('admin') %}
<li><a href="{{ url_for('admin.admin_index') }}">Admin Tools</a></li>
{% endif %}
<li>
<form method="POST" action="{{ url_for('auth.logout') }}" id="logout-form">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button type="submit" class="btn btn-logout">Log out</button>
</form>
</li>
{% else %}
<li><a href="{{ url_for('auth.login') }}">Login</a></li>
{% endif %}
</ul>
<ul class="nav navbar-nav hidden-xs wide-nav">
<li class="visible-lg-block">
<form class="navbar-form" id="ride-select-form" method="GET" action="{{ url_for('carpool.find') }}">
<input type="hidden" name="lat">
<input type="hidden" name="lng">
<div class="form-group">
<span>Find a ride near</span>
<input type="text" name="q" id="locationQuery" class="form-control input-lg location-input" placeholder="Zip code or City, State" value="{{user_query}}" />
<button class="btn btn-secondary"><img src="/static/img/ic_search_24px.svg"></button>
</div>
</form>
</li>
<li class="hidden-lg"><a href="{{ url_for('carpool.find') }}">Find a ride</a></li>
<li><a href="{{ url_for('carpool.new') }}">Give a ride</a></li>
{% if current_user.is_authenticated %}
<li><a href="{{ url_for('carpool.mine') }}">My rides</a></li>
<li class="hidden-sm"><a href="{{ config.get('BRANDING_PRIVACY_URL') }}">Privacy & Terms</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
{{ current_user.name }}<span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li class="visible-sm"><a href="{{ config.get('BRANDING_PRIVACY_URL') }}">Privacy & Terms</a></li>
<li><a href="{{ url_for('auth.profile') }}">Profile</a></li>
{% if current_user.has_roles('admin') %}
<li><a href="{{ url_for('admin.admin_index') }}">Admin Tools</a></li>
{% endif %}
<li>
<form method="POST" action="{{ url_for('auth.logout') }}">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button type="submit" class="btn btn-logout">Log out</button>
</form>
</li>
</ul>
</li>
{% else %}
<li><a href="{{ config.get('BRANDING_PRIVACY_URL') }}">Privacy & Terms</a></li>
<li><a href="{{ url_for('auth.login') }}">Login</a>
{% endif %}
</li>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
{% block site %}{% endblock %}
<!--Zendesk support widget-->
<script id="ze-snippet" src="https://static.zdassets.com/ekr/snippet.js?key=19972695-e94b-40d7-be27-3f1c22dc0bc5"> </script>
{% if public_dsn %}
<!-- Sentry error reporting -->
<script src="https://browser.sentry-cdn.com/4.0.5/bundle.min.js" integrity="sha384-GBuMTYSVbNX2T8znvVCZnO4rc/izXyS4EMzltAUjjio037UxfHsgG/QoufqAY8mS" crossorigin="anonymous"></script>
<script>
(function() {
'use strict';
window.Sentry.init(
{
'dsn': '{{ public_dsn }}',
'release': '{{ sentry_commit_hash }}',
'environment': '{{ sentry_env }}'
}
);
})();
</script>
{% endif %}
{%- endblock %}