diff --git a/IPython/frontend/html/notebook/handlers.py b/IPython/frontend/html/notebook/handlers.py index 9df4b2e..92c821e 100644 --- a/IPython/frontend/html/notebook/handlers.py +++ b/IPython/frontend/html/notebook/handlers.py @@ -174,7 +174,7 @@ class ProjectDashboardHandler(AuthenticatedHandler): class LoginHandler(AuthenticatedHandler): - def _render(self, message=''): + def _render(self, message=None): self.render('login.html', next=self.get_argument('next', default='/'), read_only=self.read_only, @@ -190,7 +190,7 @@ class LoginHandler(AuthenticatedHandler): if passwd_check(self.application.password, pwd): self.set_secure_cookie('username', str(uuid.uuid4())) else: - self._render(message='Invalid password') + self._render(message={'error': 'Invalid password'}) return self.redirect(self.get_argument('next', default='/')) @@ -200,7 +200,7 @@ class LogoutHandler(AuthenticatedHandler): def get(self): self.clear_cookie('username') - self.render('logout.html') + self.render('logout.html', message={'info': 'Successfully logged out.'}) class NewHandler(AuthenticatedHandler): diff --git a/IPython/frontend/html/notebook/static/css/layout.css b/IPython/frontend/html/notebook/static/css/layout.css index b9e0b08..d8bec47 100644 --- a/IPython/frontend/html/notebook/static/css/layout.css +++ b/IPython/frontend/html/notebook/static/css/layout.css @@ -102,12 +102,27 @@ box-pack: center; } -#message { - border: 1px solid red; - background-color: #FFD3D1; +.message { + border-width: 1px; + border-style: solid; text-align: center; padding: 0.5em; - margin: 0.5em; + margin: 0.5em 0; +} + +.message.error { + background-color: #FFD3D1; + border-color: red; +} + +.message.warning { + background-color: #FFD09E; + border-color: orange; +} + +.message.info { + background-color: #CBFFBA; + border-color: green; } #content_panel { diff --git a/IPython/frontend/html/notebook/templates/layout.html b/IPython/frontend/html/notebook/templates/layout.html index 9235a6b..ae8a016 100644 --- a/IPython/frontend/html/notebook/templates/layout.html +++ b/IPython/frontend/html/notebook/templates/layout.html @@ -42,9 +42,12 @@