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

Commit 0b3e95d

Browse files
author
vikasrohit
committed
Merge branch 'dev' into feature/sup-2481-intergrate-web-links-api
* dev: generic math icon added small fixes with missing IDs SUP-2729, Publish unit test results with build SUP-2729, Publish unit test results with build SUP-2673, Integrate with TravisCI SUP-2673, Integrate with TravisCI SUP-2673, Integrate with TravisCI skill icons updated removed hover for selected tab on subtrack Updated members of the month Mysterious solution because abs positioning is weird w/ flex cleanup Added reliability link for development Try to gzip css too Add styleguide folder to .gitignore switched to lodash sort Added sorting of submissions by placement SUP-2673, Integrate with TravisCI SUP-2486, Sticky header on profile is not working on Firefox
2 parents fda6af1 + b201b65 commit 0b3e95d

File tree

133 files changed

+2497
-2285
lines changed

Some content is hidden

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

133 files changed

+2497
-2285
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ report
88
.idea
99
.settings
1010
.vscode
11+
styleguide

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ In general, follow this [AngularJS style guide](https://github.com/johnpapa/angu
6969
### Pull Requests
7070

7171
To contribute to the repository, please create a feature branch off of the dev branch. Once you're finished working on the feature, make a pull request to merge it into dev. Then, make sure to delete the branch when it's no longer used.
72+
Further, please make sure every pull request has passed the build checks, which appears just before the "Merge pull request" button in github. We are trying to show the unit tests results as well along with the build.
7273

7374
### Adding New Content
7475

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
.challenge.tile-view(ng-show="view === 'tile'", ng-class="challenge.track")
22
.active-challenge(ng-show="challenge.status === 'ACTIVE'")
3-
.challenge-track
43

54
header
65
.top
76
a.name(ng-href="{{challenge|challengeLinks:'detail'}}") #[span {{challenge.name}}]
87

8+
.challenge-track
9+
910
p.subtrack-color {{challenge.subTrack | underscoreStrip}}
1011

1112
challenge-links(challenge="challenge", view="'tile'")

app/directives/challenge-user-place/challenge-user-place.directive.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@
4848
$scope.challenge.userDetails.submissions = $scope.challenge.userDetails.submissions.filter(function(submission) {
4949
return submission && submission.submissionImage;
5050
});
51+
$scope.challenge.userDetails.submissions = _.sortBy($scope.challenge.userDetails.submissions, function(submission) {
52+
return submission.placement;
53+
});
5154
}
5255
if (!$scope.challenge.isPrivate && $scope.challenge.userDetails && $scope.challenge.userDetails.submissions && $scope.challenge.userDetails.submissions.length > 0) {
5356
$scope.numImages = $scope.challenge.userDetails.submissions.length;

app/directives/tc-sticky/tc-sticky.directive.js

Lines changed: 32 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -8,63 +8,45 @@
88
return {
99
restrict: 'A',
1010
link: function(scope, element) {
11-
scope.width = element.prop('offsetWidth');
12-
13-
var elWidth = scope.width + 'px';
14-
var elChild = angular.element(element[0].querySelector(':first-child'));
15-
// elChild.css('width', elWidth);
16-
17-
var hitBottom = false;
18-
19-
angular.element($window).bind("scroll", function() {
20-
var affixElement = document.getElementById('affix');
21-
var xPosition = 0;
22-
var yPosition = 0;
23-
24-
function getPosition(element) {
25-
while(element) {
26-
yPosition += (element.offsetTop - element.scrollTop + element.clientTop);
27-
element = element.offsetParent;
28-
}
29-
}
30-
31-
getPosition(affixElement);
32-
33-
var height = angular.element(affixElement).prop('offsetHeight');
34-
var top = angular.element(affixElement).prop('offsetTop');
35-
36-
if (yPosition >= 0 || $window.innerHeight <= elChild[0].offsetHeight || $window.innerWidth < 768) {
37-
elChild.removeClass('affix affix-bottom');
38-
} else if ( yPosition < 0) {
39-
var bodyRect = document.body.getBoundingClientRect()
40-
var elChildRect = elChild[0].getBoundingClientRect()
41-
var elChildAbsOffset = elChildRect.top - bodyRect.top;
42-
11+
scope.width = element.prop('offsetWidth');
12+
var elWidth = scope.width + 'px',
13+
elChild = angular.element(element[0].querySelector(':first-child'));
14+
var hitBottom = false;
15+
angular.element($window).bind("scroll", function() {
16+
var affixElement = document.getElementById('affix');
4317
var affixElementRect = affixElement.getBoundingClientRect();
44-
var affixElementAbsOffset = affixElementRect.top - bodyRect.top;
18+
var elChildRect = elChild[0].getBoundingClientRect();
19+
if (affixElementRect.top >= 0 || $window.innerHeight <= elChildRect.height || $window.innerWidth < 768) {
20+
elChild.removeClass('affix affix-bottom');
21+
} else if ( affixElementRect.top < 0) {
22+
var bodyRect = document.body.getBoundingClientRect();
23+
var elChildAbsOffset = elChildRect.top - bodyRect.top;
4524

46-
var elChildOffset = elChildAbsOffset - affixElementAbsOffset;
47-
var elChildHeight = elChild[0].clientHeight;
48-
var affixElementHeight = affixElement.clientHeight;
25+
var affixElementRect = affixElement.getBoundingClientRect();
26+
var affixElementAbsOffset = affixElementRect.top - bodyRect.top;
4927

50-
var pastBottom = elChildOffset + elChildHeight > affixElementHeight;
51-
var topCovered = elChildRect.top > 10;
28+
var elChildOffset = elChildAbsOffset - affixElementAbsOffset;
29+
var elChildHeight = elChild[0].clientHeight;
30+
var affixElementHeight = affixElement.clientHeight;
5231

53-
elChild.addClass('affix');
32+
var pastBottom = elChildOffset + elChildHeight > affixElementHeight;
33+
var topCovered = elChildRect.top > 10;
5434

55-
if (pastBottom && !hitBottom) {
56-
hitBottom = true;
57-
elChild.addClass('affix-bottom');
58-
elChild.removeClass('affix');
59-
}
60-
61-
if (topCovered) {
62-
hitBottom = false;
63-
elChild.removeClass('affix-bottom');
6435
elChild.addClass('affix');
36+
37+
if (pastBottom && !hitBottom) {
38+
hitBottom = true;
39+
elChild.addClass('affix-bottom');
40+
elChild.removeClass('affix');
41+
}
42+
43+
if (topCovered) {
44+
hitBottom = false;
45+
elChild.removeClass('affix-bottom');
46+
elChild.addClass('affix');
47+
}
6548
}
66-
}
67-
});
49+
});
6850
}
6951
};
7052
}

app/directives/tc-tabs/tc-tabs.directive.jade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
ul.tab-set
44
li.tab-pill(ng-repeat="tab in tabSet.tabs")
5-
a(ng-click="tabSet.select(tab)")
5+
a(ng-click="tabSet.select(tab)", ng-class="{'selected': tab.active}")
66
.header(ng-class="{'selected': tab.active}") {{tab.heading}}
77

88
.tab-view(ng-transclude)

app/profile/subtrack/subtrack.controller.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@
7575
// user iterable stats
7676
vm.subTrackStats = UserStatsService.getIterableStats(vm.track, vm.subTrack, data);
7777
if (vm.track === 'DEVELOP') {
78+
var reliability = vm.subTrackStats.filter(function(stat) { return stat.label === 'reliability'; });
79+
if (reliability.length > 0) {
80+
reliability = reliability[0];
81+
reliability.link = 'http://community.' + vm.domain + '/tc?module=ReliabilityDetail&pt=2&cr=' + profileVm.profile.userId;
82+
}
7883
var mustHaveMetrics = ["rank", "rating", "reliability"];
7984
// check if rating, rank & reliability are all set
8085
var _filteredObjs = _.filter(vm.subTrackStats, function(k) { return _.indexOf(mustHaveMetrics, k.label) > -1});

app/profile/subtrack/subtrack.jade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
.subtrack-stats
1010
responsive-carousel(data="vm.subTrackStats", handle="{{vm.handle}}")
1111
.carousel-elem
12-
.flex-wrapper
12+
a.flex-wrapper(ng-class="{'link': item.link, 'no-link': !item.link}", ng-href="{{item.link}}")
1313
p.title(ng-hide="true") {{item.subTrack | track}}
1414

1515
p.value(ng-show="item.label === 'rating'", style="color: {{item.val | ratingColor}}") {{item.val | empty}}

app/services/communityData.service.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,29 +19,29 @@
1919
var data = {
2020
"memberLeaderboard": [
2121
{
22-
"avatar": "//www.topcoder.com/wp-content/uploads/2015/05/iamtong_oct2015.png",
23-
"name": "iamtong ",
22+
"avatar": "//www.topcoder.com/wp-content/uploads/2015/05/abedavera.jpg",
23+
"name": "abedavera",
2424
"contestType": "Design",
25-
"description": "Won $6500 in design challenges.",
25+
"description": "TCO15 Design Champion!",
2626
"class": "design"
2727
}, {
28-
"avatar": "//www.topcoder.com/wp-content/uploads/2015/05/cjalmeida_oct2015.png",
29-
"name": "cjalmeida",
28+
"avatar": "//www.topcoder.com/wp-content/uploads/2015/05/bonton.jpg",
29+
"name": "bonton",
3030
"contestType": "Development",
31-
"description": "Won $4500 in development challenges.",
31+
"description": "Won $4200 with 4 wins in development challenges",
3232
"class": "develop"
3333
}, {
34-
"avatar": "//www.topcoder.com/wp-content/uploads/2015/05/islands_oct2015.png",
35-
"name": "islands",
34+
"avatar": "//www.topcoder.com/wp-content/uploads/2015/05/maksay.jpg",
35+
"name": "maksay",
3636
"contestType": "Data Science",
37-
"description": "Advanced from Div 2 to Div 1 & total rating increase of 424 pts.",
37+
"description": "Only participant to see a ratings increase in all four rounds in Sept.",
3838
"class": "data-science"
3939
}, {
40-
"avatar": "https://s3.amazonaws.com/app.topcoder-dev.com/images/ico-user-default.7aa28736.svg",
41-
"name": "WinkTales",
42-
"contestType": "Dev Rookie",
43-
"description": "Already won 2 challenges in his short 2.5 month time with Topcoder",
44-
"class": "develop"
40+
"avatar": "https://www.topcoder.com/wp-content/uploads/2015/05/herlansyahs.jpg",
41+
"name": "herlansyahs",
42+
"contestType": "Design Rookie",
43+
"description": "Won first and second placements within his first two months of becoming a member!",
44+
"class": "design"
4545
}],
4646
"copilots": [{
4747
"avatar": "//community.topcoder.com/i/m/maroosh.jpeg",

assets/css/directives/responsive-carousel.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,12 @@
152152
display: flex;
153153
flex-direction: column;
154154
align-items: center;
155+
&.no-link {
156+
cursor: default;
157+
}
158+
&.link {
159+
cursor: pointer;
160+
}
155161
}
156162

157163
p {

assets/css/profile/subtrack.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
flex-direction: column;
66
.content {
77

8+
a.selected:hover {
9+
cursor: default;
10+
}
11+
812
@include module-full-width;
913
max-width: 1242px;
1014
background: white;

assets/images/skills/id-100.svg

Lines changed: 5 additions & 5 deletions
Loading

assets/images/skills/id-101.svg

Lines changed: 25 additions & 0 deletions
Loading

assets/images/skills/id-105.svg

Lines changed: 19 additions & 0 deletions
Loading

assets/images/skills/id-106.svg

Lines changed: 16 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)