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

Commit a5a07ba

Browse files
author
Parth Shah
committed
Merge branch 'dev' into release/v1.0.8
2 parents f56a450 + faa638b commit a5a07ba

File tree

109 files changed

+3605
-1326
lines changed

Some content is hidden

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

109 files changed

+3605
-1326
lines changed

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/challenge-tile/challenge-tile.directive.jade

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,26 @@
33
.challenge-track
44

55
header
6-
a(ng-href="{{challenge|challengeLinks:'detail'}}") {{challenge.name}}
6+
.top
7+
a.name(ng-href="{{challenge|challengeLinks:'detail'}}") #[span {{challenge.name}}]
8+
9+
p.subtrack-color {{challenge.subTrack | underscoreStrip}}
10+
11+
.challenge-links
12+
.stats
13+
a.registrants(ng-href="{{challenge|challengeLinks:'registrants'}}", ng-switch="challenge.subTrack")
14+
.registrants-icon
15+
16+
p(ng-switch-when="MARATHON_MATCH") {{challenge.numRegistrants[0]}}
17+
p(ng-switch-default) {{challenge.numRegistrants}}
18+
19+
a.submissions(ng-hide="challenge.track === 'DATA_SCIENCE'", ng-href="{{challenge|challengeLinks:'submissions'}}")
20+
.submissions-icon
21+
p {{challenge.numSubmissions}}
722

8-
p.subtrack-color {{challenge.subTrack | underscoreStrip}}
23+
a.forum(ng-href="{{challenge|challengeLinks:'forums'}}")
24+
.forum-icon
25+
p Posts
926

1027
.challenge-details
1128
p.currentPhase {{challenge.userCurrentPhase}}
@@ -18,31 +35,15 @@
1835
.stalled-challenge(ng-hide="challenge.userCurrentPhaseEndTime") This challenge is currently paused.
1936

2037
.phase-action(ng-switch="challenge.userAction")
21-
a.tc-btn.tc-btn-s.tc-btn-wide.submit(ng-switch-when="Submit") Submit
38+
a.tc-btn.tc-btn-s.tc-btn-wide.tc-btn-ghost.submit(ng-switch-when="Submit") Submit
2239

2340
.submitted(ng-switch-when="Submitted") Submitted
2441

2542
// TODO: Need styling and JS logic for this one
2643
.registered(ng-switch-when="Registered") Registered
2744

28-
// Only show if not data science track
29-
p.roles(ng-hide="challenge.track === 'DATA_SCIENCE'") {{challenge.userDetails.roles | listRoles}}
30-
31-
.challenge-links
32-
.stats
33-
a.registrants(ng-href="{{challenge|challengeLinks:'registrants'}}", ng-switch="challenge.subTrack")
34-
.registrants-icon
35-
36-
p(ng-switch-when="MARATHON_MATCH") {{challenge.numRegistrants[0]}}
37-
p(ng-switch-default) {{challenge.numRegistrants}}
38-
39-
a.submissions(ng-hide="challenge.track === 'DATA_SCIENCE'", ng-href="{{challenge|challengeLinks:'submissions'}}")
40-
.submissions-icon
41-
p {{challenge.numSubmissions}}
42-
43-
a.forum(ng-href="{{challenge|challengeLinks:'forums'}}")
44-
.forum-icon
45-
p Forum
45+
// Only show if not data science track
46+
p.roles(ng-hide="challenge.track === 'DATA_SCIENCE'") #[span Role:  ] #[span {{challenge.userDetails.roles | listRoles}}]
4647

4748
.completed-challenge(
4849
ng-show="challenge.status === 'COMPLETED' || challenge.status === 'PAST'",
@@ -109,7 +110,7 @@
109110

110111
a.forum(ng-href="{{challenge|challengeLinks:'forums'}}")
111112
.forum-icon
112-
p Forum
113+
p Posts
113114

114115
.completed-challenge(
115116
ng-show="challenge.status === 'COMPLETED' || challenge.status === 'PAST'",

app/directives/ios-card/ios-card.directive.jade

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,27 @@
22
.challenge-track
33

44
header
5-
a(ng-href="https://www.{{DOMAIN}}/challenge-details/{{challenge.id}}/?type={{challenge.track}}") {{challenge.name}}
5+
.top
6+
a.name(ng-href="https://www.{{DOMAIN}}/challenge-details/{{challenge.id}}/?type={{challenge.track}}") #[span {{challenge.name}}]
67

7-
p {{challenge.subTrack | underscoreStrip}}
8+
p.subtrack-color {{challenge.subTrack | underscoreStrip}}
9+
10+
.challenge-links
11+
.stats
12+
a.registrants(ng-href="https://www.{{DOMAIN}}/challenge-details/{{challenge.id}}/?type={{challenge.track}}#viewRegistrant")
13+
.registrants-icon
14+
15+
p {{challenge.numRegistrants}}
16+
17+
a.submissions(ng-href="https://www.{{DOMAIN}}/challenge-details/{{challenge.id}}/?type={{challenge.track}}#viewRegistrant")
18+
.submissions-icon
19+
20+
p {{challenge.numSubmissions}}
21+
22+
a.forum(ng-href="http://apps.{{DOMAIN}}/forums//?module=Category&categoryID={{challenge.forumId}}")
23+
.forum-icon
24+
25+
p Posts
826

927
.challenge-details
1028

@@ -24,20 +42,3 @@
2442
p.technologies {{challenge.technologies}}
2543

2644
//button.phase-action(ng-class="{'action-completed': challenge.currentPhaseActionCompleted}") Submit
27-
28-
.challenge-links
29-
.stats
30-
a.registrants(ng-href="https://www.{{DOMAIN}}/challenge-details/{{challenge.id}}/?type={{challenge.track}}#viewRegistrant")
31-
.registrants-icon
32-
33-
p {{challenge.numRegistrants}}
34-
35-
a.submissions(ng-href="https://www.{{DOMAIN}}/challenge-details/{{challenge.id}}/?type={{challenge.track}}#viewRegistrant")
36-
.submissions-icon
37-
38-
p {{challenge.numSubmissions}}
39-
40-
a.forum(ng-href="http://apps.{{DOMAIN}}/forums//?module=Category&categoryID={{challenge.forumId}}")
41-
.forum-icon
42-
43-
p Posts

app/directives/profile-widget/profile-widget.jade

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,26 @@
66
.info
77
h1.handle(style="color:{{handleColor}};") {{profile.handle}}
88

9-
h3.tenure(ng-if="profile.startMonth")
10-
| Member Since {{profile.startMonth}}
11-
129
h3.location-challenges {{profile.homeCountryCode | isoCountry}}
1310
span.bar(ng-show="profile.homeCountryCode && numWins")  | 
1411
span(ng-show="numWins") {{numWins}} Wins
1512

16-
p.description {{profile.description}}
13+
h3.tenure(ng-if="profile.startMonth")
14+
| Member Since {{profile.startMonth}}
1715

18-
a.tc-btn.tc-btn-s.edit(ng-show="editProfileLink", ui-sref="settings.profile") Edit Profile
16+
a.tc-btn.tc-btn-m.edit(ng-show="editProfileLink", ui-sref="settings.profile") Edit Profile
1917

2018
.tracks-links
2119
.tracks
2220
.track(ng-repeat="track in (profile.tracks)", ng-click="profileVm.scrollTo(track)")
23-
div(class="{{profileVm.imgMap[track]}}-icon")
21+
div(class="track-icon {{profileVm.imgMap[track]}}-icon")
2422
div
2523
.text {{track | role}}
2624

27-
hr
25+
p.description {{profile.description}}
2826

29-
.links
30-
a.tc-btn.tc-btn-s.forums.link(ng-href="http://forums.{{DOMAIN}}/?module=History&userID={{profileVm.profile.userId}}")
31-
| Forum Posts
32-
button.tc-btn.tc-btn-s.badges.link(ng-click="profileVm.showBadges()", ng-show="profileVm.profile.badges.Achievements.length > 0")
33-
| Badges
27+
.links
28+
a.badges.link(ng-click="profileVm.showBadges()", ng-show="profileVm.profile.badges.Achievements.length > 0")
29+
| Badges
30+
a.forums.link(ng-href="http://forums.{{DOMAIN}}/?module=History&userID={{profileVm.profile.userId}}")
31+
| Forum Posts

app/directives/responsive-carousel/responsive-carousel.directive.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
activate();
1818

1919
function activate() {
20+
21+
$scope.$watchCollection('data', function(newValue, oldValue) {
22+
init();
23+
});
2024
init();
2125

2226
var window = angular.element($window);
@@ -72,8 +76,8 @@
7276
$scope.slideCounts[slidesCollection.length - 1] = slide.length;
7377
$scope.slidesCollection = slidesCollection;
7478
}
75-
79+
7680
}]
7781
};
7882
});
79-
})();
83+
})();

app/filters/rating-color.filter.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
function ratingColor() {
77
return function(rating) {
88
function ratingToColor(colors, rating) {
9+
// in case rating is a number formatted string
10+
if (typeof rating === 'string')
11+
rating = parseInt(rating.replace(",", ""));
912
colors = colors.filter(function(color) {
1013
return rating >= color.start && rating <= color.end;
1114
});

app/index.jade

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ html
259259
script(src="services/tags.service.js")
260260
script(src="services/tcAuth.service.js")
261261
script(src="services/user.service.js")
262+
script(src="services/userStats.service.js")
262263
script(src="settings/settings.module.js")
263264
script(src="settings/account-info/account-info.controller.js")
264265
script(src="settings/edit-profile/edit-profile.controller.js")

app/my-dashboard/community-updates/community-updates.jade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ header
1111
.description(ng-bind-html="blog.description")
1212

1313
.blog-links(ng-hide="vm.loading")
14-
a.tc-btn(ng-href="https://www.{{DOMAIN}}/blog/") View More
14+
a(ng-href="https://www.{{DOMAIN}}/blog/") View More

app/my-dashboard/header-dashboard/header-dashboard.controller.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,15 @@
88
'NotificationService',
99
'ProfileService',
1010
'userIdentity',
11-
'$log'
11+
'profile',
12+
'$log',
13+
'$filter'
1214
];
1315

14-
function HeaderDashboardController($stateParams, NotificationService, ProfileService, userIdentity, $log) {
16+
function HeaderDashboardController($stateParams, NotificationService, ProfileService, userIdentity, profile, $log, $filter) {
1517
var vm = this;
16-
18+
vm.profile = profile;
19+
vm.handleColor = $filter('ratingColor')(_.get(profile, 'maxRating.rating', 0));
1720

1821
activate();
1922

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
header
2-
h1 My Dashboard
3-
4-
.user-stats(id="metrics", ng-hide="vm.loading")
5-
.money-earned(ng-hide="vm.hideMoney")
6-
p.number(ng-bind="vm.moneyEarned | currency:'$':0")
7-
8-
p Earned
2+
.info
3+
.pic
4+
a(ui-sref="profile.about({userHandle: vm.profile.handle})")
5+
img.profile-circle(ng-if="vm.profile.photoURL", ng-src="{{vm.profile.photoURL}}")
6+
img.profile-circle(ng-if="!vm.profile.photoURL", src="/images/ico-user-default.svg")
7+
.user-stats(id="metrics", ng-hide="vm.loading")
8+
.handle(style="color:{{vm.handleColor}};") {{vm.profile.handle}}
9+
.money-earned(ng-hide="vm.hideMoney")
10+
p.number(ng-bind="vm.moneyEarned | currency:'$':0")
11+
p Earned
12+
h1 Dashboard
913

app/my-dashboard/header-dashboard/header-dashboard.spec.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ describe('Header Dashboard Controller', function() {
8282
NotificationService : notificationService,
8383
UserService : userService,
8484
ProfileService: profileService,
85-
userIdentity: identity
85+
userIdentity: identity,
86+
profile: profile
8687
});
8788
$rootScope.$apply();
8889
});
@@ -115,7 +116,8 @@ describe('Header Dashboard Controller', function() {
115116
NotificationService : notificationService,
116117
UserService : userService,
117118
ProfileService: profileService,
118-
userIdentity: identity
119+
userIdentity: identity,
120+
profile: profile
119121
});
120122
$rootScope.$apply();
121123
});
@@ -145,7 +147,8 @@ describe('Header Dashboard Controller', function() {
145147
NotificationService : notificationService,
146148
UserService : userService,
147149
ProfileService: profileService,
148-
userIdentity: identity
150+
userIdentity: identity,
151+
profile: profile
149152
});
150153
$rootScope.$apply();
151154
});

app/my-dashboard/my-challenges/my-challenges.jade

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
header(ng-hide="vm.loading")
2-
h1.section-title My Challenges
2+
h1.section-title Active Challenges
33

44
.challenge-view-toggle(ng-show="vm.userHasChallenges")
55
button.tile(ng-click="vm.toggleView('tile')", ng-class="{ disabled: vm.challengeView === 'tile' }") Grid
@@ -46,6 +46,6 @@ section.hasChallenges(ng-if="vm.userHasChallenges && !vm.loading", ng-class="{ '
4646
challenge-tile(ng-repeat="challenge in vm.myChallenges | orderBy:registrationEndDate:true", challenge="challenge", view="vm.challengeView", ng-class="vm.challengeView + '-view'")
4747

4848
.my-challenges-links(id="viewAllChallenges", ng-show="vm.userHasChallenges && !vm.loading")
49-
a.tc-btn.tc-btn-s(ui-sref="my-challenges({status: 'active'})") View All Active Challenges
49+
a.active(ui-sref="my-challenges({status: 'active'})") View More
5050

51-
a.tc-btn.tc-btn-s(ui-sref="my-challenges({status: 'completed'})") View All Past Challenges
51+
a.past(ui-sref="my-challenges({status: 'completed'})") Past Challenges

app/my-dashboard/my-dashboard.routes.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@
3232
url: '/my-dashboard/',
3333
params: { 'notifyReset': false },
3434
parent: 'baseDashboard',
35+
resolve: {
36+
profile: ['userIdentity', 'ProfileService', function(userIdentity, ProfileService) {
37+
return ProfileService.getUserProfile(userIdentity.handle);
38+
}]
39+
},
3540
views: {
3641
'header-dashboard' : {
3742
templateUrl: 'my-dashboard/header-dashboard/header-dashboard.html',

app/my-dashboard/srms/srms.jade

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
header
2-
h1.section-title Competitive Programming
2+
h1.section-title Single Round Matches
33

44

55
.section-loading(ng-show="vm.loading")
@@ -19,6 +19,6 @@ section(ng-hide="vm.loading")
1919
a.tc-btn.tc-btn-s.tc-btn-wide.tc-btn-ghost(ng-href="https://www.{{DOMAIN}}/community/getting-started/") Learn More
2020

2121
.srms-links(ng-hide="vm.loading")
22-
a.tc-btn.tc-btn-s(ui-sref="my-srms") View Past SRMs
22+
a(ui-sref="my-srms") View Past SRMs
2323

24-
a.tc-btn.tc-btn-s(ng-href="https://arena.{{DOMAIN}}") Launch Arena
24+
a(ng-href="https://arena.{{DOMAIN}}") Launch Arena

app/my-dashboard/subtrack-stats/subtrack-stats.jade

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
.tracks
66
.track(ng-repeat="subtrack in vm.subtrackRanks", ui-sref="profile.subtrack({userHandle: vm.handle, track: subtrack.track, subTrack: subtrack.subTrack})")
77
.flex-wrapper
8-
p.subtrack {{subtrack.subTrack | underscoreStrip}}
8+
p.subtrack(title="{{subtrack.subTrack | underscoreStrip}}") {{subtrack.subTrack | underscoreStrip}}
99

1010
p.rating(ng-if="subtrack.track !== 'DESIGN'", style="color: {{subtrack.stat | ratingColor}}") {{subtrack.stat | number}}
1111
span(style="background-color: {{subtrack.stat | ratingColor}}", ng-if="subtrack.track === 'DEVELOP' || subtrack.track === 'DATA_SCIENCE'")
@@ -17,7 +17,7 @@
1717
responsive-carousel(data="vm.subtrackRanks", handle="{{vm.handle}}")
1818
.track(ui-sref="profile.subtrack({userHandle: handle, track: item.track, subTrack: item.subTrack})")
1919
.flex-wrapper
20-
p.subtrack {{item.subTrack | underscoreStrip}}
20+
p.subtrack(title="{{item.subTrack | underscoreStrip}}") {{item.subTrack | underscoreStrip}}
2121

2222
p.rating(ng-if="item.track !== 'DESIGN'", style="color: {{item.stat | ratingColor}}") {{item.stat | number}}
2323
span(style="background-color: {{item.stat | ratingColor}}", ng-if="item.track === 'DEVELOP' || item.track === 'DATA_SCIENCE'")

app/profile/about/about.controller.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
profileVm.skillsPromise.then(function() {
6868
// show section if user is viewing his/her own profile OR if we have data
6969
vm.fullSkills = profileVm.skills;
70-
vm.someSkills = profileVm.skills.slice(0, 6);
70+
vm.someSkills = profileVm.skills.slice(0, 10);
7171
vm.skills = vm.someSkills;
7272
vm.displaySection.skills = profileVm.showEditProfileLink || !!vm.skills.length;
7373
});

0 commit comments

Comments
 (0)