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

Commit 0364119

Browse files
committed
Merge branch 'dev' of https://github.com/appirio-tech/topcoder-app into sup-1349-new-nav
2 parents b27498b + b83bb7c commit 0364119

Some content is hidden

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

43 files changed

+1287
-381
lines changed

.version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v1.0.0

app/directives/challenge-tile/challenge-tile.directive.jade

Lines changed: 35 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// TILE VIEW
21
.challenge.tile-view(ng-show="view === 'tile'", ng-class="challenge.track")
32
.challenge-track
43

@@ -11,7 +10,7 @@
1110
p.currentPhase {{challenge.userCurrentPhase}}
1211

1312
.challenge-calendar(ng-show="challenge.userCurrentPhaseEndTime")
14-
p.starts-in Ends In
13+
p.ends-in Ends In
1514
p.time-remaining {{challenge.userCurrentPhaseEndTime[0]}}
1615
p.unit-of-time {{challenge.userCurrentPhaseEndTime[1]}}
1716

@@ -45,36 +44,46 @@
4544

4645
p Forum
4746

48-
// LIST VIEW
49-
.challenge.list-view(ng-show="view=='list'")
50-
.challenge-icons
51-
img(ng-show="challenge.track === 'DEVELOP'", src="/images/member-program/svg/development-generic.svg")
52-
img(ng-show="challenge.track === 'DESIGN' || challenge.track === 'Data Science'", src="/images/member-program/svg/design-generic.svg")
47+
.challenge.list-view(ng-show="view=='list'", ng-class="challenge.track")
48+
.challenge-track
5349

54-
.challenge-name
50+
header
5551
a(ng-href="https://www.{{DOMAIN}}/challenge-details/{{challenge.id}}/?type={{challenge.track}}") {{challenge.name}}
56-
.phase-status(ng-show="challenge.status === 'Active'")
57-
i.fa.fa-check-circle-o
5852

59-
p {{challenge.memberStatusMsg}}
53+
p.subtrack {{challenge.subTrack | underscoreStrip}}
6054

61-
.roles
62-
p Roles : {{challenge.userDetails.roles | listRoles}}
55+
// Only show if not data science track
56+
p.roles(ng-hide="challenge.track === 'DATA SCIENCE'") #[span Role:] {{challenge.userDetails.roles | listRoles}}
57+
58+
.challenge-details
59+
.challenge-info
60+
p.currentPhase {{challenge.userCurrentPhase}}
6361

64-
p.days-remaining(ng-show="challenge.status === 'Active'") {{challenge.registrationEndDate | timeDiff}}
65-
span Registration Ends
66-
p.completion-date(ng-show="challenge.status === 'Completed'")
67-
span Ended {{challenge.submissionEndDate | date: "mediumDate"}}
62+
p.ends-in(ng-show="challenge.userCurrentPhaseEndTime") Ends: {{challenge.userCurrentPhaseEndTime[2] | localTime}}
63+
64+
p.ends-in(ng-hide="challenge.userCurrentPhaseEndTime") This challenge is currently paused.
65+
66+
.phase-action(ng-switch="challenge.userAction")
67+
.submit(ng-switch-when="Submit") Submit
6868

69-
.stats
70-
.registrants(ng-show="challenge.numRegistrants > 0")
71-
i.fa.fa-user
72-
a(ng-href="https://www.{{DOMAIN}}/challenge-details/{{challenge.id}}/?type={{challenge.track}}#viewRegistrant") {{challenge.numRegistrants}}
73-
.submissions(ng-show="challenge.numSubmissions > 0")
74-
i.fa.fa-files-o
75-
a(ng-href="https://www.{{DOMAIN}}/challenge-details/{{challenge.id}}/?type={{challenge.track}}#viewRegistrant") {{challenge.numSubmissions}}
69+
.submitted(ng-switch-when="Submitted") Submitted
7670

71+
// Need styling and JS logic for this one
72+
.registered(ng-switch-when="Registered") Registered
7773

7874
.challenge-links
79-
a(ng-href="http://apps.{{DOMAIN}}/forums//?module=Category&categoryID={{challenge.forumId}}")
80-
i.fa.fa-comment
75+
a.registrants(ng-href="https://www.{{DOMAIN}}/challenge-details/{{challenge.id}}/?type={{challenge.track}}#viewRegistrant")
76+
p {{challenge.numRegistrants}}
77+
78+
.registrants-icon
79+
80+
a.submissions(ng-hide="challenge.track === 'DATA SCIENCE'", ng-href="https://www.{{DOMAIN}}/challenge-details/{{challenge.id}}/?type={{challenge.track}}#viewRegistrant")
81+
p {{challenge.numSubmissions}}
82+
83+
.submissions-icon
84+
85+
a.forum(ng-href="http://apps.{{DOMAIN}}/forums//?module=Category&categoryID={{challenge.forumId}}")
86+
.forum-icon
87+
88+
p Forum
89+

app/directives/distribution-graph/distribution-graph.directive.jade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010
.label RATING
1111

1212
button.compare(ng-click="graphState.show = 'history'")
13-
| COMPARE
13+
| BACK TO YOUR RATING

app/directives/history-graph/history-graph.directive.jade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
.history-info(ng-if="historyRating")
99
| Attained on {{historyDate}} in challenge "{{historyChallenge}}"
1010
.lower
11-
button.compare(ng-click="graphState.show = 'distribution'") COMPARE
11+
button.compare(ng-click="graphState.show = 'distribution'") COMMUNITY RATINGS

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
| Member Since {{profile.startMonth}}
1010

1111
h3.location-challenges {{profile.homeCountryCode | isoCountry}}
12-
span.bar(ng-show="profile.homeCountryCode && numChallenges") |
12+
span.bar(ng-show="profile.homeCountryCode && numChallenges")  | 
1313
span(ng-show="numChallenges") {{numChallenges}} Challenges
1414

1515
p.description {{profile.quote}}
@@ -21,7 +21,7 @@
2121
.track(ng-repeat="track in (profile.tracks)")
2222
div(class="{{profileVm.imgMap[track]}}-icon")
2323
div
24-
.text {{track | track}}
24+
.text {{track | role}}
2525

2626
hr
2727

app/filters/filters.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ describe('filters', function() {
1919
describe('track filter', function() {
2020
it('should handle strings', function() {
2121
expect(trackFilter('DATA_SCIENCE')).to.equal('Data Science');
22-
expect(trackFilter('DEVELOP')).to.equal('Develop');
22+
expect(trackFilter('DEVELOP')).to.equal('DEVELOPMENT');
2323
expect(trackFilter('FIRST_2_FINISH')).to.equal('First2Finish');
2424
});
2525

2626
it('should handle arrays', function() {
27-
expect(trackFilter(['DATA_SCIENCE', 'DEVELOP'])).to.include('Develop');
27+
expect(trackFilter(['DATA_SCIENCE', 'DEVELOP'])).to.include('DEVELOPMENT');
2828
});
2929
});
3030

app/filters/local-time.filter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
function localTime() {
77
var timezone = jstz.determine().name();
88
return function(input) {
9-
return moment(input).tz(timezone).format('MM/DD/YY hh:mm A z');
9+
return moment(input).tz(timezone).format('MM/DD/YY hh:mm a z');
1010
};
1111
};
1212

app/filters/role.filter.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
var map = {
88
'DESIGN' : 'Designer',
99
'DEVELOP': 'Developer',
10-
'DATA_SCIENCE': 'Data Scientist'
10+
'DATA_SCIENCE': 'Data Scientist',
11+
'COPILOT': 'Copilot'
1112
};
1213
return function(tracks) {
1314
if (tracks) {

app/filters/track.filter.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
'WIDGET_OR_MOBILE_SCREEN_DESIGN': 'Widget or Mobile Screen Design',
1919
'FRONT_END_FLASH': 'Front-End Flash',
2020
'APPLICATION_FRONT_END_DESIGN': 'Application Front-End Design',
21-
'DESIGN_FIRST_2_FINISH': 'Design First2Finish'
21+
'DESIGN_FIRST_2_FINISH': 'Design First2Finish',
22+
'DEVELOP': 'DEVELOPMENT'
2223
};
2324

2425
function capitalized(str) {

app/index.jade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ html
9696
script(src='../bower_components/angucomplete-alt/angucomplete-alt.js')
9797
script(src='../bower_components/angular-cookies/angular-cookies.js')
9898
script(src='../bower_components/angular-dropdowns/dist/angular-dropdowns.js')
99-
script(src='../bower_components/angular-filter/dist/angular-filter.js')
99+
script(src='../bower_components/angular-filter/dist/angular-filter.min.js')
100100
script(src='../bower_components/angular-img-fallback/angular.dcb-img-fallback.js')
101101
script(src='../bower_components/intro.js/intro.js')
102102
script(src='../bower_components/angular-intro.js/src/angular-intro.js')

app/my-challenges/my-challenges.jade

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010

1111
p.viewOptions
1212
a(ng-click="vm.changeView('list')", ng-class="{disabled: vm.view == 'list'}") List
13+
1314
span   |  
15+
1416
a(ng-click="vm.changeView('tile')", ng-class="{disabled: vm.view == 'tile'}") Tile
1517

1618
p.filters
@@ -22,6 +24,7 @@
2224

2325
section.challenges(ng-show="vm.userHasChallenges && !vm.loading")
2426
tc-paginator(data="vm.myChallenges", page-params="vm.pageParams")
27+
2528
.data(ng-class="vm.view + '-view'")
2629
challenge-tile(ng-repeat="challenge in vm.myChallenges | orderBy:registrationEndDate:true", challenge="challenge", view="vm.view", ng-class="vm.view + '-view'")
2730

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
vm.domain = CONSTANTS.domain;
1111
vm.loading = true;
1212
vm.userHasChallenges = true;
13+
vm.challengeView = 'tile';
14+
vm.toggleView = toggleView;
1315

1416
var handle = userIdentity.handle;
1517

@@ -65,5 +67,11 @@
6567
vm.loading = false;
6668
});
6769
}
70+
71+
function toggleView(view) {
72+
if (vm.challengeView !== view) {
73+
vm.challengeView = view;
74+
}
75+
}
6876
}
6977
})();

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

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
header(ng-hide="vm.loading")
22
h1.section-title(ng-bind="vm.userHasChallenges ? 'My Challenges' : 'Challenges'")
33

4+
.challenge-view-toggle
5+
button.tile(ng-click="vm.toggleView('tile')", ng-class="{ disabled: vm.challengeView === 'tile' }") Grid
6+
7+
button.list(ng-click="vm.toggleView('list')", ng-class="{ disabled: vm.challengeView === 'list' }") List
8+
49
.section-loading(ng-show="vm.loading")
510

611
section.noChallenges(ng-if="!vm.userHasChallenges && !vm.loading")
@@ -29,9 +34,15 @@ section.noChallenges(ng-if="!vm.userHasChallenges && !vm.loading")
2934

3035
a(href="") Learn More
3136

32-
section.hasChallenges(ng-if="vm.userHasChallenges && !vm.loading")
33-
.challenges
34-
challenge-tile(ng-repeat="challenge in vm.myChallenges | orderBy:registrationEndDate:true", challenge="challenge", view="'tile'", ng-class="'tile-view'")
37+
section.hasChallenges(ng-if="vm.userHasChallenges && !vm.loading", ng-class="{ 'list-view-active': vm.challengeView === 'list' }")
38+
.section-titles(ng-show="vm.challengeView === 'list'")
39+
.challenge-title Challenges
40+
.phase-title Phase
41+
.regs-subs-title Registrations & Submissions
42+
43+
.challenges(ng-class="vm.challengeView + '-view'")
44+
45+
challenge-tile(ng-repeat="challenge in vm.myChallenges | orderBy:registrationEndDate:true", challenge="challenge", view="vm.challengeView", ng-class="vm.challengeView + '-view'")
3546

3647
.my-challenges-links(ng-if="vm.userHasChallenges && !vm.loading")
3748
a(ui-sref="my-challenges") View All Active Challenges

app/my-dashboard/subtrack-stats/subtrack-stats.controller.js

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,34 @@
1515
activate();
1616

1717
function activate() {
18-
var handle = userIdentity.handle;
18+
vm.handle = userIdentity.handle;
1919

20-
ProfileService.getUserStats(handle)
20+
ProfileService.getUserStats(vm.handle)
2121
.then(function(stats) {
2222
var subtrackRanks = [];
2323

2424
var trackRanks = ProfileService.getRanks(stats);
25+
2526
angular.forEach(trackRanks, function(subtracks, track) {
2627
if (Array.isArray(subtracks) && subtracks.length) {
2728
subtrackRanks = subtrackRanks.concat(subtracks);
2829
}
2930
});
3031

32+
angular.forEach(subtrackRanks, function(subtrack) {
33+
if (subtrack.track === 'COPILOT') {
34+
subtrack.stat = subtrack.activeContests;
35+
subtrack.statType = 'Active Contests';
36+
} else if (subtrack.track === 'DESIGN') {
37+
subtrack.stat = subtrack.wins;
38+
subtrack.statType = 'Wins';
39+
} else {
40+
subtrack.stat = subtrack.rating;
41+
subtrack.statType = 'Rating';
42+
}
43+
});
44+
console.log('subtrackRanks: ', subtrackRanks);
45+
3146
vm.subtrackRanks = subtrackRanks;
3247
vm.hasRanks = !!vm.subtrackRanks.length;
3348
vm.loading = false;

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33

44
.ratings(ng-if="vm.hasRanks && !vm.loading")
55
.tracks
6-
.track(ng-repeat="subtrack in vm.subtrackRanks | orderBy: ['track', 'rank']", ui-sref="profile.develop({userHandle: vm.profile.handle, track: subtrack.track, subTrack: subtrack.subTrack})")
7-
p.subtrack {{subtrack.subTrack | underscoreStrip}}
6+
.track(ng-repeat="subtrack in vm.subtrackRanks | orderBy: ['track', 'rank']", ui-sref="profile.subtrack({userHandle: vm.handle, track: subtrack.track, subTrack: subtrack.subTrack})")
7+
.flex-wrapper
8+
p.subtrack {{subtrack.subTrack | underscoreStrip}}
89

9-
p.rating {{subtrack.rating | number}}
10-
span
10+
p.rating {{subtrack.stat | number}}
11+
span(style="background-color: {{subtrack.stat | ratingColor}}", ng-if="subtrack.track === 'DEVELOP' || subtrack.track === 'DATA_SCIENCE'")
1112

12-
p Rating
13+
p {{subtrack.statType}}

app/profile/about/about.controller.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
profileVm.skillsPromise.then(function() {
4141
// show section if user is viewing his/her own profile OR if we have data
4242
vm.fullSkills = profileVm.skills;
43-
vm.someSkills = profileVm.skills.slice(0, 9);
43+
vm.someSkills = profileVm.skills.slice(0, 6);
4444
vm.skills = vm.someSkills;
4545
vm.displaySection.skills = profileVm.showEditProfileLink || !!vm.skills.length;
4646
});

app/profile/about/about.jade

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,41 +4,42 @@
44
.profile-about-container
55

66
tc-section(id="skills", ng-show="vm.displaySection.skills" state="profileVm.status.skills" class="skills")
7-
h3.activity Skills & Technologies
7+
h3.activity Skills
8+
89
.list(ng-show="profileVm.skills && profileVm.skills.length > 0")
910

1011
.skill(ng-repeat="skill in vm.skills")
1112
skill-tile(skill="skill")
1213

13-
button.more(ng-show="vm.skills.length < vm.fullSkills.length", ng-click="vm.skills = vm.fullSkills") VIEW MORE
14+
button.more(ng-if="vm.skills.length < vm.fullSkills.length", ng-click="vm.skills = vm.fullSkills") VIEW ALL
15+
button.more(ng-if="vm.skills.length > 6", ng-click="vm.skills = vm.someSkills") VIEW LESS
1416

1517
.empty-state(ng-show="!profileVm.skills || (profileVm.skills && profileVm.skills.length == 0)")
16-
.action-text show us your skills &amp; tools, we'd love that!
18+
.action-text Tell everyone what you know
1719

1820
.list
1921
.skill(ng-repeat="skill in vm.sampleSkills")
2022
skill-tile(skill="skill")
2123

22-
.description The more the better. Skills are important for all challenge organizers and
23-
| the community at large. So, go ahead and tell us more about you.
24+
.description You can add languages, environments, frameworks, libraries, platforms, tools, and any other technologies that you know well.
2425

25-
button.link-button(ui-sref="settings.profile") ADD YOUR SKILLS
26+
button.link-button(ui-sref="settings.profile") ADD SKILLS
2627

2728
tc-section(id="tcActivity", state="profileVm.status.stats")
2829

2930
.categories
3031

31-
h3.activity Topcoder Activity
32+
h3.activity Activity on Topcoder
3233

3334
.empty-state(ng-if="!profileVm.numProjects")
34-
.action-text SHOW US YOU'RE A NINJA!
35+
.action-text Start competing within the community
3536
.tracks
3637
.track(ng-repeat="track in ['DEVELOP', 'DESIGN', 'DATA_SCIENCE']")
3738
div(class="{{profileVm.imgMap[track]}}-icon")
3839
div
3940
.text {{track | track}}
40-
.description Hey, whatever your like might be—Design, Development, or Data Science—we have it! Explore the Challenges section and show us what you’re made of!
41-
button.link-button(ui-sref="settings.profile") CHALLENGE ME!
41+
.description Compete in challenges to win money, test yourself against the world's best, and learn new skills. Your performance rating will show up here.
42+
button.link-button(ui-sref="settings.profile") FIND CHALLENGES
4243

4344
.track(
4445
ng-repeat="track in profileVm.profile.tracks",
@@ -49,6 +50,7 @@
4950
img(ng-if="track == 'DATA_SCIENCE'", src="/images/ico-track-data-outline.svg")
5051
img(ng-if="track == 'DEVELOP'", src="/images/ico-track-develop-outline.svg")
5152
img(ng-if="track == 'DESIGN'", src="/images/ico-track-design-outline.svg")
53+
img(ng-if="track == 'COPILOT'", src="/images/ico-track-co_pilot-outline.svg")
5254
span {{track | track | uppercase}}
5355

5456
.subtrack(
@@ -83,14 +85,14 @@
8385
img.arrow(src="/images/ico-arrow-big-right.svg")
8486

8587
tc-section(id="externalLinks", ng-show="vm.displaySection.externalLinks" state="profileVm.status.externalLinks" class="external-links")
86-
h3.activity Links
88+
h3.activity Activity across the web
8789
external-links-data(ng-show="vm.hasLinks" linked-accounts-data="vm.linkedExternalAccountsData")
8890

8991
.empty-state(ng-hide="vm.hasLinks")
90-
.action-text you are connected, be proud of it
92+
.action-text Showcase your work from around the web
9193

9294
external-accounts.external-account-container(linked-accounts="[]" read-only="true")
9395

94-
.description Adding your links to your profile will allow you to build your reputation, and show the other members how you're connected.
96+
.description Show off your work and experience outside of Topcoder. Connect accounts from popular services and networks or add a link to any site.
9597

96-
button.link-button(ui-sref="settings.profile") ADD YOUR LINKS
98+
button.link-button(ui-sref="settings.profile") CONNECT ACCOUNTS

0 commit comments

Comments
 (0)