|
1 | 1 | {% extends "page.html" %}
|
2 | 2 |
|
3 |
| -{% block stylesheet %} |
4 |
| -<style> |
5 |
| -.form { |
6 |
| - margin-left: 50px; |
7 |
| - margin-right: 50px; |
8 |
| -} |
9 | 3 |
|
10 |
| -.content { |
11 |
| - margin-left: 50px; |
12 |
| - margin-right: 50px; |
13 |
| - margin-bottom: 50px; |
14 |
| -} |
15 |
| -</style> |
| 4 | +{% block stylesheet %} |
16 | 5 | {% endblock %}
|
17 | 6 |
|
18 | 7 | {% block site %}
|
19 |
| -{% if message %} |
20 |
| -{% for key in message %} |
21 |
| -<div class="content"> |
22 |
| - {{message[key]}} |
23 |
| -</div> |
24 |
| -{% endfor %} |
25 |
| -{% endif %} |
26 |
| -<form class="form" action="{{base_url}}login?next={{next}}" method="post"> |
27 |
| - {{ xsrf_form_html() | safe }} |
28 |
| - <label for="password_input"><strong>{% trans %}Password or token:{% endtrans %}</strong></label> |
29 |
| - <input type="password" name="password" id="password_input"> |
30 |
| - <button type="submit" id="login_submit">{% trans %}Log in{% endtrans %}</button> |
31 |
| -</form> |
32 | 8 |
|
33 |
| -{% if token_available %} |
34 |
| -{% block token_message %} |
35 |
| -<div class="content"> |
36 |
| - <h3> |
37 |
| - Token authentication is enabled |
38 |
| - </h3> |
39 |
| - <p> |
40 |
| - If no password has been configured, you need to open the |
41 |
| - server with its login token in the URL, or paste it above. |
42 |
| - This requirement will be lifted if you |
43 |
| - <b><a href='https://jupyter-server.readthedocs.io/en/latest/operators/public-server.html'> |
44 |
| - enable a password</a></b>. |
45 |
| - </p> |
46 |
| - <p> |
47 |
| - The command: |
48 |
| - <pre>jupyter server list</pre> |
49 |
| - will show you the URLs of running servers with their tokens, |
50 |
| - which you can copy and paste into your browser. For example: |
51 |
| - </p> |
52 |
| - <pre>Currently running servers: |
53 |
| -http://localhost:8888/?token=c8de56fa... :: /Users/you/notebooks |
54 |
| -</pre> |
55 |
| - <p> |
56 |
| - or you can paste just the token value into the password field on this |
57 |
| - page. |
58 |
| - </p> |
59 |
| - <p> |
60 |
| - See |
61 |
| - <b><a href='https://jupyter-server.readthedocs.io/en/latest/operators/public-server.html'> |
62 |
| - the documentation on how to enable a password</a> |
63 |
| - </b> |
64 |
| - in place of token authentication, |
65 |
| - if you would like to avoid dealing with random tokens. |
66 |
| - </p> |
67 |
| - <p> |
68 |
| - Cookies are required for authenticated access to notebooks. |
69 |
| - </p> |
70 |
| - {% if allow_password_change %} |
71 |
| - <h3>{% trans %}Setup a Password{% endtrans %}</h3> |
72 |
| - <p> You can also setup a password by entering your token and a new password |
73 |
| - on the fields below:</p> |
74 |
| - <form action="{{base_url}}login?next={{next}}" method="post" class=""> |
75 |
| - {{ xsrf_form_html() | safe }} |
76 |
| - <div class="form-group"> |
77 |
| - <label for="token_input"> |
78 |
| - <h4>Token</h4> |
79 |
| - </label> |
80 |
| - <input type="password" name="password" id="token_input" class="form-control"> |
81 |
| - </div> |
82 |
| - <div class="form-group"> |
83 |
| - <label for="new_password_input"> |
84 |
| - <h4>New Password</h4> |
85 |
| - </label> |
86 |
| - <input type="password" name="new_password" id="new_password_input" class="form-control" required> |
| 9 | +<div id="jupyter-main-app" class="container"> |
| 10 | + {% if login_available %} |
| 11 | + {# login_available means password-login is allowed. Show the form. #} |
| 12 | + <div class="row"> |
| 13 | + <div class="navbar col-sm-8"> |
| 14 | + <div class="navbar-inner"> |
| 15 | + <div class="container"> |
| 16 | + <div class="center-nav"> |
| 17 | + <form action="{{base_url}}login?next={{next}}" method="post" class="navbar-form pull-left"> |
| 18 | + {{ xsrf_form_html() | safe }} |
| 19 | + {% if token_available %} |
| 20 | + <label for="password_input"><strong>{% trans %}Password or token:{% endtrans |
| 21 | + %}</strong></label> |
| 22 | + {% else %} |
| 23 | + <label for="password_input"><strong>{% trans %}Password:{% endtrans %}</strong></label> |
| 24 | + {% endif %} |
| 25 | + <input type="password" name="password" id="password_input" class="form-control"> |
| 26 | + <button type="submit" class="btn btn-default" id="login_submit">{% trans %}Log in{% endtrans |
| 27 | + %}</button> |
| 28 | + </form> |
| 29 | + </div> |
| 30 | + </div> |
| 31 | + </div> |
87 | 32 | </div>
|
88 |
| - <div class="form-group"> |
89 |
| - <button type="submit" class="btn btn-default" id="login_new_pass_submit">{% trans %}Log in and set new |
90 |
| - password{% endtrans %}</button> |
| 33 | + </div> |
| 34 | + {% else %} |
| 35 | + <p>{% trans %}No login available, you shouldn't be seeing this page.{% endtrans %}</p> |
| 36 | + {% endif %} |
| 37 | + {% if message %} |
| 38 | + <div class="row"> |
| 39 | + {% for key in message %} |
| 40 | + <div class="message {{key}}"> |
| 41 | + {{message[key]}} |
91 | 42 | </div>
|
92 |
| - </form> |
| 43 | + {% endfor %} |
| 44 | + </div> |
| 45 | + {% endif %} |
| 46 | + {% if token_available %} |
| 47 | + {% block token_message %} |
| 48 | + <div class="col-sm-6 col-sm-offset-3 text-left rendered_html"> |
| 49 | + <h3> |
| 50 | + Token authentication is enabled |
| 51 | + </h3> |
| 52 | + <p> |
| 53 | + If no password has been configured, you need to open the |
| 54 | + server with its login token in the URL, or paste it above. |
| 55 | + This requirement will be lifted if you |
| 56 | + <b><a href='https://jupyter-server.readthedocs.io/en/latest/operators/public-server.html'> |
| 57 | + enable a password</a></b>. |
| 58 | + </p> |
| 59 | + <p> |
| 60 | + The command: |
| 61 | + <pre>jupyter server list</pre> |
| 62 | + will show you the URLs of running servers with their tokens, |
| 63 | + which you can copy and paste into your browser. For example: |
| 64 | + </p> |
| 65 | + <pre>Currently running servers: |
| 66 | +http://localhost:8888/?token=c8de56fa... :: /Users/you/notebooks |
| 67 | +</pre> |
| 68 | + <p> |
| 69 | + or you can paste just the token value into the password field on this |
| 70 | + page. |
| 71 | + </p> |
| 72 | + <p> |
| 73 | + See |
| 74 | + <b><a href='https://jupyter-server.readthedocs.io/en/latest/operators/public-server.html'> |
| 75 | + the documentation on how to enable a password</a> |
| 76 | + </b> |
| 77 | + in place of token authentication, |
| 78 | + if you would like to avoid dealing with random tokens. |
| 79 | + </p> |
| 80 | + <p> |
| 81 | + Cookies are required for authenticated access to the Jupyter server. |
| 82 | + </p> |
| 83 | + {% if allow_password_change %} |
| 84 | + <h3>{% trans %}Setup a Password{% endtrans %}</h3> |
| 85 | + <p> You can also setup a password by entering your token and a new password |
| 86 | + on the fields below:</p> |
| 87 | + <form action="{{base_url}}login?next={{next}}" method="post" class=""> |
| 88 | + {{ xsrf_form_html() | safe }} |
| 89 | + <div class="form-group"> |
| 90 | + <label for="token_input"> |
| 91 | + <h4>Token</h4> |
| 92 | + </label> |
| 93 | + <input type="password" name="password" id="token_input" class="form-control"> |
| 94 | + </div> |
| 95 | + <div class="form-group"> |
| 96 | + <label for="new_password_input"> |
| 97 | + <h4>New Password</h4> |
| 98 | + </label> |
| 99 | + <input type="password" name="new_password" id="new_password_input" class="form-control" required> |
| 100 | + </div> |
| 101 | + <div class="form-group"> |
| 102 | + <button type="submit" class="btn btn-default" id="login_new_pass_submit">{% trans %}Log in and set new |
| 103 | + password{% endtrans %}</button> |
| 104 | + </div> |
| 105 | + </form> |
| 106 | + {% endif %} |
| 107 | + |
| 108 | + </div> |
| 109 | + {% endblock token_message %} |
93 | 110 | {% endif %}
|
94 | 111 | </div>
|
95 |
| -{% endblock token_message %} |
96 |
| -{% endif %} |
97 |
| - |
98 |
| -{% endblock site %} |
| 112 | + |
| 113 | +{% endblock %} |
| 114 | + |
| 115 | + |
| 116 | +{% block script %} |
| 117 | +{% endblock %} |
0 commit comments