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

Commit dbaaab5

Browse files
author
Parth Shah
committed
Merge branch 'dev' into feature/sup-1611-web-link-support-ui
Conflicts: app/directives/external-account/external-account.directive.js app/services/user.service.js
2 parents 4e4fa38 + 9ca2aab commit dbaaab5

File tree

331 files changed

+24181
-4277
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

331 files changed

+24181
-4277
lines changed

.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v1.0.2
1+
v1.0.7

app/account/login/login.jade

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
.login-container
22
header
3-
a.logo-link(href="/")
3+
a.logo-link(href="/", title="Back to the home page")
44
img(src="/images/logo_mobile.svg", alt="Topcoder Logo")
5-
.arrow
5+
66
h1 LOG IN TO TOPCODER
77

88
form(name="vm.loginForm", role="form", ng-submit="vm.loginForm.$valid && vm.login()", novalidate)
@@ -21,27 +21,25 @@
2121
p.problem-signin
2222
a.forgot-password(ui-sref="resetPassword") Forgot your password?
2323

24-
button(type="submit", ng-disabled="vm.loginForm.$invalid", ng-class="{'enabled-button': vm.loginForm.$valid}") Log In
25-
26-
section.social
27-
p ------------ Or Log in With ------------
28-
29-
.social-icons
30-
.github
31-
.ico(ng-click="vm.socialLogin('github')")
32-
p Github
33-
.google-plus
34-
.ico(ng-click="vm.socialLogin('google-oauth2')")
35-
p Google
36-
.facebook
37-
.ico(ng-click="vm.socialLogin('facebook')")
38-
p Facebook
39-
.twitter
40-
.ico(ng-click="vm.socialLogin('twitter')")
41-
p Twitter
42-
43-
.join-topcoder
44-
span Not a member yet?
45-
p.redirect
46-
a(ui-sref="register(vm.$stateParams)") Join now
47-
24+
button.tc-btn.tc-btn-wide(type="submit", ng-disabled="vm.loginForm.$invalid") Log In
25+
26+
section.login-options
27+
p.tc-separator
28+
span Or Log in With
29+
30+
ul.networks
31+
li.network.github
32+
a.ico(ng-click="vm.socialLogin('github')")
33+
span Github
34+
li.network.google-plus
35+
a.ico(ng-click="vm.socialLogin('google-oauth2')")
36+
span Google
37+
li.network.facebook
38+
a.ico(ng-click="vm.socialLogin('facebook')")
39+
span Facebook
40+
li.network.twitter
41+
a.ico(ng-click="vm.socialLogin('twitter')")
42+
span Twitter
43+
44+
p.join-topcoder Not a member yet?  
45+
a(ui-sref="register(vm.$stateParams)") Join now

app/account/login/login.spec.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ describe('Login Controller', function() {
88
});
99

1010
beforeEach(function() {
11-
controller = $controller('LoginController');
11+
$scope = $rootScope.$new();
12+
controller = $controller('LoginController', {
13+
$scope : $scope
14+
});
1215
$rootScope.$apply();
1316
});
1417

app/account/register/register.controller.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,10 @@
3535
var countryCode = _.get(angucompleteCountryObj, 'originalObject.code', undefined);
3636

3737
var isValidCountry = _.isUndefined(countryCode) ? false : true;
38-
vm.country = countryCode;
3938
vm.registerForm.country.$setValidity('required', isValidCountry);
39+
if (isValidCountry) {
40+
vm.country = angucompleteCountryObj.originalObject;
41+
}
4042
};
4143

4244
vm.register = function() {
@@ -47,7 +49,9 @@
4749
lastName: vm.lastname,
4850
email: vm.email,
4951
country: {
50-
code: vm.country
52+
code: Helpers.npad(vm.country.code, 3),
53+
isoAlpha3Code: vm.country.alpha3,
54+
isoAlpha2Code: vm.country.alpha2
5155
},
5256
utmSource: utm.source,
5357
utmMedium: utm.medium,

app/account/register/register.jade

Lines changed: 43 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
a.logo-link(href="/")
44
img(src="/images/logo_mobile.svg", alt="Topcoder Logo")
55
.arrow
6-
h1 Join the Topcoder technology community to earn, learn, and connect
6+
//- h1 Join the Topcoder technology community to earn, learn, and connect
7+
h1 Join Topcoder
78

89
form(name="vm.registerForm", role="form", ng-submit="vm.registerForm.$valid && vm.register()", novalidate, autocomplete="off")
910

@@ -34,8 +35,11 @@
3435
minlength="1"
3536
)
3637

37-
.form-errors
38-
p.form-error(ng-show="vm.registerForm.country.$error.required") Please choose a country from the list.
38+
.form-input-error(ng-show="vm.registerForm.country.$dirty && vm.registerForm.country.$invalid", ng-messages="vm.registerForm.country.$error")
39+
p.form-error(ng-message="required") Please choose a country from the list
40+
41+
.section-break
42+
hr
3943

4044
.validation-bar(ng-class="{ 'error-bar': (vm.registerForm.username.$error.usernameIsFree || vm.registerForm.username.$error.minlength || vm.registerForm.username.$error.maxlength), 'success-bar': (vm.registerForm.username.$valid && !vm.registerForm.username.$error.usernameIsFree) }")
4145
input-sticky-placeholder(sticky-placeholder="Username", ng-model="vm.username")
@@ -50,13 +54,16 @@
5054

5155
p It can contain letters, numbers, and these characters: -_.{}[]
5256

53-
.form-errors
54-
p.form-error(ng-show="vm.registerForm.username.$dirty && vm.registerForm.username.$error.usernameIsFree", ng-bind="vm.usernameErrorMessage")
57+
.form-input-error(ng-if="vm.registerForm.username.$dirty && vm.registerForm.username.$invalid", ng-messages="vm.registerForm.username.$error")
58+
p.form-error(ng-message="required") Please enter a username.
59+
p.form-error(ng-message="usernameIsFree") {{vm.usernameErrorMessage}}
60+
61+
p.form-error(ng-message="minlength") That username is not the correct length or format.
5562

56-
p.form-error(ng-show="vm.registerForm.username.$dirty && (vm.registerForm.username.$error.minlength || vm.registerForm.username.$error.maxlength)") That username is not the correct length or format.
63+
p.form-error(ng-message="maxlength") That username is not the correct length or format.
5764

5865
.validation-bar(ng-class="{ 'error-bar': (vm.registerForm.email.$dirty && vm.registerForm.email.$invalid), 'success-bar': (vm.registerForm.email.$valid) }")
59-
input-sticky-placeholder(sticky-placeholder="Email", ng-model="vm.email")
66+
input-sticky-placeholder.email(sticky-placeholder="Email", ng-model="vm.email")
6067
input(ng-model="vm.email", ng-model-options="{ debounce: {'default': 500} }", ng-focus="vm.emailTips = true", ng-blur="vm.emailTips = false", name="email", placeholder="Enter Your Email", type="email", valid-email, email-is-available, required)
6168

6269
.tips.email-tips(ng-show="vm.emailTips")
@@ -66,10 +73,12 @@
6673

6774
p We'll occasionally send you emails related to your activities or interests.
6875

69-
.form-errors
70-
p.form-error(ng-show="vm.registerForm.email.$dirty && (vm.registerForm.email.$error.emailIsAvailable || vm.registerForm.email.$error.validEmail)", ng-bind="vm.emailErrorMessage")
76+
.form-input-error(ng-show="vm.registerForm.email.$dirty && vm.registerForm.email.$invalid", ng-messages="vm.registerForm.email.$error")
77+
p.form-error(ng-message="emailIsAvailable") {{vm.emailErrorMessage}}
7178

72-
p.form-error(ng-show="vm.registerForm.email.$dirty && vm.registerForm.email.$error.required") Please enter an email address.
79+
p.form-error(ng-message="validEmail") {{vm.emailErrorMessage}}
80+
81+
p.form-error(ng-message="required") Please enter an email address.
7382

7483
.validation-bar(ng-class="{ 'success-bar': (vm.registerForm.password.$valid) }")
7584
toggle-password-with-tips(ng-if="!vm.isSocialRegistration")
@@ -85,26 +94,27 @@
8594

8695
p(ng-class="{ 'has-symbol-or-number': (vm.registerForm.password.$dirty && !vm.registerForm.password.$error.hasSymbolOrNumber) }") At least one number or symbol
8796

88-
button(type="submit", tc-busy-button, tc-busy-when="vm.registering", ng-disabled="vm.registerForm.$invalid", ng-class="{'enabled-button': vm.registerForm.$valid}") Join
89-
90-
section.terms
91-
p By clicking "Join," you agree to Topcoder's #[a(href="http://www.topcoder.com/community/how-it-works/terms/", target="_blank") Terms of Service] and #[a(href="http://www.topcoder.com/community/how-it-works/privacy-policy/", target="_blank") Privacy Policy]
92-
93-
section.social
94-
p ------------ Or Register With ------------
95-
96-
.social-icons
97-
.github
98-
.ico(ng-click="vm.socialRegister('github')")
99-
p Github
100-
.google-plus
101-
.ico(ng-click="vm.socialRegister('google-oauth2')")
102-
p Google
103-
.facebook
104-
.ico(ng-click="vm.socialRegister('facebook')")
105-
p Facebook
106-
107-
.join-topcoder
108-
span Already a member?
109-
p.redirect
110-
a(ui-sref="login(vm.$stateParams)") Log in
97+
section.terms
98+
p By clicking "Join" you agree to Topcoder's #[a(href="http://www.topcoder.com/community/how-it-works/terms/", target="_blank") Terms] and #[a(href="http://www.topcoder.com/community/how-it-works/privacy-policy/", target="_blank") Privacy Policy]
99+
100+
button.tc-btn.tc-btn-large(type="submit", tc-busy-button, tc-busy-when="vm.registering", ng-disabled="vm.registerForm.$invalid") Join
101+
102+
section.login-options
103+
p.tc-separator
104+
span Or Register With
105+
106+
ul.networks
107+
li.network.github
108+
a.ico(ng-click="vm.socialRegister('github')")
109+
span Github
110+
li.network.google-plus
111+
a.ico(ng-click="vm.socialRegister('google-oauth2')")
112+
span Google
113+
li.network.facebook
114+
a.ico(ng-click="vm.socialRegister('facebook')")
115+
span Facebook
116+
117+
.join-topcoder
118+
span Have an account?  
119+
120+
a(ui-sref="login(vm.$stateParams)") Log in

app/account/reset-password/reset-password.jade

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
p.form-error(ng-show="vm.unkownError") We were unable to send you a reset link because of a temporary problem. Please try again. If you continue to have trouble, please contact
2929
a(href="mailto:[email protected]?Subject=Unable%20to%20reset%20my%20password" target="_top") [email protected]
3030

31-
button(type="submit", ng-disabled='vm.generateTokenForm.email.$invalid || vm.loading', ng-class="{'enabled-button': vm.generateTokenForm.$valid && !vm.loading}") Get Reset Link
31+
button.tc-btn(type="submit", ng-disabled='vm.generateTokenForm.email.$invalid || vm.loading', ng-class="{'enabled-button': vm.generateTokenForm.$valid && !vm.loading}") Get Reset Link
3232

3333
a.link(ui-sref="login") Back to Login
3434

@@ -61,6 +61,6 @@
6161
p.form-error(ng-show="vm.resetFailed") We were unable to reset your password. Please request another reset link. If you continue to have trouble, please contact
6262
a(href="mailto:[email protected]?Subject=Unable%20to%20reset%20my%20password" target="_top") [email protected]
6363

64-
button(type="submit", ng-disabled='vm.resetPasswordForm.password.$invalid || vm.loading', ng-class="{'enabled-button': vm.resetPasswordForm.$valid && !vm.loading}") Set Password
64+
button.tc-btn(type="submit", ng-disabled='vm.resetPasswordForm.password.$invalid || vm.loading', ng-class="{'enabled-button': vm.resetPasswordForm.$valid && !vm.loading}") Set Password
6565

6666
a.link(ui-sref="login") Back to Login

app/directives/account/toggle-password-with-tips/toggle-password-with-tips.directive.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,12 @@
2929
vm.onFocus = function(event) {
3030
vm.passwordFocus = true;
3131
vm.placeholder = '';
32+
element.addClass('focus');
3233
}
3334

3435
vm.onBlur = function(event) {
3536
var relatedTarget = angular.element(event.relatedTarget);
37+
element.removeClass('focus');
3638

3739
// If you are blurring from the password input and clicking the checkbox
3840
if (relatedTarget.attr('type') === 'checkbox' && relatedTarget.attr('id') === 'passwordCheckbox') {

app/directives/account/toggle-password/toggle-password.directive.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,12 @@
2929
vm.onCPFocus = function(event) {
3030
vm.currentPasswordFocus = true;
3131
vm.currentPasswordPlaceholder = '';
32+
element.addClass('focus');
3233
}
3334

3435
vm.onCPBlur = function(event) {
3536
var relatedTarget = angular.element(event.relatedTarget);
37+
element.removeClass('focus');
3638

3739
// If you are blurring from the password input and clicking the checkbox
3840
if (relatedTarget.attr('type') === 'checkbox' && relatedTarget.attr('id') === 'currentPasswordCheckbox') {
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.challenge-links(ng-class="view + '-view'")
2+
a.registrants(ng-href="{{challenge|challengeLinks:'registrants'}}", ng-switch="challenge.subTrack")
3+
4+
.icon.registrants-icon
5+
p(ng-switch-when="MARATHON_MATCH") {{challenge.numRegistrants[0]}}
6+
p(ng-switch-default) {{challenge.numRegistrants}}
7+
8+
a.submissions(ng-hide="challenge.track === 'DATA_SCIENCE'", ng-href="")
9+
.icon.submissions-icon
10+
p {{challenge.numSubmissions}}
11+
12+
a.forum(ng-href="{{challenge|challengeLinks:'forums'}}")
13+
.icon.forum-icon
14+
p Posts
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
(function() {
2+
'use strict';
3+
angular.module('tcUIComponents').directive('challengeLinks', function() {
4+
return {
5+
restrict: 'E',
6+
transclude: false,
7+
replace: true,
8+
templateUrl: 'directives/challenge-links/challenge-links.directive.html',
9+
scope: {
10+
challenge: '=',
11+
view: '='
12+
},
13+
controller: ['$log', '$scope', '$element', '$window',
14+
function($log, $scope, $element, $window) {
15+
16+
activate();
17+
18+
function activate() {
19+
//nothing to do as of now
20+
}
21+
}]
22+
};
23+
});
24+
})();

0 commit comments

Comments
 (0)