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

Commit 09767e3

Browse files
author
Nick Litwin
committed
Fix merge conflicts
2 parents a765646 + 0f02ec3 commit 09767e3

File tree

112 files changed

+4583
-1884
lines changed

Some content is hidden

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

112 files changed

+4583
-1884
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/account/account.routes.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
},
3030
'login': {
3131
parent: 'auth',
32-
url: '/login/?next&code&state&status&userJWTToken',
32+
url: '/login/?next&code&state&status&userJWTToken&utm_source&utm_medium&utm_campaign',
3333
params: { 'notifyReset': false },
3434
data: {
3535
title: 'Login'
@@ -51,7 +51,7 @@
5151
},
5252
'register': {
5353
parent: 'auth',
54-
url: '/register/?next',
54+
url: '/register/?next&utm_source&utm_medium&utm_campaign',
5555
data: {
5656
title: "Join"
5757
},

app/account/login/login.controller.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
function(data) {
2323
// success
2424
$log.debug('logged in');
25+
// setup login event for analytics tracking
26+
Helpers.setupLoginEventMetrices(usernameOrEmail);
2527
return Helpers.redirectPostLogin($stateParams.next);
2628
})
2729
.catch(function(resp) {

app/account/register/register.controller.js

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@
99
$log = $log.getInstance("RegisterController");
1010
$log.debug("-init");
1111
var vm = this;
12+
// prepares utm params, if available
13+
var utm = {
14+
source : $stateParams && $stateParams.utm_source ? $stateParams.utm_source : '',
15+
medium : $stateParams && $stateParams.utm_medium ? $stateParams.utm_medium : '',
16+
campaign : $stateParams && $stateParams.utm_campaign ? $stateParams.utm_campaign : ''
17+
};
1218

1319

1420
// Set default for toggle password directive
@@ -24,9 +30,10 @@
2430
vm.countries = ISO3166.getAllCountryObjects();
2531

2632
vm.updateCountry = function (angucompleteCountryObj) {
27-
var countryCode = _.get(angucompleteCountryObj, 'originalObject.alpha3', undefined);
33+
var countryCode = _.get(angucompleteCountryObj, 'originalObject.code', undefined);
2834

2935
var isValidCountry = _.isUndefined(countryCode) ? false : true;
36+
vm.country = countryCode;
3037
vm.registerForm.country.$setValidity('required', isValidCountry);
3138
};
3239

@@ -37,11 +44,11 @@
3744
lastName: vm.lastname,
3845
email: vm.email,
3946
country: {
40-
name: vm.country
47+
code: vm.country
4148
},
42-
utmSource: '',
43-
utmMedium: '',
44-
utmCampaign: ''
49+
utmSource: utm.source,
50+
utmMedium: utm.medium,
51+
utmCampaign: utm.campaign
4552
};
4653

4754
if (!vm.isSocialRegistration) {
@@ -63,9 +70,10 @@
6370
var body = {
6471
param: userInfo,
6572
options: {
66-
afterActivationURL: CONSTANTS.MAIN_URL + '/my-dashboard/'
73+
afterActivationURL: $state.href('skillPicker', {}, {absolute: true})
6774
}
6875
}
76+
6977
$log.debug('attempting to register user');
7078
TcAuthService.register(body)
7179
.then(function(data) {
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
(function() {
2+
'use strict';
3+
4+
angular.module('tcUIComponents').directive('tcBusyButton', tcBusyButton);
5+
6+
function tcBusyButton() {
7+
return {
8+
restrict: "A",
9+
scope: {
10+
tcBusyMessage: "=",
11+
tcBusyWhen: "="
12+
},
13+
link: function(scope, element, attrs) {
14+
scope.originalContent = element.html();
15+
scope.busyMessage = attrs.tcBusyMessage || "Saving...";
16+
scope.$watch('tcBusyWhen', function(newValue, oldValue) {
17+
if (newValue !== oldValue && newValue === true) {
18+
19+
var busyMessageHtml = String.supplant(
20+
'<i class="fa fa-spinner fa-spin"></i>&nbsp;<span style="text-transform:none;">{busyMessage}</span>',
21+
scope);
22+
element.attr('disabled', true).html('').append(busyMessageHtml);
23+
} else {
24+
element.removeAttr('disabled').html(scope.originalContent);
25+
}
26+
});
27+
}
28+
}
29+
}
30+
})();

app/directives/busy-button/busy-button.directive.spec.js

Whitespace-only changes.
Lines changed: 80 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,104 @@
11
.challenge.tile-view(ng-show="view === 'tile'", ng-class="challenge.track")
2-
.challenge-track
2+
.active-challenge(ng-show="challenge.status === 'ACTIVE'")
3+
.challenge-track
34

4-
header
5-
a(ng-href="https://www.{{DOMAIN}}/challenge-details/{{challenge.id}}/?type={{challenge.track}}") {{challenge.name}}
5+
header
6+
a(ng-href="https://www.{{DOMAIN}}/challenge-details/{{challenge.id}}/?type={{challenge.track}}") {{challenge.name}}
7+
8+
p.subtrack-color {{challenge.subTrack | underscoreStrip}}
9+
10+
.challenge-details
11+
p.currentPhase {{challenge.userCurrentPhase}}
12+
13+
.challenge-calendar(ng-show="challenge.userCurrentPhaseEndTime")
14+
p.ends-in Ends In
15+
p.time-remaining {{challenge.userCurrentPhaseEndTime[0]}}
16+
p.unit-of-time {{challenge.userCurrentPhaseEndTime[1]}}
617

7-
p {{subTrack}}
18+
.stalled-challenge(ng-hide="challenge.userCurrentPhaseEndTime") This challenge is currently paused.
819

9-
.challenge-details(ng-hide="challenge.isPastDesignChallenge")
10-
p.currentPhase {{challenge.currentPhases[0].phaseType}}
20+
.phase-action(ng-switch="challenge.userAction")
21+
.submit(ng-switch-when="Submit") Submit
1122

12-
.challenge-calendar
13-
p.starts-in Ends In
14-
p.time-remaining 3
15-
p.unit-of-time days
23+
.submitted(ng-switch-when="Submitted") Submitted
1624

17-
button.phase-action(ng-class="{'action-completed': challenge.currentPhaseActionCompleted}") Submit
25+
// Need styling and JS logic for this one
26+
.registered(ng-switch-when="Registered") Registered
1827

19-
p.roles {{challenge.userDetails.roles | listRoles}}
28+
// Only show if not data science track
29+
p.roles {{challenge.userDetails.roles | listRoles}}
2030

21-
.challenge-links
22-
.stats
23-
a.registrants(ng-href="https://www.{{DOMAIN}}/challenge-details/{{challenge.id}}/?type={{challenge.track}}#viewRegistrant")
24-
.registrants-icon
31+
.challenge-links
32+
.stats
33+
a.registrants(ng-href="https://www.{{DOMAIN}}/challenge-details/{{challenge.id}}/?type={{challenge.track}}#viewRegistrant")
34+
.registrants-icon
2535

26-
p {{challenge.numRegistrants}}
36+
p {{challenge.numRegistrants}}
2737

28-
a.submissions(ng-href="https://www.{{DOMAIN}}/challenge-details/{{challenge.id}}/?type={{challenge.track}}#viewRegistrant")
29-
.submissions-icon
38+
a.submissions(ng-hide="challenge.track === 'DATA SCIENCE'", ng-href="https://www.{{DOMAIN}}/challenge-details/{{challenge.id}}/?type={{challenge.track}}#viewRegistrant")
39+
.submissions-icon
3040

31-
p {{challenge.numSubmissions}}
41+
p {{challenge.numSubmissions}}
3242

33-
a.forum(ng-href="http://apps.{{DOMAIN}}/forums//?module=Category&categoryID={{challenge.forumId}}")
34-
.forum-icon
43+
a.forum(ng-href="http://apps.{{DOMAIN}}/forums//?module=Category&categoryID={{challenge.forumId}}")
44+
.forum-icon
3545

36-
p Forum
46+
p Forum
3747

38-
.past-design-details(ng-show="challenge.isPastDesignChallenge")
39-
img(ng-src="http://studio.topcoder.com/studio.jpg?module=DownloadSubmission&sbmid={{challenge.thumbnailId}}&sbt=thumb", fallback-src="/images/lock-icon-small.png")
48+
.completed-challenge(ng-show="challenge.status === 'COMPLETED'")
49+
header
50+
a(ng-href="https://www.{{DOMAIN}}/challenge-details/{{challenge.id}}/?type={{challenge.track}}") {{challenge.name}}
4051

41-
.challenge.list-view(ng-show="view=='list'")
42-
.challenge-icons
43-
img(ng-show="challenge.track === 'DEVELOP'", src="/images/member-program/svg/development-generic.svg")
44-
img(ng-show="challenge.track === 'DESIGN' || challenge.track === 'Data Science'", src="/images/member-program/svg/design-generic.svg")
52+
p.date-completed {{challenge.submissionEndDate | date : 'MMMM yyyy'}}
4553

46-
.challenge-name
54+
.winner-ribbon(ng-show="challenge.wonFirst")
55+
56+
.challenge-details
57+
p.place(ng-class="{ 'first-place': challenge.wonFirst }") {{challenge.highestPlacement}}#[span {{challenge.highestPlacement | ordinal:true}}] Place
58+
59+
.challenge-score
60+
p.score {{challenge.userDetails.submissionReviewScore/100 | percentage}}
61+
62+
p Review Score
63+
64+
.challenge.list-view(ng-show="view=='list'", ng-class="challenge.track")
65+
.challenge-track
66+
67+
header
4768
a(ng-href="https://www.{{DOMAIN}}/challenge-details/{{challenge.id}}/?type={{challenge.track}}") {{challenge.name}}
48-
.phase-status(ng-show="challenge.status === 'Active'")
49-
i.fa.fa-check-circle-o
5069

51-
p {{challenge.memberStatusMsg}}
70+
p.subtrack {{challenge.subTrack | underscoreStrip}}
71+
72+
p.roles(ng-hide="challenge.track === 'DATA SCIENCE'") #[span Role:] {{challenge.userDetails.roles | listRoles}}
73+
74+
.challenge-details
75+
.challenge-info
76+
p.currentPhase {{challenge.userCurrentPhase}}
77+
78+
p.ends-in(ng-show="challenge.userCurrentPhaseEndTime") Ends: {{challenge.userCurrentPhaseEndTime[2] | localTime}}
5279

53-
.roles
54-
p Roles : {{challenge.userDetails.roles | listRoles}}
80+
p.ends-in(ng-hide="challenge.userCurrentPhaseEndTime") This challenge is currently paused.
5581

56-
p.days-remaining(ng-show="challenge.status === 'Active'") {{challenge.registrationEndDate | timeDiff}}
57-
span Registration Ends
58-
p.completion-date(ng-show="challenge.status === 'Completed'")
59-
span Ended {{challenge.submissionEndDate | date: "mediumDate"}}
82+
.phase-action(ng-switch="challenge.userAction")
83+
.submit(ng-switch-when="Submit") Submit
6084

61-
.stats
62-
.registrants(ng-show="challenge.numRegistrants > 0")
63-
i.fa.fa-user
64-
a(ng-href="https://www.{{DOMAIN}}/challenge-details/{{challenge.id}}/?type={{challenge.track}}#viewRegistrant") {{challenge.numRegistrants}}
65-
.submissions(ng-show="challenge.numSubmissions > 0")
66-
i.fa.fa-files-o
67-
a(ng-href="https://www.{{DOMAIN}}/challenge-details/{{challenge.id}}/?type={{challenge.track}}#viewRegistrant") {{challenge.numSubmissions}}
85+
.submitted(ng-switch-when="Submitted") Submitted
6886

87+
// Need styling and JS logic for this one
88+
.registered(ng-switch-when="Registered") Registered
6989

7090
.challenge-links
71-
a(ng-href="http://apps.{{DOMAIN}}/forums//?module=Category&categoryID={{challenge.forumId}}")
72-
i.fa.fa-comment
91+
a.registrants(ng-href="https://www.{{DOMAIN}}/challenge-details/{{challenge.id}}/?type={{challenge.track}}#viewRegistrant")
92+
p {{challenge.numRegistrants}}
93+
94+
.registrants-icon
95+
96+
a.submissions(ng-hide="challenge.track === 'DATA SCIENCE'", ng-href="https://www.{{DOMAIN}}/challenge-details/{{challenge.id}}/?type={{challenge.track}}#viewRegistrant")
97+
p {{challenge.numSubmissions}}
98+
99+
.submissions-icon
100+
101+
a.forum(ng-href="http://apps.{{DOMAIN}}/forums//?module=Category&categoryID={{challenge.forumId}}")
102+
.forum-icon
103+
104+
p Forum

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

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,9 @@
1818

1919
function activate() {
2020
// console.log($scope.challenge.plain());
21-
processChallenge($scope.challenge);
22-
}
23-
24-
function processChallenge(challenge) {
25-
challenge.isPastDesignChallenge = false;
26-
$scope.subTrack = challenge.subTrack.replace(/_/g, ' ');
27-
if (challenge.status === 'COMPLETED' && challenge.track === 'DESIGN') {
28-
challenge.isPastDesignChallenge = true;
29-
}
30-
31-
if (challenge.track === 'DESIGN' && challenge.userDetails.submissions && challenge.userDetails.submissions.length > 0) {
32-
challenge.thumbnailId = challenge.userDetails.submissions[0].id;
33-
34-
}
21+
// if (challenge.track == 'DESIGN' && challenge.userDetails.submissions && challenge.userDetails.submissions.length > 0) {
22+
// challenge.thumbnailId = challenge.userDetails.submissions[0].id;
23+
// }
3524
}
3625
}]
3726
};

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/external-account/external-link-data.directive.jade

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
.external-link-list
22
div.external-link-tile(ng-repeat="account in linkedAccounts")
3-
div.logo
4-
i.fa(ng-class="(account|providerData:'className') || 'fa-globe'")
5-
h2 {{account|providerData:"displayName"}}
3+
.top
4+
div.logo
5+
i.fa(ng-class="(account|providerData:'className') || 'fa-globe'")
6+
h2 {{account|providerData:"displayName"}}
67

7-
div(ng-switch="account.provider")
8+
div.bottom(ng-switch="account.provider")
89

910
div(ng-switch-when="github")
1011
.handle {{account.data.handle}}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// clean srefs
2+
li.submenu-item(ng-if="item.sref && !item.srefParams")
3+
a.menu-link(ui-sref="{{item.sref}}" ng-class="{ 'active': isActive() }" ) {{item.text}}
4+
5+
// external links
6+
li.submenu-item(ng-if="item.href && !item.srefParams")
7+
a.menu-link(ng-click="$event.stopPropagation();" ng-href="{{item.href}}" ng-class="{ 'active': isActive() }" target="_blank") {{item.text}}
8+
9+
// srefs with params
10+
li.submenu-item(ng-if="item.srefParams")
11+
a.menu-link(ng-href="{{wtfhref}}" ng-class="{ 'active': isActive() }" ) {{item.text}}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
(function() {
2+
'use strict';
3+
angular.module('tcUIComponents').directive('headerMenuItem', function() {
4+
5+
return {
6+
restrict: 'E',
7+
templateUrl: 'directives/header/header-menu-item.directive.html',
8+
scope: {
9+
item: '='
10+
},
11+
controller: ['$scope', '$state', function($scope, $state) {
12+
var sref = $scope.item.sref;
13+
var href = $scope.item.href;
14+
15+
// I believe I have to hack this because of https://github.com/angular-ui/ui-router/issues/395, I tried ui-state
16+
if ($scope.item.srefParams)
17+
$scope.wtfhref = $state.href($scope.item.sref, $scope.item.srefParams);
18+
19+
$scope.isActive = function() {
20+
if (window.location.pathname == href || $state.is(sref))
21+
return true;
22+
return false;
23+
}
24+
}]
25+
};
26+
});
27+
})();

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: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,24 @@
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") &nbsp;|&nbsp;
1313
span(ng-show="numChallenges") {{numChallenges}} Challenges
1414

1515
p.description {{profile.quote}}
1616

17-
a(ng-show="editProfileLink", ui-sref="settings.profile") Edit Profile
17+
button.edit(ng-show="editProfileLink", ui-sref="settings.profile") Edit Profile
1818

1919
.tracks-links
2020
.tracks
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

2828
.links
29-
a.forums.link(href="http://forums.{{DOMAIN}}/?module=History&userID={{profileVm.profile.userId}}")
29+
button.forums.link(href="http://forums.{{DOMAIN}}/?module=History&userID={{profileVm.profile.userId}}")
3030
| Forum Posts
31-
a.badges.link(ng-click="profileVm.showBadges()")
31+
button.badges.link(ng-click="profileVm.showBadges()")
3232
| Badges

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ a(ng-click="enableHide && toggle()")
44
i.colored(ng-show="icon", ng-class="icon")
55
img.default(ng-hide="icon", src="/images/ico-code-c.svg")
66
.name {{skill.tagName}} [{{skill.score}}]
7-
spam(ng-if="skill.hidden") Hidden
7+
span.hidden(ng-if="skill.hidden") (Hidden)
88

0 commit comments

Comments
 (0)