Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit 4c11826

Browse files
author
Nick Litwin
committed
Progress on login ui
1 parent ace14cc commit 4c11826

14 files changed

+111
-19
lines changed

.editorconfig

+3
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,6 @@ insert_final_newline = true
1111

1212
[*.md]
1313
trim_trailing_whitespace = false
14+
15+
[*.jade]
16+
trim_trailing_whitespace = false

app/account/account.routes.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,13 @@
1717
authRequired: false
1818
},
1919
views: {
20+
'header@': {
21+
templateUrl: 'layout/header/account-header.html'
22+
},
2023
'container@': {
2124
templateUrl: 'account/login/login.html',
22-
controller: 'LoginController'
25+
controller: 'LoginController',
26+
controllerAs: 'vm'
2327
},
2428
'footer@': {
2529
// no footer
@@ -34,6 +38,9 @@
3438
authRequired: false
3539
},
3640
views: {
41+
'header@': {
42+
templateUrl: 'layout/header/account-header.html'
43+
},
3744
'container@': {
3845
templateUrl: 'account/register/register.html',
3946
controller: 'RegisterController'

app/account/login/login.controller.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77

88
function LoginController($log, $state, $stateParams, auth, $location) {
99
var vm = this;
10-
vm.name = 'login';
10+
vm.passwordReset = true;
11+
vm.userDoesntExist = true;
12+
vm.wrongPassword = true;
1113

1214
// check if the user is already logged in
1315
if (auth.isAuthenticated()) {

app/account/login/login.jade

+18-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1-
h1(ng-controller="LoginController as vm") This is the {{vm.name}} page content
1+
.login-container
2+
h1 Login
23

3-
a(ui-sref="register") Link to Register
4+
p(ng-show="vm.passwordReset", ng-class="{'login-notice': vm.passwordReset}") Your password has been reset. You may now login.
5+
6+
p(ng-show="vm.userDoesntExist", ng-class="{'login-error': vm.userDoesntExist}") This user does not exist.
7+
8+
p(ng-show="vm.wrongPassword", ng-class="{'login-error': vm.wrongPassword}") That password doesn't match the one we have on file. Please try again.
9+
10+
form(name="login-form")
11+
input(name="username")
12+
13+
input(name="password")
14+
15+
button(type="submit") Login
16+
17+
18+
p Don't have an account?
19+
a(ui-sref="register") Join Now.

app/account/login/login.spec.js

+10-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,16 @@ describe('Login Controller', function() {
1818
expect(controller).to.be.defined;
1919
});
2020

21-
it('should have a name property', function() {
22-
expect(controller.name).to.be.defined;
21+
it('should have a passwordReset property', function() {
22+
expect(controller.passwordReset).to.be.defined;
23+
});
24+
25+
it('should have a userDoesntExist property', function() {
26+
expect(controller.userDoesntExist).to.be.defined;
27+
});
28+
29+
it('should have a wrongPassword property', function() {
30+
expect(controller.wrongPassword).to.be.defined;
2331
});
2432

2533
it('should have login as the name property', function() {

app/index.jade

+7-6
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ html
1818
link(rel="stylesheet", href="assets/css/account/account.css")
1919
link(rel="stylesheet", href="assets/css/account/login.css")
2020
link(rel="stylesheet", href="assets/css/account/register.css")
21+
link(rel="stylesheet", href="assets/css/layout/account-header.css")
2122
link(rel="stylesheet", href="assets/css/layout/footer.css")
2223
link(rel="stylesheet", href="assets/css/layout/header.css")
2324
link(rel="stylesheet", href="assets/css/peer-review/completed.css")
@@ -32,7 +33,7 @@ html
3233

3334

3435
//- include ./layout/header/header.jade
35-
div(ui-view="header")
36+
#header(ui-view="header")
3637

3738
//- include ./layout/header/sidebar.jade
3839
div(ui-view="sidebar")
@@ -51,7 +52,7 @@ html
5152
script(src='../bower_components/angular-cookies/angular-cookies.js')
5253
script(src='../bower_components/angular-jwt/dist/angular-jwt.js')
5354
script(src='../bower_components/moment/moment.js')
54-
script(src='../bower_components/lodash/lodash.js')
55+
script(src='../bower_components/lodash/dist/lodash.compat.js')
5556
script(src='../bower_components/restangular/dist/restangular.js')
5657
//- endbower
5758
//- inject:nonBowerScripts
@@ -69,8 +70,8 @@ html
6970
script(src="topcoder.interceptors.js")
7071
script(src="topcoder.routes.js")
7172
script(src="account/account.module.js")
72-
script(src="layout/layout.module.js")
7373
script(src="peer-review/peer-review.module.js")
74+
script(src="layout/layout.module.js")
7475
script(src="sample/sample.module.js")
7576
script(src="blocks/exception/exception.module.js")
7677
script(src="blocks/logger/logger.module.js")
@@ -88,17 +89,17 @@ html
8889
script(src="services/review.service.js")
8990
script(src="services/scorecard.service.js")
9091
script(src="services/user.service.js")
91-
script(src="account/login/login.controller.js")
92+
script(src="account/register/register.controller.js")
9293
script(src="blocks/exception/exception-handler.provider.js")
9394
script(src="blocks/exception/exception.js")
94-
script(src="account/register/register.controller.js")
95+
script(src="account/login/login.controller.js")
9596
script(src="blocks/logger/logger.js")
96-
script(src="layout/header/header.controller.js")
9797
script(src="peer-review/completed-review/completed-review.controller.js")
9898
script(src="peer-review/edit-review/edit-review.controller.js")
9999
script(src="peer-review/readOnlyScorecard/readOnlyScorecard.controller.js")
100100
script(src="peer-review/review-status/review-status.controller.js")
101101
script(src="peer-review/review-status/review-status.filter.js")
102+
script(src="layout/header/header.controller.js")
102103
//- endinject
103104
104105
// inject:templates.js

app/layout/header/account-header.jade

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
header.account-header
2+
a
3+
img

app/layout/header/header.jade

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
header(ng-controller="HeaderController as vm", ng-class="{slided: main.sidebarActive}")
1+
header.topcoder-header(ng-controller="HeaderController as vm", ng-class="{slided: main.sidebarActive}")
22
.container
33
a(id="topcoder-logo", ng-href="https://www.{{vm.domain}}", title="topcoder")
44
img(src="/images/logo.png", alt="Topcoder Logo")

assets/css/account/login.scss

+37-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,40 @@
1-
.login {
1+
@import '../partials/combined';
2+
3+
.login-container {
4+
text-align: center;
5+
26
h1 {
3-
color: green;
7+
@include source-sans-light;
8+
font-size: 46px;
9+
color: #414042;
10+
}
11+
12+
.login-notice {
13+
@include source-sans;
14+
font-size: 13px;
15+
color: #58595B;
16+
}
17+
18+
.login-error {
19+
@extend .login-notice;
20+
color: red;
21+
}
22+
23+
form {
24+
display: flex;
25+
justify-content: center;
26+
27+
input, button {
28+
flex-direction: column;
29+
display: block;
30+
}
31+
32+
button {
33+
width: 215px;
34+
height: 38px;
35+
background-color: #94D7ED;
36+
color: $white;
37+
text-transform: uppercase;
38+
}
439
}
540
}

assets/css/layout/account-header.scss

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.account-header {
2+
max-width: 1200px;
3+
width: 100%;
4+
height: 54px;
5+
background-color: #414042;
6+
}

assets/css/layout/header.scss

+3-2
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,9 @@
7979
}
8080
}
8181

82-
header {
82+
header.topcoder-header {
8383
height: 94px;
84+
width: 100%;
8485
background-color: $off-white;
8586
box-shadow: 0 2px 3px rgba(0,0,0,.25);
8687
@media only screen and (max-width: 1020px) {
@@ -90,7 +91,7 @@ header {
9091
.container {
9192
position: relative;
9293
height: 94px;
93-
max-width: 1010px;
94+
width: 1010px;
9495
margin: 0 auto;
9596
@media only screen and (max-width: 1020px) {
9697
height: 74px;

assets/css/partials/_colors.scss

+1
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ $dark-orange : #ff8a00;
2424
$light-blue : #00aeff;
2525
$dark-blue : #0096ff;
2626
$review-blue: #0071bc;
27+
$login-blue : #26A9E0;

assets/css/partials/_mixins.scss

+6-2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525
}
2626
}
2727

28+
@mixin login-link {
29+
color: $login-blue;
30+
}
31+
2832
@mixin horizontal-rule {
2933
border: 0;
3034
border-bottom: 1px solid $horizontal-rule;
@@ -60,8 +64,8 @@
6064
@font-face {
6165
font-family: 'Glyphicons Halflings';
6266

63-
src: url('/fonts/glyphicons-halflings-regular.eot');
64-
src: url('/fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('/fonts/glyphicons-halflings-regular.woff2') format('woff2'), url('/fonts/glyphicons-halflings-regular.woff') format('woff'), url('/fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('/fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
67+
src: url('fonts/glyphicons-halflings-regular.eot');
68+
src: url('fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('fonts/glyphicons-halflings-regular.woff2') format('woff2'), url('fonts/glyphicons-halflings-regular.woff') format('woff'), url('fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
6569
}
6670
}
6771

assets/css/topcoder.scss

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
@import 'partials/combined';
22
@include glyphicons-halflings;
33

4+
#header {
5+
display: flex;
6+
justify-content: center;
7+
}
8+
49
.view-container {
510
max-width: 1010px;
611
margin: 25px auto;

0 commit comments

Comments
 (0)