diff --git a/jupyterhub/handlers/pages.py b/jupyterhub/handlers/pages.py index 7a088835..7dc039bd 100644 --- a/jupyterhub/handlers/pages.py +++ b/jupyterhub/handlers/pages.py @@ -30,6 +30,7 @@ class RootHandler(BaseHandler): class HomeHandler(BaseHandler): """Render the user's home page.""" + @web.authenticated def get(self): html = self.render_template('home.html', @@ -40,6 +41,7 @@ class HomeHandler(BaseHandler): class AdminHandler(BaseHandler): """Render the admin page.""" + @admin_only def get(self): html = self.render_template('admin.html', @@ -48,8 +50,9 @@ class AdminHandler(BaseHandler): ) self.finish(html) + default_handlers = [ (r'/', RootHandler), (r'/home', HomeHandler), (r'/admin', AdminHandler), -] \ No newline at end of file +] diff --git a/share/jupyter/static/less/login.less b/share/jupyter/static/less/login.less new file mode 100644 index 00000000..5873050d --- /dev/null +++ b/share/jupyter/static/less/login.less @@ -0,0 +1,49 @@ +#login-main { + & > form { + margin: 80px auto; + width: 400px; + padding: 50px; + margin-top: 8px; + border: 1px solid black; + } + + + & .input-group{ + width:100%; + } + + & .input-group-addon { + width:100px; + border-radius:0; + } + + & .form-control{ + font-size:large; + } + + & input[type=username] + { + width:100%; + border-radius:0; + } + + & input[type=password]{ + width:100%; + margin-top:-1px; + border-radius:0; + } + + & button[type=submit]{ + margin-top:10px; + width:100%; + } + + & input[type=password]:focus,input[type=username]:focus{ + z-index: 5; + } + + & #pwd-addon{ + border-top:none; + } + +} diff --git a/share/jupyter/static/less/style.less b/share/jupyter/static/less/style.less index 41a0522c..9611fc0c 100644 --- a/share/jupyter/static/less/style.less +++ b/share/jupyter/static/less/style.less @@ -24,3 +24,4 @@ @import "./page.less"; @import "./error.less"; @import "./logout.less"; +@import "./login.less"; diff --git a/share/jupyter/templates/login.html b/share/jupyter/templates/login.html index 6b1d525b..6a1234df 100644 --- a/share/jupyter/templates/login.html +++ b/share/jupyter/templates/login.html @@ -7,25 +7,19 @@