##// END OF EJS Templates
Add logout button.
Stefan van der Walt -
Show More
@@ -0,0 +1,5 b''
1 {% extends layout.html %}
2
3 {% block content_panel %}
4 You've been successfully logged out.
5 {% end %}
@@ -196,6 +196,13 b' class LoginHandler(AuthenticatedHandler):'
196 196 self.redirect(self.get_argument('next', default='/'))
197 197
198 198
199 class LogoutHandler(AuthenticatedHandler):
200
201 def get(self):
202 self.clear_cookie('username')
203 self.render('logout.html')
204
205
199 206 class NewHandler(AuthenticatedHandler):
200 207
201 208 @web.authenticated
@@ -40,7 +40,7 b' from tornado import web'
40 40
41 41 # Our own libraries
42 42 from .kernelmanager import MappingKernelManager
43 from .handlers import (LoginHandler,
43 from .handlers import (LoginHandler, LogoutHandler,
44 44 ProjectDashboardHandler, NewHandler, NamedNotebookHandler,
45 45 MainKernelHandler, KernelHandler, KernelActionHandler, IOPubHandler,
46 46 ShellHandler, NotebookRootHandler, NotebookHandler, RSTHandler
@@ -87,6 +87,7 b' class NotebookWebApplication(web.Application):'
87 87 handlers = [
88 88 (r"/", ProjectDashboardHandler),
89 89 (r"/login", LoginHandler),
90 (r"/logout", LogoutHandler),
90 91 (r"/new", NewHandler),
91 92 (r"/%s" % _notebook_id_regex, NamedNotebookHandler),
92 93 (r"/kernels", MainKernelHandler),
@@ -21,12 +21,12 b' var IPython = (function (IPython) {'
21 21 };
22 22
23 23 LoginWidget.prototype.style = function () {
24 this.element.find('button#login').button();
24 this.element.find('button#logout').button();
25 25 };
26 26 LoginWidget.prototype.bind_events = function () {
27 27 var that = this;
28 this.element.find("button#login").click(function () {
29 window.location = "/login?next="+location.pathname;
28 this.element.find("button#logout").click(function () {
29 window.location = "/logout";
30 30 });
31 31 };
32 32
@@ -13,16 +13,17 b''
13 13 {% block stylesheet %}
14 14 {% end %}
15 15
16 <meta name="read_only" content="{{read_only}}"/>
16 {% block meta %}
17 {% end %}
17 18
18 19 </head>
19 20
20 <body>
21 <body {% block params %}{% end %}>
21 22
22 23 <div id="header">
23 24 <span id="ipython_notebook"><h1>IPython Notebook</h1></span>
24 <span id="login_widget" class="hidden">
25 <button id="login">Login</button>
25 <span id="login_widget">
26 <button id="logout">Logout</button>
26 27 </span>
27 28 {% block header %}
28 29 {% end %}
@@ -59,8 +59,8 b''
59 59 <span id="quick_help_area">
60 60 <button id="quick_help">Quick<u>H</u>elp</button>
61 61 </span>
62 <span id="login_widget" class="hidden">
63 <button id="login">Login</button>
62 <span id="login_widget">
63 <button id="logout">Logout</button>
64 64 </span>
65 65 <span id="kernel_status">Idle</span>
66 66 </div>
@@ -8,6 +8,16 b' IPython Dashboard'
8 8 <link rel="stylesheet" href="static/css/projectdashboard.css" type="text/css" />
9 9 {% end %}
10 10
11 {% block meta %}
12 <meta name="read_only" content="{{read_only}}"/>
13 {% end %}
14
15 {% block params %}
16 data-project={{project}}
17 data-base-project-url={{base_project_url}}
18 data-base-kernel-url={{base_kernel_url}}
19 {% end %}
20
11 21 {% block content_panel %}
12 22 <div id="content_toolbar">
13 23 <span id="drag_info">Drag files onto the list to import notebooks.</span>
General Comments 0
You need to be logged in to leave comments. Login now