From 6dc5e91ebf84181bc8ca1057d5338296d918931c Mon Sep 17 00:00:00 2001 From: Julie Lala Date: Sat, 7 Jun 2014 04:59:46 -0400 Subject: tuck away signed-in notice --- server/index.js | 1 + server/lib/middleware.js | 1 + views/partials/edit-profile.ejs | 102 ++++++++++++++++++++-------------------- views/partials/footer.ejs | 13 +++++ views/partials/header.ejs | 7 +-- 5 files changed, 71 insertions(+), 53 deletions(-) diff --git a/server/index.js b/server/index.js index 01f861b..05d353d 100644 --- a/server/index.js +++ b/server/index.js @@ -69,6 +69,7 @@ app.get('/auth/twitter/callback', auth.loggedIn('twitter')); app.get('/auth/facebook', auth.login('facebook')); app.get('/auth/facebook/callback', auth.loggedIn('facebook')); app.get('/profile', views.profile) +app.get('/profile/edit', views.profile) app.get(/^\/([-_a-zA-Z0-9]+)\/?$/, views.profile) diff --git a/server/lib/middleware.js b/server/lib/middleware.js index 83613e3..fb19e68 100644 --- a/server/lib/middleware.js +++ b/server/lib/middleware.js @@ -40,6 +40,7 @@ var middleware = { res.locals.logged_in = req.isAuthenticated() res.locals.user = req.user || {} res.locals.config = config + res.locals.profile = null next() }, diff --git a/views/partials/edit-profile.ejs b/views/partials/edit-profile.ejs index 1ac69d7..d7c9a34 100644 --- a/views/partials/edit-profile.ejs +++ b/views/partials/edit-profile.ejs @@ -14,54 +14,56 @@ -
  • - -
    - -
    -
  • -
  • - -
    - -
    -
  • -
  • - -
    - -
    -
  • -
  • - -
    - -

    please choose a picture at least 500px wide

    -
  • -
  • -

    Edit Password

    -
  • -
  • - -
    - -
    -
  • -
  • - -
    - -
    -
  • -
  • - -
    - -
    -
  • +
  • + +
    + +
    +
  • +
  • + +
    + +
    +
  • +
  • + +
    + +
    +
  • +
  • + +
    + +

    please choose a picture at least 500px wide

    +
  • +
  • +

    Edit Password

    +
  • +
  • + +
    + +
    +
  • +
  • + +
    + +
    +
  • +
  • + +
    + +
    +
  • -
  • - -
  • - - \ No newline at end of file +
  • + +
  • + + + + \ No newline at end of file diff --git a/views/partials/footer.ejs b/views/partials/footer.ejs index f1bd0a8..df48cf3 100644 --- a/views/partials/footer.ejs +++ b/views/partials/footer.ejs @@ -1,5 +1,18 @@ diff --git a/views/partials/header.ejs b/views/partials/header.ejs index fce96cc..d6c8fa9 100644 --- a/views/partials/header.ejs +++ b/views/partials/header.ejs @@ -2,10 +2,11 @@ [[ if (logged_in) { ]] - [[- user.displayName ]] - View Profile + [[ if (profile && user._id == profile._id) { ]] Edit Profile - Sign Out + [[ } else if (! profile) { ]] + View Profile + [[ } ]] [[ } else { ]] -- cgit v1.2.3-70-g09d2