From 31016bd38e07668236d1e1257e2d40a3fde34fe5 Mon Sep 17 00:00:00 2001 From: nanalelfe Date: Tue, 23 Aug 2016 01:52:44 -0400 Subject: Added admin signin --- assets/css/style.css | 16 +++++++++-- assets/js/script.js | 2 ++ routes/admin.js | 9 ++++++ views/partials/header.hbs | 71 +++++++++++++++++++++++++++++++++++++++++++++-- views/signin.hbs | 6 ++-- views/signin_admin.hbs | 51 ++++++++++++++++++++++++++++++++++ views/signup.hbs | 16 +++++++---- 7 files changed, 158 insertions(+), 13 deletions(-) create mode 100644 views/signin_admin.hbs diff --git a/assets/css/style.css b/assets/css/style.css index f688524..108fffe 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -567,7 +567,7 @@ hr { .input-confirm, .input-phone, .input-univ{ font-size: 1em !important; border-radius: 0 !important; - border-bottom: 0 !important; + border-bottom: 1px !important; box-shadow: none !important; } @@ -575,7 +575,7 @@ hr { font-size: 1em !important; border-radius: 0 !important; border-top-right-radius: 8px !important; - border-bottom: 0 !important; + border-bottom: 1px !important; box-shadow: none !important; } @@ -607,4 +607,16 @@ hr { .input-group-addon { min-width:50px; text-align:left; +} + +.signin-window { + padding: 0 !important; + width: auto !important; + +} + +.signin-window .modal-content { + height: auto !important; + width: 65% !important; + margin-left: 17%; } \ No newline at end of file diff --git a/assets/js/script.js b/assets/js/script.js index 44d7422..7a4c21f 100644 --- a/assets/js/script.js +++ b/assets/js/script.js @@ -24,5 +24,7 @@ function main(){ }); $('.table-row').trigger('create'); + + } $(document).ready(main); \ No newline at end of file diff --git a/routes/admin.js b/routes/admin.js index 68bb456..6a628d2 100644 --- a/routes/admin.js +++ b/routes/admin.js @@ -42,6 +42,15 @@ router.get('/', isAdmin, function(req,res){ req.session.messages = null; }); +router.get('/signin', function (req, res, next) { + var msg = req.flash('error'); + res.render('signin_admin', { + csrfToken: req.csrfToken(), + success: req.session.success, + errors: req.session.errors, + flashMsg: msg + }); +}); /** Retrieves infomation from the exam adding form and sends it to the database to add. */ router.post('/add/exam', function(req,res){ diff --git a/views/partials/header.hbs b/views/partials/header.hbs index 57db052..bce9736 100644 --- a/views/partials/header.hbs +++ b/views/partials/header.hbs @@ -119,7 +119,7 @@
  • Admin Panel
  • {{/if}} {{ else }} -
  • Sign In
  • +
  • Sign In
  • {{/if}} @@ -127,6 +127,7 @@
  • Logout
  • {{ else }}
  • Sign up
  • +
  • Admin
  • {{/if}} @@ -134,4 +135,70 @@ - \ No newline at end of file + + + + diff --git a/views/signin.hbs b/views/signin.hbs index e985c13..5f0e4c7 100644 --- a/views/signin.hbs +++ b/views/signin.hbs @@ -31,13 +31,13 @@
    - +
    - +
    @@ -47,7 +47,7 @@

    or

    - Sign in with Facebook + Sign In with Facebook diff --git a/views/signin_admin.hbs b/views/signin_admin.hbs new file mode 100644 index 0000000..35d64fe --- /dev/null +++ b/views/signin_admin.hbs @@ -0,0 +1,51 @@ +
    +
    + +
    + +
    \ No newline at end of file diff --git a/views/signup.hbs b/views/signup.hbs index 09b6c20..3c58edf 100644 --- a/views/signup.hbs +++ b/views/signup.hbs @@ -29,25 +29,29 @@


    Sign Up

    -
    -