Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Simplifying logic on login page.

  • Loading branch information...
commit a704e2466b6ebe14a46d7cbd53349baaa2d47d33 1 parent e5c5e2e
@ellisonbg ellisonbg authored committed
View
8 IPython/frontend/html/notebook/handlers.py
@@ -70,13 +70,13 @@ def get(self):
class LoginHandler(AuthenticatedHandler):
def get(self):
- self.render('login.html')
+ self.render('login.html', next='/')
def post(self):
- pwd = self.get_argument("password", default=u'')
+ pwd = self.get_argument('password', default=u'')
if self.application.password and pwd == self.application.password:
- self.set_secure_cookie("user", str(uuid.uuid4()))
- url = self.get_argument("next", default="/")
+ self.set_secure_cookie('user', str(uuid.uuid4()))
+ url = self.get_argument('next', default='/')
self.redirect(url)
View
29 IPython/frontend/html/notebook/static/js/login_main.js
@@ -0,0 +1,29 @@
+//----------------------------------------------------------------------------
+// Copyright (C) 2008-2011 The IPython Development Team
+//
+// Distributed under the terms of the BSD License. The full license is in
+// the file COPYING, distributed as part of this software.
+//----------------------------------------------------------------------------
+
+//============================================================================
+// On document ready
+//============================================================================
+
+
+$(document).ready(function () {
+
+ $('div#header').addClass('border-box-sizing');
+ $('div#header_border').addClass('border-box-sizing ui-widget ui-widget-content');
+
+ $('div#main_app').addClass('border-box-sizing ui-widget');
+ $('div#app_hbox').addClass('hbox');
+
+ $('div#left_panel').addClass('box-flex');
+ $('div#right_panel').addClass('box-flex');
+
+ // These have display: none in the css file and are made visible here to prevent FLOUC.
+ $('div#header').css('display','block');
+ $('div#main_app').css('display','block');
+
+});
+
View
17 IPython/frontend/html/notebook/templates/login.html
@@ -10,18 +10,10 @@
<link rel="stylesheet" href="static/css/boilerplate.css" type="text/css" />
<link rel="stylesheet" href="static/css/layout.css" type="text/css" />
<link rel="stylesheet" href="static/css/base.css" type="text/css" />
- <script type="text/javascript" charset="utf-8">
- function add_next_to_action(){
- // add 'next' argument to action url, to preserve redirect
- var query = location.search.substring(1);
- var form = document.forms[0];
- var action = form.getAttribute("action");
- form.setAttribute("action", action + '?' + query);
- }
- </script>
+
</head>
-<body onload="add_next_to_action()">
+<body>
<div id="header">
<span id="ipython_notebook"><h1>IPython Notebook</h1></span>
@@ -37,7 +29,7 @@
</div>
<div id="content_panel">
- <form action="/login" method="post">
+ <form action="/login?next={{url_escape(next)}}" method="post">
Password: <input type="password" name="password">
<input type="submit" value="Sign in">
</form>
@@ -52,8 +44,7 @@
<script src="static/jquery/js/jquery-1.6.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="static/jquery/js/jquery-ui-1.8.14.custom.min.js" type="text/javascript" charset="utf-8"></script>
<script src="static/js/namespace.js" type="text/javascript" charset="utf-8"></script>
-<script src="static/js/notebooklist.js" type="text/javascript" charset="utf-8"></script>
-<script src="static/js/nbbrowser_main.js" type="text/javascript" charset="utf-8"></script>
+<script src="static/js/login_main.js" type="text/javascript" charset="utf-8"></script>
</body>
Please sign in to comment.
Something went wrong with that request. Please try again.