Show More
@@ -1,44 +1,45 b'' | |||||
1 | //---------------------------------------------------------------------------- |
|
1 | //---------------------------------------------------------------------------- | |
2 | // Copyright (C) 2008-2011 The IPython Development Team |
|
2 | // Copyright (C) 2008-2011 The IPython Development Team | |
3 | // |
|
3 | // | |
4 | // Distributed under the terms of the BSD License. The full license is in |
|
4 | // Distributed under the terms of the BSD License. The full license is in | |
5 | // the file COPYING, distributed as part of this software. |
|
5 | // the file COPYING, distributed as part of this software. | |
6 | //---------------------------------------------------------------------------- |
|
6 | //---------------------------------------------------------------------------- | |
7 |
|
7 | |||
8 | //============================================================================ |
|
8 | //============================================================================ | |
9 | // Login button |
|
9 | // Login button | |
10 | //============================================================================ |
|
10 | //============================================================================ | |
11 |
|
11 | |||
12 | var IPython = (function (IPython) { |
|
12 | var IPython = (function (IPython) { | |
|
13 | var base_url = $('body').data('baseProjectUrl'); | |||
13 |
|
14 | |||
14 | var LoginWidget = function (selector) { |
|
15 | var LoginWidget = function (selector) { | |
15 | this.selector = selector; |
|
16 | this.selector = selector; | |
16 | if (this.selector !== undefined) { |
|
17 | if (this.selector !== undefined) { | |
17 | this.element = $(selector); |
|
18 | this.element = $(selector); | |
18 | this.style(); |
|
19 | this.style(); | |
19 | this.bind_events(); |
|
20 | this.bind_events(); | |
20 | } |
|
21 | } | |
21 | }; |
|
22 | }; | |
22 |
|
23 | |||
23 | LoginWidget.prototype.style = function () { |
|
24 | LoginWidget.prototype.style = function () { | |
24 | this.element.find('button#logout').button(); |
|
25 | this.element.find('button#logout').button(); | |
25 | this.element.find('button#login').button(); |
|
26 | this.element.find('button#login').button(); | |
26 | }; |
|
27 | }; | |
27 |
|
28 | |||
28 |
|
29 | |||
29 | LoginWidget.prototype.bind_events = function () { |
|
30 | LoginWidget.prototype.bind_events = function () { | |
30 | var that = this; |
|
31 | var that = this; | |
31 | this.element.find("button#logout").click(function () { |
|
32 | this.element.find("button#logout").click(function () { | |
32 | window.location = "logout"; |
|
33 | window.location = base_url+"logout"; | |
33 | }); |
|
34 | }); | |
34 | this.element.find("button#login").click(function () { |
|
35 | this.element.find("button#login").click(function () { | |
35 | window.location = "login"; |
|
36 | window.location = base_url+"login"; | |
36 | }); |
|
37 | }); | |
37 | }; |
|
38 | }; | |
38 |
|
39 | |||
39 | // Set module variables |
|
40 | // Set module variables | |
40 | IPython.LoginWidget = LoginWidget; |
|
41 | IPython.LoginWidget = LoginWidget; | |
41 |
|
42 | |||
42 | return IPython; |
|
43 | return IPython; | |
43 |
|
44 | |||
44 | }(IPython)); |
|
45 | }(IPython)); |
@@ -1,42 +1,42 b'' | |||||
1 | {% extends page.html %} |
|
1 | {% extends page.html %} | |
2 |
|
2 | |||
3 | {% block stylesheet %} |
|
3 | {% block stylesheet %} | |
4 |
|
4 | |||
5 | <link rel="stylesheet" href="{{static_url("css/login.css") }}" type="text/css"/> |
|
5 | <link rel="stylesheet" href="{{static_url("css/login.css") }}" type="text/css"/> | |
6 |
|
6 | |||
7 | {% end %} |
|
7 | {% end %} | |
8 |
|
8 | |||
9 |
|
9 | |||
10 | {% block login_widget %} |
|
10 | {% block login_widget %} | |
11 | {% end %} |
|
11 | {% end %} | |
12 |
|
12 | |||
13 |
|
13 | |||
14 | {% block site %} |
|
14 | {% block site %} | |
15 |
|
15 | |||
16 | <div id="main_app"> |
|
16 | <div id="main_app"> | |
17 |
|
17 | |||
18 | {% if login_available %} |
|
18 | {% if login_available %} | |
19 | <form action="login?next={{url_escape(next)}}" method="post"> |
|
19 | <form action="{{base_project_url}}login?next={{url_escape(next)}}" method="post"> | |
20 | Password: <input type="password" class='ui-widget ui-widget-content' name="password" id="password_input"> |
|
20 | Password: <input type="password" class='ui-widget ui-widget-content' name="password" id="password_input"> | |
21 | <input type="submit" value="Log in" id="login_submit"> |
|
21 | <input type="submit" value="Log in" id="login_submit"> | |
22 | </form> |
|
22 | </form> | |
23 | {% end %} |
|
23 | {% end %} | |
24 |
|
24 | |||
25 | {% if message %} |
|
25 | {% if message %} | |
26 | {% for key in message %} |
|
26 | {% for key in message %} | |
27 | <div class="message {{key}}"> |
|
27 | <div class="message {{key}}"> | |
28 | {{message[key]}} |
|
28 | {{message[key]}} | |
29 | </div> |
|
29 | </div> | |
30 | {% end %} |
|
30 | {% end %} | |
31 | {% end %} |
|
31 | {% end %} | |
32 |
|
32 | |||
33 | <div/> |
|
33 | <div/> | |
34 |
|
34 | |||
35 | {% end %} |
|
35 | {% end %} | |
36 |
|
36 | |||
37 |
|
37 | |||
38 | {% block script %} |
|
38 | {% block script %} | |
39 |
|
39 | |||
40 | <script src="{{static_url("js/loginmain.js") }}" type="text/javascript" charset="utf-8"></script> |
|
40 | <script src="{{static_url("js/loginmain.js") }}" type="text/javascript" charset="utf-8"></script> | |
41 |
|
41 | |||
42 | {% end %} |
|
42 | {% end %} |
@@ -1,40 +1,40 b'' | |||||
1 | {% extends page.html %} |
|
1 | {% extends page.html %} | |
2 |
|
2 | |||
3 | {% block stylesheet %} |
|
3 | {% block stylesheet %} | |
4 |
|
4 | |||
5 | <link rel="stylesheet" href="{{static_url("css/logout.css") }}" type="text/css"/> |
|
5 | <link rel="stylesheet" href="{{static_url("css/logout.css") }}" type="text/css"/> | |
6 |
|
6 | |||
7 | {% end %} |
|
7 | {% end %} | |
8 |
|
8 | |||
9 |
|
9 | |||
10 | {% block login_widget %} |
|
10 | {% block login_widget %} | |
11 | {% end %} |
|
11 | {% end %} | |
12 |
|
12 | |||
13 | {% block site %} |
|
13 | {% block site %} | |
14 |
|
14 | |||
15 | <div id="main_app"> |
|
15 | <div id="main_app"> | |
16 |
|
16 | |||
17 | {% if message %} |
|
17 | {% if message %} | |
18 | {% for key in message %} |
|
18 | {% for key in message %} | |
19 | <div class="message {{key}}"> |
|
19 | <div class="message {{key}}"> | |
20 | {{message[key]}} |
|
20 | {{message[key]}} | |
21 | </div> |
|
21 | </div> | |
22 | {% end %} |
|
22 | {% end %} | |
23 | {% end %} |
|
23 | {% end %} | |
24 |
|
24 | |||
25 | {% if read_only or not login_available %} |
|
25 | {% if read_only or not login_available %} | |
26 | Proceed to the <a href="">dashboard</a>. |
|
26 | Proceed to the <a href="{{base_project_url}}">dashboard</a>. | |
27 | {% else %} |
|
27 | {% else %} | |
28 | Proceed to the <a href="login">login page</a>. |
|
28 | Proceed to the <a href="{{base_project_url}}login">login page</a>. | |
29 | {% end %} |
|
29 | {% end %} | |
30 |
|
30 | |||
31 |
|
31 | |||
32 | <div/> |
|
32 | <div/> | |
33 |
|
33 | |||
34 | {% end %} |
|
34 | {% end %} | |
35 |
|
35 | |||
36 | {% block script %} |
|
36 | {% block script %} | |
37 |
|
37 | |||
38 | <script src="{{static_url("js/logoutmain.js") }}" type="text/javascript" charset="utf-8"></script> |
|
38 | <script src="{{static_url("js/logoutmain.js") }}" type="text/javascript" charset="utf-8"></script> | |
39 |
|
39 | |||
40 | {% end %} |
|
40 | {% end %} |
General Comments 0
You need to be logged in to leave comments.
Login now