11{% macro modal(title, btn_label=None, btn_class="btn-primary") %}
22{% set key = title.replace(' ', '-').lower() %}
33{% set btn_label = btn_label or title %}
4- < div class ="modal fade " id ="{{key}}-dialog " tabindex ="-1 " role ="dialog " aria-labelledby ="{{key}}-label "
5- aria-hidden ="true ">
4+ < div class ="modal fade " id ="{{key}}-dialog " tabindex ="-1 " role ="dialog " aria-labelledby ="{{key}}-label " aria-hidden ="true ">
65 < div class ="modal-dialog ">
76 < div class ="modal-content ">
87 < div class ="modal-header ">
9- < button type ="button " class ="close " data-dismiss ="modal "> < span aria-hidden ="true "> ×</ span > < span
10- class ="sr-only "> Close</ span > </ button >
11- < h4 class ="modal-title " id ="{{key}}-label "> {{title}}</ h4 >
8+ < button type ="button " class ="close " data-dismiss ="modal "> < span aria-hidden ="true "> ×</ span > < span class ="sr-only "> Close</ span > </ button >
9+ < h1 class ="modal-title " id ="{{key}}-label "> {{title}}</ h1 >
1210 </ div >
1311 < div class ="modal-body ">
1412 {{ caller() }}
@@ -24,67 +22,71 @@ <h4 class="modal-title" id="{{key}}-label">{{title}}</h4>
2422
2523
2624<!DOCTYPE HTML>
27- < html >
25+ < html lang =" en " >
2826
2927< head >
30- < meta charset ="utf-8 ">
31-
32- < title > {% block title %}Loading workspace{% endblock %}</ title >
33- < meta http-equiv ="X-UA-Compatible " content ="chrome=1,IE=edge ">
34- < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
35-
36- {% block stylesheet %}
37- < link rel ="stylesheet " href ="{{ static_url( "css /style.min.css") }}" type="text/css " />
38- < link rel ="shortcut icon " type ="image/x-icon " href ="{{ static_url( "images /favicon.ico") }}">
39- {% endblock %}
40- < script src ="{{static_url( "components /requirejs/require.js") }}" type="text/javascript " charset ="utf-8 "> </ script >
41- < script src ="{{static_url( "components /jquery/dist/jquery.min.js") }}" type="text/javascript " charset ="utf-8 "> </ script >
42- < script src ="{{static_url( "components /bootstrap/dist/js/bootstrap.min.js") }}" type="text/javascript "
43- charset ="utf-8 "> </ script >
44- < script >
45- require . config ( {
28+ < meta charset ="utf-8 ">
29+
30+ < title > {% block title %}JupyterHub{% endblock %}</ title >
31+ < meta http-equiv ="X-UA-Compatible " content ="chrome=1 ">
32+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
33+
34+ {% block stylesheet %}
35+ < link rel ="stylesheet " href ="{{ static_url( "css /style.min.css") }}" type="text/css "/>
36+ {% endblock %}
37+ {% block favicon %}
38+ < link rel ="icon " href ="{{ static_url( "favicon.ico ") }}" type="image/x-icon ">
39+ {% endblock %}
40+ {% block scripts %}
41+ < script src ="{{static_url( "components /requirejs/require.js") }}" type="text/javascript " charset ="utf-8 "> </ script >
42+ < script src ="{{static_url( "components /jquery/dist/jquery.min.js") }}" type="text/javascript " charset ="utf-8 "> </ script >
43+ < script src ="{{static_url( "components /bootstrap/dist/js/bootstrap.min.js") }}" type="text/javascript " charset ="utf-8 "> </ script >
44+ {% endblock %}
45+ < script >
46+ require . config ( {
4647 { % if version_hash % }
47- urlArgs : "v={{version_hash}}" ,
48- { % endif % }
49- baseUrl : '{{static_url("js", include_version=False)}}' ,
50- paths : {
51- components : '../components' ,
52- jquery : '../components/jquery/dist/jquery.min' ,
53- bootstrap : '../components/bootstrap/dist/js/bootstrap.min' ,
48+ urlArgs : "v={{version_hash}}" ,
49+ { % endif % }
50+ baseUrl : '{{static_url("js", include_version=False)}}' ,
51+ paths : {
52+ components : '../components' ,
53+ jquery : '../components/jquery/dist/jquery.min' ,
54+ bootstrap : '../components/bootstrap/dist/js/bootstrap.min' ,
5455 moment : "../components/moment/moment" ,
5556 } ,
56- shim : {
57- bootstrap : {
58- deps : [ "jquery" ] ,
59- exports : "bootstrap"
60- } ,
61- }
57+ shim : {
58+ bootstrap : {
59+ deps : [ "jquery" ] ,
60+ exports : "bootstrap"
61+ } ,
62+ }
6263 } ) ;
63- </ script >
64+ </ script >
6465
65- < script type ="text/javascript ">
66- window . jhdata = {
67- base_url : "{{base_url}}" ,
68- prefix : "{{prefix}}" ,
66+ < script type ="text/javascript ">
67+ window . jhdata = {
68+ base_url : "{{base_url}}" ,
69+ prefix : "{{prefix}}" ,
6970 { % if user % }
70- user : "{{user.name}}" ,
71- { % endif % }
72- { % if admin_access % }
73- admin_access : true ,
74- { % else % }
75- admin_access : false ,
76- { % endif % }
77- { % if not no_spawner_check and user and user . spawner . options_form % }
78- options_form : true ,
79- { % else % }
80- options_form : false ,
81- { % endif % }
71+ user : "{{user.json_escaped_name}}" ,
72+ { % endif % }
73+ { % if admin_access % }
74+ admin_access : true ,
75+ { % else % }
76+ admin_access : false ,
77+ { % endif % }
78+ { % if not no_spawner_check and user and user . spawner . options_form % }
79+ options_form : true ,
80+ { % else % }
81+ options_form : false ,
82+ { % endif % }
83+ xsrf_token : "{{ xsrf_token }}" ,
8284 }
83- </ script >
85+ </ script >
86+ < script src ="{{ static_url( "hot_fix_for_eventsource.js ") }}" type="text/javascript " charset ="utf-8 "> </ script >
8487
85- < script src ="{{ static_url( "hot_fix_for_eventsource.js ") }}" type="text/javascript " charset ="utf-8 "> </ script >
86- {% block meta %}
87- {% endblock %}
88+ {% block meta %}
89+ {% endblock %}
8890
8991</ head >
9092< style >
@@ -193,32 +195,38 @@ <h4 class="modal-title" id="{{key}}-label">{{title}}</h4>
193195 details[open ] summary : before {
194196 transform : rotate (180deg );
195197 }
198+
199+ .navbar {
200+ display : none;
201+ }
196202</ style >
197203
198204< body >
199205
200- < noscript >
201- < div id ='noscript '>
202- JupyterHub requires JavaScript.< br >
203- Please enable it to proceed.
204- </ div >
205- </ noscript >
206+ < noscript >
207+ < div id ='noscript '>
208+ JupyterHub requires JavaScript.< br >
209+ Please enable it to proceed.
210+ </ div >
211+ </ noscript >
206212
207- {% block nav_bar %}
208- <!-- < nav class="navbar navbar-default">
213+ {% block nav_bar %}
214+ < nav class ="navbar navbar-default ">
209215 < div class ="container-fluid ">
210216 < div class ="navbar-header ">
211217 {% block logo %}
212218 < span id ="jupyterhub-logo " class ="pull-left ">
213- <a href="{{logo_url or base_url}}"><img src='{{base_url}}logo' alt='JupyterHub' class='jpy-logo' title='Home'/></a>
219+ < a href ="{{logo_url or base_url}} "> < img src ='{{base_url}}logo ' alt ='JupyterHub logo ' class ='jpy-logo ' title ='Home '/> </ a >
214220 </ span >
215221 {% endblock %}
222+ {% if user %}
216223 < button type ="button " class ="navbar-toggle collapsed " data-toggle ="collapse " data-target ="#thenavbar " aria-expanded ="false ">
217224 < span class ="sr-only "> Toggle navigation</ span >
218225 < span class ="icon-bar "> </ span >
219226 < span class ="icon-bar "> </ span >
220227 < span class ="icon-bar "> </ span >
221228 </ button >
229+ {% endif %}
222230 </ div >
223231
224232 < div class ="collapse navbar-collapse " id ="thenavbar ">
@@ -227,9 +235,21 @@ <h4 class="modal-title" id="{{key}}-label">{{title}}</h4>
227235 {% block nav_bar_left_items %}
228236 < li > < a href ="{{base_url}}home "> Home</ a > </ li >
229237 < li > < a href ="{{base_url}}token "> Token</ a > </ li >
230- {% if user. admin %}
238+ {% if ' admin-ui' in parsed_scopes %}
231239 < li > < a href ="{{base_url}}admin "> Admin</ a > </ li >
232240 {% endif %}
241+ {% if services %}
242+ < li class ="dropdown ">
243+ < a href ="# " class ="dropdown-toggle " data-toggle ="dropdown " role ="button " aria-haspopup ="true " aria-expanded ="false "> Services< span class ="caret "> </ span > </ a >
244+ < ul class ="dropdown-menu ">
245+ {% for service in services %}
246+ {% block service scoped %}
247+ < li > < a class ="dropdown-item " href ="{{service.prefix}} "> {{service.name}}</ a > </ li >
248+ {% endblock %}
249+ {% endfor %}
250+ </ ul >
251+ </ li >
252+ {% endif %}
233253 {% endblock %}
234254 </ ul >
235255 {% endif %}
@@ -239,7 +259,7 @@ <h4 class="modal-title" id="{{key}}-label">{{title}}</h4>
239259 {% block login_widget %}
240260 < span id ="login_widget ">
241261 {% if user %}
242- <p class="navbar-text">{{user.name}}</p>
262+ < p class ="navbar-text "> {{user.name}}</ p >
243263 < a id ="logout " role ="button " class ="navbar-btn btn-sm btn btn-default " href ="{{logout_url}} "> < i aria-hidden ="true " class ="fa fa-sign-out "> </ i > Logout</ a >
244264 {% else %}
245265 < a id ="login " role ="button " class ="btn-sm btn navbar-btn btn-default " href ="{{login_url}} "> Login</ a >
@@ -254,30 +274,33 @@ <h4 class="modal-title" id="{{key}}-label">{{title}}</h4>
254274 {% block header %}
255275 {% endblock %}
256276 </ div >
257- </nav> -->
258- {% endblock %}
277+ </ nav >
278+ {% endblock %}
259279
260280
261- {% block announcement %}
262- {% if announcement %}
263- < div class ="container text-center announcement ">
264- {{ announcement | safe }}
265- </ div >
266- {% endif %}
267- {% endblock %}
281+ {% block announcement %}
282+ {% if announcement %}
283+ < div class ="container text-center announcement alert alert-warning ">
284+ {{ announcement | safe }}
285+ </ div >
286+ {% endif %}
287+ {% endblock %}
288+
268289
290+ {% block main %}
291+ {% endblock %}
269292
270- {% block main %}
271- {% endblock %}
293+ {% block footer %}
294+ {% endblock %}
272295
273- {% call modal('Error', btn_label='OK') %}
296+ {% call modal('Error', btn_label='OK') %}
274297 < div class ="ajax-error ">
275298 The error
276299 </ div >
277- {% endcall %}
300+ {% endcall %}
278301
279- {% block script %}
280- {% endblock %}
302+ {% block script %}
303+ {% endblock %}
281304
282305</ body >
283306
0 commit comments