From 5f58f7b8adc686ab14e5b1180faf0ff57d884da8 Mon Sep 17 00:00:00 2001 From: David Baldwynn Date: Thu, 25 Aug 2016 16:33:10 -0700 Subject: [PATCH] fixed logout bug --- app/models/user.server.model.js | 8 +- app/views/layout.server.view.html | 3 +- config/strategies/local.js | 5 +- .../controllers/header.client.controller.js | 5 +- public/modules/core/css/core.css | 56 +++------ public/modules/core/css/equal-height.css | 114 ------------------ .../core/views/header.client.view.html | 4 +- .../admin/views/admin-form.client.view.html | 2 + .../admin/views/list-forms.client.view.html | 2 + public/modules/forms/base/css/form.css | 8 +- public/modules/users/config/i18n/english.js | 8 +- public/modules/users/css/users.css | 70 ++++++++++- .../access-denied.client.view.html | 2 +- .../authentication/signin.client.view.html | 66 +++++----- .../signup-success.client.view.html | 2 +- .../authentication/signup.client.view.html | 106 ++++++++-------- .../resend-verify-email.client.view.html | 2 +- .../verify/verify-account.client.view.html | 2 +- 18 files changed, 209 insertions(+), 256 deletions(-) delete mode 100644 public/modules/core/css/equal-height.css diff --git a/app/models/user.server.model.js b/app/models/user.server.model.js index 1cd700ab..a39a40ab 100755 --- a/app/models/user.server.model.js +++ b/app/models/user.server.model.js @@ -46,19 +46,19 @@ var UserSchema = new Schema({ type: String, trim: true, default: '', - validate: { + /*validate: { validator: validateLocalStrategyProperty, message: 'Please fill in your first name' - } + }*/ }, lastName: { type: String, trim: true, default: '', - validate: { + /*validate: { validator: validateLocalStrategyProperty, message: 'Please fill in your last name' - } + }*/ }, email: { type: String, diff --git a/app/views/layout.server.view.html b/app/views/layout.server.view.html index c9ec3f89..20061dcf 100755 --- a/app/views/layout.server.view.html +++ b/app/views/layout.server.view.html @@ -34,6 +34,8 @@ + + {% for bowerCssFile in bowerCssFiles %} @@ -66,7 +68,6 @@ Fork me on GitHub --> -
{% block content %}{% endblock %} diff --git a/config/strategies/local.js b/config/strategies/local.js index ad560524..cfafa966 100755 --- a/config/strategies/local.js +++ b/config/strategies/local.js @@ -15,7 +15,10 @@ module.exports = function() { }, function(username, password, done) { User.findOne({ - username: username + $or: [ + { "username": username}, + { "email": username} + ] }, function(err, user) { if (err) { return done(err); diff --git a/public/modules/core/controllers/header.client.controller.js b/public/modules/core/controllers/header.client.controller.js index 22e70bc4..e3aa98b0 100755 --- a/public/modules/core/controllers/header.client.controller.js +++ b/public/modules/core/controllers/header.client.controller.js @@ -30,9 +30,12 @@ angular.module('core').controller('HeaderController', ['$rootScope', '$scope', ' Auth.ensureHasCurrentUser(User); $scope.user = $rootScope.user = null; $state.go('listForms'); + + //Refresh view + $state.reload(); }, function(reason) { - console.log('Logout Failed: ' + reason); + console.error('Logout Failed: ' + reason); }); }; diff --git a/public/modules/core/css/core.css b/public/modules/core/css/core.css index 6bf68c22..3957f97b 100755 --- a/public/modules/core/css/core.css +++ b/public/modules/core/css/core.css @@ -1,67 +1,47 @@ body { overflow-x: hidden; + font-family: 'Source Sans Pro', sans-serif; + font-size: 16px; } -section.content { - padding-top: 5em; +.vcenter { + display: inline-block; + vertical-align: middle; + float: none; } /*Navbar Custom CSS*/ +.navbar { + min-height: 60px; +} .navbar-inverse { background-color:#588EB4; border: 0; + color: white!important; } -.navbar .navbar-brand { - font-size: 1.6em; - font-weight: 900; +.navbar li > * { + border-bottom: 4px solid white; color: white; } -.navbar .navbar-brand:hover, .navbar .navbar-brand:visited { - color: #ddd; +.navbar li:hover > * { + border-bottom: 2px solid #ddd; +} + +.navbar-inverse .navbar-nav>li>a { + color: white; } .navbar li.dropdown a.dropdown-toggle:hover > *{ color: #f9f9f9; } -.navbar li.dropdown a.dropdown-toggle > *{ - color: #ddd; -} - -.navbar .navbar-brand span { - text-decoration: underline; -} -.nav.navbar-nav.navbar-right li { - padding-right: 20px; -} - -.navbar-inverse .navbar-nav>li>a, .navbar li.dropdown a.dropdown-toggle > * { - color: #ddd; -} -.navbar-inverse .navbar-nav .active > a, .navbar li.dropdown.open a.dropdown-toggle > *, .navbar-inverse .navbar-nav>.open>a, .navbar-inverse .navbar-nav>.open>a, .navbar-inverse .navbar-nav>.open>a:focus, .navbar-inverse .navbar-nav>.open>a:hover { - background-color: #6450A0; - color: #ddd; -} .navbar-inverse .navbar-toggle { - background-color: #ddd; border:none; } -.navbar-inverse .navbar-toggle:hover, .navbar-inverse .navbar-toggle:focus { - color: white; -} -.navbar-inverse .navbar-collapse{ - border: none; -} - .undecorated-link:hover { text-decoration: none; } [ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak { display: none !important; } -.browsehappy.jumbotron.hide, -body.ng-cloak -{ - display: block; -} /*Hero Section CSS (for /home)*/ section.hero-section { diff --git a/public/modules/core/css/equal-height.css b/public/modules/core/css/equal-height.css deleted file mode 100644 index bafa16e7..00000000 --- a/public/modules/core/css/equal-height.css +++ /dev/null @@ -1,114 +0,0 @@ -/* columns of same height styles */ - -.row-height { - display: table; - table-layout: fixed; - height: 100%; - width: 100%; -} -.col-height { - display: table-cell; - float: none; - height: 100%; -} -.col-top { - vertical-align: top; -} -.col-middle { - vertical-align: middle; -} -.col-bottom { - vertical-align: bottom; -} - -@media (min-width: 480px) { - .row-xs-height { - display: table; - table-layout: fixed; - height: 100%; - width: 100%; - } - .col-xs-height { - display: table-cell; - float: none; - height: 100%; - } - .col-xs-top { - vertical-align: top; - } - .col-xs-middle { - vertical-align: middle; - } - .col-xs-bottom { - vertical-align: bottom; - } -} - -@media (min-width: 768px) { - .row-sm-height { - display: table; - table-layout: fixed; - height: 100%; - width: 100%; - } - .col-sm-height { - display: table-cell; - float: none; - height: 100%; - } - .col-sm-top { - vertical-align: top; - } - .col-sm-middle { - vertical-align: middle; - } - .col-sm-bottom { - vertical-align: bottom; - } -} - -@media (min-width: 992px) { - .row-md-height { - display: table; - table-layout: fixed; - height: 100%; - width: 100%; - } - .col-md-height { - display: table-cell; - float: none; - height: 100%; - } - .col-md-top { - vertical-align: top; - } - .col-md-middle { - vertical-align: middle; - } - .col-md-bottom { - vertical-align: bottom; - } -} - -@media (min-width: 1200px) { - .row-lg-height { - display: table; - table-layout: fixed; - height: 100%; - width: 100%; - } - .col-lg-height { - display: table-cell; - float: none; - height: 100%; - } - .col-lg-top { - vertical-align: top; - } - .col-lg-middle { - vertical-align: middle; - } - .col-lg-bottom { - vertical-align: bottom; - } -} \ No newline at end of file diff --git a/public/modules/core/views/header.client.view.html b/public/modules/core/views/header.client.view.html index 1f137028..c7b2b842 100755 --- a/public/modules/core/views/header.client.view.html +++ b/public/modules/core/views/header.client.view.html @@ -49,8 +49,8 @@ -
  • - {{ 'SIGNOUT_TAB' | translate }} +
  • + {{ 'SIGNOUT_TAB' | translate }}
  • diff --git a/public/modules/forms/admin/views/admin-form.client.view.html b/public/modules/forms/admin/views/admin-form.client.view.html index e2d674db..74d9e5a3 100644 --- a/public/modules/forms/admin/views/admin-form.client.view.html +++ b/public/modules/forms/admin/views/admin-form.client.view.html @@ -1,3 +1,5 @@ +
    +
    diff --git a/public/modules/forms/admin/views/list-forms.client.view.html b/public/modules/forms/admin/views/list-forms.client.view.html index 8775c280..f22f6602 100644 --- a/public/modules/forms/admin/views/list-forms.client.view.html +++ b/public/modules/forms/admin/views/list-forms.client.view.html @@ -1,3 +1,5 @@ +
    +
    diff --git a/public/modules/forms/base/css/form.css b/public/modules/forms/base/css/form.css index eb54f1ff..be49f0ff 100644 --- a/public/modules/forms/base/css/form.css +++ b/public/modules/forms/base/css/form.css @@ -60,11 +60,11 @@ section.content p.breakwords { word-break: break-all; } -.btn { +.public-form .btn { border: 1px solid #c6c6c6; } -.btn[type='submit'] { +.public-form .btn[type='submit'] { font-size: 1.5em; padding: 0.35em 1.2em 0.35em 1.2em; } @@ -82,7 +82,7 @@ section.content > section > section.container { font-size: 18px; font-weight: normal; } -.input-block { +.public-form .input-block { display: block; width: 100%; } @@ -116,7 +116,7 @@ div.form-fields { position: relative; padding-top: 35vh; } -.letter { +.public-form .letter { position: relative; display: -moz-inline-stack; display: inline-block; diff --git a/public/modules/users/config/i18n/english.js b/public/modules/users/config/i18n/english.js index 721a575f..3dbbdca3 100644 --- a/public/modules/users/config/i18n/english.js +++ b/public/modules/users/config/i18n/english.js @@ -4,7 +4,7 @@ angular.module('users').config(['$translateProvider', function ($translateProvid $translateProvider.translations('en', { ACCESS_DENIED_TEXT: 'You need to be logged in to access this page', - USERNAME_LABEL: 'Username', + USERNAME_LABEL: 'Username or Email', PASSWORD_LABEL: 'Password', CURRENT_PASSWORD_LABEL: 'Current Password', NEW_PASSWORD_LABEL: 'New Password', @@ -15,8 +15,10 @@ angular.module('users').config(['$translateProvider', function ($translateProvid LANGUAGE_LABEL: 'Language', EMAIL_LABEL: 'Email', - SIGNUP_HEADER_TEXT: 'Sign up with your email', - SIGNIN_HEADER_TEXT: 'Sign in with your email or username', + SIGNUP_ACCOUNT_LINK: 'Don\'t have an account? Sign up here', + SIGN_IN_ACCOUNT_LINK: 'Already have an account? Sign in here', + SIGNUP_HEADER_TEXT: 'Sign up', + SIGNIN_HEADER_TEXT: 'Sign in', SIGNUP_ERROR_TEXT: 'Couldn\'t complete registration due to errors', diff --git a/public/modules/users/css/users.css b/public/modules/users/css/users.css index 1ff56d76..d6155e0a 100755 --- a/public/modules/users/css/users.css +++ b/public/modules/users/css/users.css @@ -1,6 +1,10 @@ section.auth { - margin-top: -5em; - padding-top: 5em; + padding: 70px 0; + position: absolute; + min-height: 100%; + top: 0; + left: 0; + width: 100%; color: white; background-color: #1e5799; /* Old browsers */ background: -moz-linear-gradient(137deg, #50B5C1 0%, #6450A0 85%); /* FF3.6-15 */ @@ -8,19 +12,37 @@ section.auth { background: linear-gradient(137deg, #50B5C1 0%, #6450A0 85%); background: linear-gradient(137deg, #50B5C1 0%, #6450A0 85%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#50B5C1', endColorstr='#6450A0', GradientType=1); /* IE6-9 fallback on horizontal gradient */ - } section.auth > h3{ - font-size: 3em; + font-size: 2em; font-weight: 500; } + .valign-wrapper { + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; + } + + .valign-wrapper .valign { + display: block; + width: 100%; + } + + section.auth a { + color: white; + text-decoration: underline; + } + section.auth.signup-view > h3 { - font-size: 4.4em; + font-size: 3em; padding-bottom: 0.5em; } - .row.auth form .field-input select { + section.auth form .field-input select { padding: 0.45em 0.9em; width: 100%; background: transparent; @@ -29,6 +51,30 @@ section.auth { height: 34px; } + section.auth input { + color: #4c4c4c; + } + + .btn { + border-radius: 100px; + font-size: 14px; + padding: 12px 28px; + margin-top: 1em; + text-transform: uppercase; + } + + section.auth .btn-signup { + background-color: #FFD747; + color: #896D0B; + border: 2px #FFD747 solid; + width: 100%; + } + section.auth .btn-signup:hover { + color: #FFD747; + background-color: #896D0B; + border: 2px #896D0B solid; + } + @media (min-width: 992px) { .nav-users { position: fixed; @@ -44,3 +90,15 @@ section.auth { position: absolute; } +input.form-control { + border: none; + border-radius: 4px; + color: white; + box-shadow: none; + font-size: 18px; + padding: 30px 20px; +} + +.btn { + border: none; +} diff --git a/public/modules/users/views/authentication/access-denied.client.view.html b/public/modules/users/views/authentication/access-denied.client.view.html index 30d8151f..213b568b 100644 --- a/public/modules/users/views/authentication/access-denied.client.view.html +++ b/public/modules/users/views/authentication/access-denied.client.view.html @@ -1,4 +1,4 @@ -
    +

    {{ 'ACCESS_DENIED_TEXT' | translate }}

    {{ 'SIGNIN_BTN' | translate }}
    diff --git a/public/modules/users/views/authentication/signin.client.view.html b/public/modules/users/views/authentication/signin.client.view.html index e28ca2a8..7eb341d5 100755 --- a/public/modules/users/views/authentication/signin.client.view.html +++ b/public/modules/users/views/authentication/signin.client.view.html @@ -1,5 +1,5 @@ -
    -

    {{ 'SIGNIN_HEADER_TEXT' | translate }}

    +
    + -
    - +
    +
    + +
    + + +
    diff --git a/public/modules/users/views/authentication/signup-success.client.view.html b/public/modules/users/views/authentication/signup-success.client.view.html index 3bef57f6..44e70467 100755 --- a/public/modules/users/views/authentication/signup-success.client.view.html +++ b/public/modules/users/views/authentication/signup-success.client.view.html @@ -1,4 +1,4 @@ -