diff --git a/app/account/account.routes.js b/app/account/account.routes.js index 16e602e4e..ed0eebd36 100644 --- a/app/account/account.routes.js +++ b/app/account/account.routes.js @@ -5,9 +5,9 @@ import angular from 'angular' angular.module('tc.account').config(routes) - routes.$inject = ['$stateProvider'] + routes.$inject = ['$stateProvider', 'CONSTANTS'] - function routes($stateProvider) { + function routes($stateProvider, CONSTANTS) { var states = { 'auth': { parent: 'root', @@ -16,6 +16,27 @@ import angular from 'angular' authRequired: false } }, + 'login': { + url: '/login?next&code&state&status&userJWTToken&utm_source&utm_medium&utm_campaign', + views: { + 'header@': {}, + 'container@': {}, + 'footer@': {} + }, + data: { + authRequired: false + }, + onEnter: ['$state', '$window', '$stateParams', 'logger', + function($state, $window, $stateParams, logger) { + var next = $state.href('dashboard', {}, {absolute: true}) + if ($stateParams.next) { + next = decodeURIComponent($stateParams.next) + } + $window.location = CONSTANTS.ACCOUNTS_APP_URL + '?retUrl=' + encodeURIComponent(next) + } + ] + + }, logout: { url: '/logout/', views: { diff --git a/app/index.js b/app/index.js index 89760c27c..344868f94 100644 --- a/app/index.js +++ b/app/index.js @@ -121,11 +121,6 @@ require('../assets/css/directives/tc-banner.scss') require('../assets/css/community/statistics.scss') require('../assets/css/community/members.scss') require('../assets/css/community/community.scss') -require('../assets/css/account/reset-password.scss') -require('../assets/css/account/registered-successfully.scss') -require('../assets/css/account/register.scss') -require('../assets/css/account/login.scss') -require('../assets/css/account/account.scss') function requireContextFiles(files) { const paths = files.keys() diff --git a/assets/css/account/account.scss b/assets/css/account/account.scss deleted file mode 100644 index 4f965df1c..000000000 --- a/assets/css/account/account.scss +++ /dev/null @@ -1,314 +0,0 @@ -@import 'topcoder/tc-includes'; - -.login-container, -.register-container, -.reset-password-container, -.registered-successfully-container { - @include font-with-weight('Merriweather Sans'); - background-color: $white; - border-radius: 3px; - box-shadow: 0 1px 6px rgba(0, 0, 0, .2); - display: flex; - flex-direction: column; - justify-content: flex-start; - width: 560px; - margin: 60px auto 0; - position: relative; - text-align: center; - header { - background-color: $gray-darkest; - border-radius: 3px 3px 0 0; - display: flex; - align-items: center; - justify-content: center; - height: 70px; - position: relative; - // CSS-olny Arrow - &:after { - border: solid transparent; - border-bottom-color: $white; - border-color: rgba(255, 255, 255, 0); - border-width: 13px; - bottom: 0; - content: ' '; - height: 0; - width: 0; - left: 50%; - margin-left: -16px; - pointer-events: none; - position: absolute; - } - .logo-link img { - display: inline-block; - height: 30px; - } - } - // Basic element stylings - h1 { - @include font-with-weight('Sofia Pro', 300); - color: $gray-darkest; - align-self: center; - width: 380px; - font-size: 20px; - line-height: 30px; - margin-bottom: 40px; - margin-top: 39px; - text-transform: uppercase; - @media (max-width: 767px) { - margin: 30px auto; - } - } - header > p, - form > p { - font-size: 15px; - line-height: 20px; - padding-bottom: 20px; - } - // registration sizes, remove - input[name='firstname'], - input[name='lastname'] { - width: 185px; - padding-right: 45px; - } - input[name='username'], - input[name='email'] { - padding-right: 85px; - } - input[type='text'], - toggle-password { - width: 380px; - } - input:not([type='checkbox']) { - width: 300px; - } - .tips, - .email-tips, - .password-tips { - @media screen and (min-width: 915px) { - left: 395px; - } - } - // Autocomplete - .angucomplete-dropdown { - box-shadow: 0 1px 3px 1px rgba(0, 0, 0, .4); - color: $gray-darkest; - width: 100%; - text-align: left; - } - .angucomplete-selected-row { - background-color: $primary-lighter; - color: $gray-darkest; - } - // Autocomplete end - button { - align-self: center; - margin-top: 20px; - } - input[type='text'], - toggle-password { - width: 380px; - } - // Social section - .networks { - display: block; - .network { - margin-left: 30px; - &:first-child { - margin-left: 0 !important; - } - & a:hover { - filter: brightness(80%); - } - span { - @include font-with-weight('Sofia Pro', 500); - color: $accent-gray; - cursor: pointer; - font-size: 10px; - line-height: 13px; - margin-top: 10px; - text-transform: uppercase; - transition: .1s all;; - } - } - .network:hover { - span { - color: $gray-darkest; - } - } - } - .login-options { - margin-bottom: 40px; - margin-top: 15px; - p { - @include font-with-weight; - color: $accent-gray; - font-size: 13px; - line-height: 22px; - text-transform: uppercase; - } - .networks { - display: flex; - justify-content: center; - padding: 0 10px; - .network { - display: flex; - flex-direction: column; - align-items: center; - p { - @include font-with-weight('Sofia Pro', 500); - color: $accent-gray; - cursor: pointer; - font-size: 10px; - line-height: 13px; - margin-top: 10px; - text-transform: uppercase; - } - .ico { - cursor: pointer; - height: 40px; - width: 40px; - margin-top: 22px; - } - } - .github { - .ico { - background-image: url(../../images/github.svg); - background-repeat: no-repeat; - color: #404041; - } - } - .facebook { - margin-left: 41px; - .ico { - background-image: url(../../images/facebook.svg); - background-repeat: no-repeat; - color: #0d72b9; - } - } - .google-plus { - margin-left: 43px; - .ico { - background-image: url(../../images/gplus.svg); - background-position: center; - background-repeat: no-repeat; - border: 1px solid #d1d3d4; - border-radius: 4px; - color: #ee4036; - } - } - .twitter { - margin-left: 40px; - .ico { - background-image: url(../../images/twitter.svg); - background-repeat: no-repeat; - color: #26a9e0; - } - } - } - } -} - -// Register Link styles -.join-topcoder { - @include font-with-weight('Sofia Pro', 500); - display: flex; - flex-flow: row wrap; - justify-content: center; - font-size: $label-small; - margin-top: 30px; - text-transform: uppercase; - a { - display: inline; - } - .redirect { - width: 111px; - padding: 8px 10px; - } -} - -.fold-pusher { - height: 0; - max-height: 0; -} - -.account-footer { - display: flex; - flex-flow: row wrap; - justify-content: center; - padding: 0 0 30px; - .copyright-notice { - color: $gray-dark; - } -} - - -@media (max-width: 767px) { - .login-container, - .register-container, - .reset-password-container, - .registered-successfully-container { - width: 100%; - margin: 0 auto; - h1 { - width: 100%; - } - form { - width: 100%; - margin-left: 0; - padding: 0 20px; - input[type='text'], - input[type='email'], - toggle-password, - toggle-password-with-tips { - width: 100%; - } - } - } - - .register-container { - margin: 0 auto; - } - - .registered-successfully-container { - margin: 0 auto; - p.message { - padding: 34px 30px 124px 30px; - } - } -} - - -// The separator for login options -.tc-separator { - $sp-width: 340px; - display: block; - width: $sp-width; - margin: 0 auto; - position: relative; - text-align: center; - &:after { - background-color: $gray-light; - content: ' '; - display: block; - height: 1px; - width: $sp-width; - overflow: hidden; - position: absolute; - top: 50%; - z-index: 99; - } - & span { - background: $white; - border: none; - display: inline-block; - font-family: 'Sofia Pro', Arial, sans-serif; - font-size: 10px; - font-weight: 500; - padding: 0 15px; - position: relative; - text-align: center; - text-transform: uppercase; - top: 0; - z-index: 100; - } -} diff --git a/assets/css/account/login.scss b/assets/css/account/login.scss deleted file mode 100644 index 0d23ca2ba..000000000 --- a/assets/css/account/login.scss +++ /dev/null @@ -1,45 +0,0 @@ -@import 'topcoder/tc-includes'; - -.login-container { - form { - display: flex; - flex-flow: column wrap; - justify-content: center; - margin: 0 90px; - input[type='text'], - toggle-password { - width: 380px; - } - toggle-password { - } - - p + button { - margin-top: 0; - } - } - .form-errors { - p { - margin-bottom: 20px; - } - } - .problem-signin { - @include font-with-weight('Merriweather Sans'); - color: #a3a3ae; - font-size: 12px; - line-height: 15px; - margin-top: 10px; - .forgot-password { - font-size: 12px; - margin-bottom: 25px; - margin-top: 25px; - } - } - section.login-options { - @media (max-width: 767px) { - margin-bottom: 41px; - } - @media (min-width: 768px) { - margin-bottom: 60px; - } - } -} diff --git a/assets/css/account/register.scss b/assets/css/account/register.scss deleted file mode 100644 index 7092a17f9..000000000 --- a/assets/css/account/register.scss +++ /dev/null @@ -1,81 +0,0 @@ -@import 'topcoder/tc-includes'; - -.register-container { - form { - display: flex; - flex-flow: column wrap; - justify-content: center; - width: 380px; - margin-left: 90px; - margin-right: 90px; - input[type='text'], - input[type='email'], - toggle-password, - toggle-password-with-tips { - width: 380px; - } - input[name='firstname'], - input[name='lastname'] { - width: 185px; - padding-right: 45px; - } - input[name='username'], - input[name='email'] { - padding-right: 85px; - } - button { - margin-top: 0; - } - } - .form-errors { - text-align: left; - p { - margin: 2px 0 12px 5px; - } - } - .first-last-names { - display: flex; - flex-direction: row; - justify-content: space-between; - width: 380px; - } - .terms { - margin-bottom: 20px; - margin-top: 10px; - p { - color: #a3a3ae; - font-size: 12px; - line-height: 15px; - } - } - // login-options section - .section-break { - hr { - border: none; - border-bottom: 1px solid $gray-light; - margin: 10px auto 20px; - max-width: 180px; - } - } -} - - -@media (max-width: 767px) { - .register-container { - form { - .first-last-names { - display: flex; - flex-direction: column; - width: 100%; - } - } - section.login-options { - margin-bottom: 41px; - } - } - - .join-topcoder { - margin-top: 30px; - position: initial; - } -} diff --git a/assets/css/account/registered-successfully.scss b/assets/css/account/registered-successfully.scss deleted file mode 100644 index 5fff4e12d..000000000 --- a/assets/css/account/registered-successfully.scss +++ /dev/null @@ -1,10 +0,0 @@ -@import 'topcoder/tc-includes'; - -.registered-successfully-container { - p { - font-size: 20px; - line-height: 30px; - color: #3D3D3D; - padding: 62px 90px 154px 90px; - } -} diff --git a/assets/css/account/reset-password.scss b/assets/css/account/reset-password.scss deleted file mode 100644 index 1e62cd313..000000000 --- a/assets/css/account/reset-password.scss +++ /dev/null @@ -1,31 +0,0 @@ -@import 'topcoder/tc-includes'; - -.reset-password-container { - form { - display: flex; - flex-flow: column wrap; - justify-content: center; - margin-left: 90px; - margin-right: 90px; - input[type='text'], - input[type='email'], - toggle-password-with-tips { - width: 380px; - } - toggle-password, - toggle-password-with-tips { - input#password-input, - input#current-password-input { - width: 300px; - } - } - button { - align-self: center; - } - } - .link { - font-size: 12px; - margin-bottom: 25px; - margin-top: 25px; - } -}