##// END OF EJS Templates
Display login button in read-only mode.
Stefan van der Walt -
Show More
@@ -22,12 +22,16 b' var IPython = (function (IPython) {'
22
22
23 LoginWidget.prototype.style = function () {
23 LoginWidget.prototype.style = function () {
24 this.element.find('button#logout').button();
24 this.element.find('button#logout').button();
25 this.element.find('button#login').button();
25 };
26 };
26 LoginWidget.prototype.bind_events = function () {
27 LoginWidget.prototype.bind_events = function () {
27 var that = this;
28 var that = this;
28 this.element.find("button#logout").click(function () {
29 this.element.find("button#logout").click(function () {
29 window.location = "/logout";
30 window.location = "/logout";
30 });
31 });
32 this.element.find("button#login").click(function () {
33 window.location = "/login";
34 });
31 };
35 };
32
36
33 // Set module variables
37 // Set module variables
@@ -25,6 +25,8 b''
25 <span id="login_widget">
25 <span id="login_widget">
26 {% if current_user and current_user != 'anonymous' %}
26 {% if current_user and current_user != 'anonymous' %}
27 <button id="logout">Logout</button>
27 <button id="logout">Logout</button>
28 {% else %}
29 <button id="login">Login</button>
28 {% end %}
30 {% end %}
29 </span>
31 </span>
30 {% block header %}
32 {% block header %}
@@ -54,6 +54,8 b''
54 {% comment when appropriate until notebook.html is templated %}
54 {% comment when appropriate until notebook.html is templated %}
55 {% if current_user and current_user != 'anonymous' %}
55 {% if current_user and current_user != 'anonymous' %}
56 <button id="logout">Logout</button>
56 <button id="logout">Logout</button>
57 {% else %}
58 <button id="login">Login</button>
57 {% end %}
59 {% end %}
58 </span>
60 </span>
59
61
General Comments 0
You need to be logged in to leave comments. Login now