/
base.html
303 lines (265 loc) · 15 KB
/
base.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
{% extends "defaults.jinja" %}
{% block base %}
<!DOCTYPE html>
<html lang="en">
<head>
{% block head %}
<title>{% block title %}{% endblock %} - {{ FLEXMEASURES_PLATFORM_NAME }}
</title>
{% endblock head %}
<meta charset="windows-1252">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" href="favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
<!-- Leaflet -->
<link href="https://cdn.jsdelivr.net/npm/leaflet@1.7.1/dist/leaflet.css" rel="stylesheet" />
<link href="https://unpkg.com/leaflet.markercluster@1.4.1/dist/MarkerCluster.css" rel="stylesheet" />
<link href="https://unpkg.com/leaflet.markercluster@1.4.1/dist/MarkerCluster.Default.css" rel="stylesheet" />
<!-- Bootstrap -->
<link href="https://ajax.aspnetcdn.com/ajax/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
{% if show_datepicker %}
<link href="https://cdn.jsdelivr.net/npm/daterangepicker@3.1.0/daterangepicker.css"
rel="stylesheet" />
{% endif %}
<!-- Fonts -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"
rel="stylesheet" />
<link href="{{ url_for('flexmeasures_ui.static', filename='css/external/weather-icons.min.css') }}"
rel="stylesheet" />
<!-- Ion range slider -->
<link href="https://cdn.jsdelivr.net/npm/ion-rangeslider@2.3.1/css/ion.rangeSlider.css"
rel="stylesheet" />
<!-- Custom CSS -->
<link href="{{ url_for('flexmeasures_ui.static', filename='css/flexmeasures.css') }}" rel="stylesheet" />
{% if contains_plots %}
{{ bokeh_css_resources|indent(4)|safe }}
{{ bokeh_js_resources|indent(4)|safe }}
{% endif %}
{% if active_page == "tasks" %}
<link href="{{ url_for('flexmeasures_ui.static', filename='css/external/rq-dashboard-bootstrap.min.css') }}"
rel="stylesheet" />
{% elif active_page in ("assets", "users", "portfolio") %}
<link href="https://cdn.datatables.net/1.10.22/css/jquery.dataTables.min.css" rel="stylesheet" />
{% endif %}
</head>
<body>
{% block body %}
{% block nav %}
<nav class="navbar navbar-default navbar-fixed-top" id="topnavbar">
<div id="navbar-container" class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
data-target="#bs-example-navbar-collapse-1" 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>
<span class="navbar-brand">
<a href="/"><span class="navbar-tool-name">{{ FLEXMEASURES_PLATFORM_NAME }}</span></a>
{{ self.title() }} {% if user_is_logged_in and not "Error" in self.title() %} for {{ user_name }} {% endif %}
</span>
</div>
<div class="collapse navbar-collapse navbar-right" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
{% for href, id, caption, icon in navigation_bar %}
{% if id == "tasks" %}
<li {% if id == active_page %} class="active" {% endif %} class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#"><span class="fa fa-tasks"
aria-hidden="true"></span>
Tasks
<span class="caret"></span></a>
<ul class="dropdown-menu">
<li {% if current_user.has_role('anonymous') %}class="disabled" {% endif %}><a
{% if not current_user.has_role('anonymous') %}href="/tasks/forecasting"
{% endif %}>Forecasts</a></li>
<li {% if current_user.has_role('anonymous') %}class="disabled" {% endif %}><a
{% if not current_user.has_role('anonymous') %}href="/tasks/scheduling"
{% endif %}>Schedules</a></li>
<li {% if current_user.has_role('anonymous') %}class="disabled" {% endif %}><a
{% if not current_user.has_role('anonymous') %}href="/tasks/labelling"
{% endif %}>Labels</a></li>
<li {% if current_user.has_role('anonymous') %}class="disabled" {% endif %}><a
{% if not current_user.has_role('anonymous') %}href="/tasks/alerting"
{% endif %}>Alerts</a></li>
<li {% if current_user.has_role('anonymous') %}class="disabled" {% endif %}><a
{% if not current_user.has_role('anonymous') %}href="/tasks/reporting"
{% endif %}>Reports</a></li>
</ul>
</li>
{% else %}
<li {% if id == active_page %} class="active" {% endif %}
{% if id == 'upload' or (current_user.has_role('anonymous') and id in ('tasks', 'users', 'control', 'portfolio')) %}
class="disabled" {% endif %}>
<a {% if not ( id == 'upload' or (current_user.has_role('anonymous') and id in ('tasks', 'users', 'control', 'portfolio')) ) %}href="/{{ href|e }}"
{% endif %}{% if id == 'docs' %} target="_blank" {% endif %}>
<span class="fa fa-{{ icon }}" aria-hidden="true"></span>
{{ caption|e }}
</a>
</li>
{% endif %}
{% endfor %}
</ul>
</div>
</div>
</nav>
{% endblock nav %}
{% if message and message != "" %}
<div class="col-sm-12 alert alert-info">{{ message}} </div>
{% endif %}
{% if (msg is defined) and msg %}
<div class="col-sm-12 alert alert-info">{{ msg }}</div>
{% endif %}
<!-- loading this earlier so templates can use it -->
<script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.5.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/floatthead/2.2.1/jquery.floatThead.min.js"></script>
<!-- This should always be there, even on error pages -->
<script type="text/javascript">
var timerangeStart = "{{ start_time }}";
var timerangeEnd = "{{ end_time }}";
</script>
{# Div blocks that child pages can reference #}
{% block divs %}
{% block datetimepicker %}
<div class="form-group row datetimepicker">
<div class="col-sm-2">
<div class="col-sm-1"><i class="icon-time center-icon"></i></div>
</div>
<div class="col-sm-10">
<label class="control-label">Time window</label>
<div class="btn-group btn-group-justified">
<input type="text" name="daterange" value="01/01/2015 1:30 PM - 01/01/2015 2:00 PM" />
</div>
</div>
</div>
<!-- form to refresh page -->
<form style="display: hidden" action="" method="POST" id="datepicker_form">
<input type="hidden" id="datepicker_form_start_time" name="start_time" value="{{ start_time }}" />
<input type="hidden" id="datepicker_form_end_time" name="end_time" value="{{ end_time }}" />
</form>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment.min.js"></script>
{% endblock datetimepicker %}
{% block forecastpicker %}
<div class="form-group row">
<div class="col-sm-2">
<div class="col-sm-1"><i class="icon-binoculars center-icon"></i></div>
</div>
<div class="col-sm-10">
<label class="control-label">Forecast (rolling)</label>
<!--<div class="btn-group btn-group-justified" role="group" aria-label="...">-->
<!--<a role="button" href="#" class="btn btn-default forecast-toggle active" forecast-type="rolling">Rolling</a>-->
<!--<a role="button" href="#" class="btn btn-default forecast-toggle" forecast-type="static">Static</a>-->
<!--</div>-->
<div>
<form action="" method="POST" id="forecast_horizon_form">
<select class="form-control" id="forecast_horizon" name="forecast_horizon"
onchange="this.form.submit()">
{% for horizon in forecast_horizons %}
<option value="{{ horizon }}" {% if horizon == active_forecast_horizon %} selected="selected"
{% endif %}>with a horizon of {{ horizon }}</option>
{% endfor %}
</select>
</form>
</div>
</div>
</div>
{% endblock forecastpicker %}
{% block attributions %}
<div id="att-text" style="display: none;">
<ul>
<li>Plots made with <a href="https://bokeh.pydata.org">Bokeh</a>.</li>
<li>Icons made by <a href="https://freepik.com">Freepik</a>, <a
href="https://www.flaticon.com/authors/tomas-knop" title="Tomas Knop">Tomas Knop</a>, <a
href="https://www.flaticon.com/authors/gregor-cresnar" title="Gregor Cresnar">Gregor Cresnar</a> and
<a href="https://www.flaticon.com/authors/those-icons" title="Those Icons">Those Icons</a> from <a
href="https://flaticon.com">www.flaticon.com</a>.</li>
</ul>
</div>
{% endblock attributions %}
{% endblock divs %}
{#- Scripts used by all views (e.g. by navigation menu) -#}
<script src="https://ajax.aspnetcdn.com/ajax/bootstrap/3.3.7/bootstrap.min.js"></script>
{% block scripts %}
<!-- External scripts -->
<script src="https://cdn.jsdelivr.net/npm/ion-rangeslider@2.3.1/js/ion.rangeSlider.min.js"></script>
<!-- Custom scripts -->
<script src="{{ url_for('flexmeasures_ui.static', filename='js/flexmeasures.js') }}"></script>
{% if show_datepicker %}
<script src="{{ url_for('flexmeasures_ui.static', filename='js/daterangepicker-init.js') }}"></script>
{% endif %}
<!-- External scripts that should run after custom scripts -->
{% if show_datepicker %}
<script src="https://cdn.jsdelivr.net/npm/daterangepicker@3.1.0/daterangepicker.min.js"></script>
{% endif %}
{% endblock scripts %}
{% block paginate_tables_script %}
<script src="https://cdn.datatables.net/1.10.22/js/jquery.dataTables.min.js"></script>
<script
src="https://cdn.datatables.net/plug-ins/1.10.22/features/conditionalPaging/dataTables.conditionalPaging.js"></script>
{% endblock paginate_tables_script %}
<footer class="page-footer font-small pt-4 mt-4">
<div class="footer text-center">
<div class="container-fluid">
FlexMeasures technology is created by <a href="https://seita.nl/">Seita Energy Flexibility</a>,
in cooperation with <a href="https://aoneeng.com/">A1 Engineering</a>
©
<script>var CurrentYear = new Date().getFullYear(); document.write(CurrentYear)</script>.
<a href="#" data-toggle="modal" data-target="#Credits">Credits</a>.
<!-- The modal -->
<div class="modal fade" id="Credits" tabindex="-1" role="dialog" aria-labelledby="modalLabelLarge" aria-hidden="true">
<div class="modal-dialog modal-lg">
<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="modalLabelLarge">Credits</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-sm-6">
<h3>Images from <a href="https://seita.nl">Seita</a></h3>
<div>FlexMeasures on laptop - image by <a href="https://drakemultimedia.nl/" title="Bobby Drake">Bobby Drake</a></div>
<h3>Images from <a href="https://unsplash.com/" title="Unsplash">Unsplash</a></h3>
<div>Tesla charging station - image by <a href="https://www.chasealewis.com/" title="Chase Lewis">Chase Lewis</a></div>
<div>Wind turbines on top of mountain - image by <a href="https://www.tbk-f.com/" title="TJ K.">TJ K.</a></div>
</div>
<div class="col-sm-6">
<h3>Icons from <a href="https://www.flaticon.com/" title="Flaticon">Flaticon</a></h3>
<div><a href="https://www.flaticon.com/free-icon/wind-power_1085695">Wind turbine</a> - icon by <a href="https://www.flaticon.com/authors/good-ware" title="Good Ware">Good Ware</a> (made to spin by Seita)</div>
<div><a href="https://www.flaticon.com/search?word=currency&author_id=258">Coins</a> - icons by <a href="https://www.flaticon.com/authors/pixelmeetup" title="Pixelmeetup">Pixelmeetup</a></div>
<div>Other icons by <a href="https://www.freepik.com" title="Freepik">Freepik</a></div>
</div>
</div>
</div>
<div class="modal-header">
We did our best to give credit to the original photographers and illustrators for the images included on this website. If we have not properly credited an original photographer or illustrator, please notifiy us and we will make the appropriate changes necessary.
</div>
</div>
</div>
</div>
<!-- We might render templates from plugins, where this meta info is not available -->
{% if app_running_since %}
This app is running since {{ app_running_since }}
{% endif %}
{% if not current_user.has_role('anonymous') %}
{% if flexmeasures_version %}
on version {{ flexmeasures_version }}
{% else %}
{% if git_version != "Unknown" %}
on version {{ git_version }}+{{ git_commits_since }}.
{% else %}
on revision {{ git_hash }}.
{% endif %}
{% endif %}
{% endif %}
</div>
<div>
<a href="https://seita.nl/"><i class="icon-seita_bird supersize"></i></a>
</div>
</div>
</footer>
{% endblock body %}
</body>
</html>
{% endblock base %}