Display login button in read-only mode.

Stefan van der Walt 14 years ago
parent b98a86f818
commit ec89b7c98b

@ -22,12 +22,16 @@ var IPython = (function (IPython) {
LoginWidget.prototype.style = function () {
this.element.find('button#logout').button();
this.element.find('button#login').button();
};
LoginWidget.prototype.bind_events = function () {
var that = this;
this.element.find("button#logout").click(function () {
window.location = "/logout";
});
this.element.find("button#login").click(function () {
window.location = "/login";
});
};
// Set module variables

@ -25,6 +25,8 @@
<span id="login_widget">
{% if current_user and current_user != 'anonymous' %}
<button id="logout">Logout</button>
{% else %}
<button id="login">Login</button>
{% end %}
</span>
{% block header %}

@ -54,6 +54,8 @@
{% comment when appropriate until notebook.html is templated %}
{% if current_user and current_user != 'anonymous' %}
<button id="logout">Logout</button>
{% else %}
<button id="login">Login</button>
{% end %}
</span>

Loading…
Cancel
Save