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

Commit a765646

Browse files
author
Nick Litwin
committed
Progress on past design challenge cards
1 parent 316f2d0 commit a765646

File tree

7 files changed

+31
-36
lines changed

7 files changed

+31
-36
lines changed

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,9 @@
66

77
p {{subTrack}}
88

9-
.challenge-details
10-
//- .thumbnail(ng-if="challenge.track === 'DESIGN'")
11-
//- img(ng-src="http://studio.topcoder.com/studio.jpg?module=DownloadSubmission&sbmid={{challenge.thumbnailId}}&sbt=thumb", fallback-src="/images/lock-icon-small.png")
12-
9+
.challenge-details(ng-hide="challenge.isPastDesignChallenge")
1310
p.currentPhase {{challenge.currentPhases[0].phaseType}}
1411

15-
1612
.challenge-calendar
1713
p.starts-in Ends In
1814
p.time-remaining 3
@@ -39,6 +35,9 @@
3935

4036
p Forum
4137

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")
40+
4241
.challenge.list-view(ng-show="view=='list'")
4342
.challenge-icons
4443
img(ng-show="challenge.track === 'DEVELOP'", src="/images/member-program/svg/development-generic.svg")

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,16 @@
2222
}
2323

2424
function processChallenge(challenge) {
25+
challenge.isPastDesignChallenge = false;
2526
$scope.subTrack = challenge.subTrack.replace(/_/g, ' ');
26-
// if (challenge.track == 'DESIGN' && challenge.userDetails.submissions && challenge.userDetails.submissions.length > 0) {
27-
// challenge.thumbnailId = challenge.userDetails.submissions[0].id;
28-
// }
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+
}
2935
}
3036
}]
3137
};

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@
6464
}
6565
};
6666

67-
// get ACTIVE challenges and spotlight challenges
6867
function _getChallenges() {
6968
var params = {
7069
limit: vm.pageParams.limit,
@@ -77,9 +76,8 @@
7776
vm.loading = true;
7877
return ChallengeService.getUserChallenges(handle, params)
7978
.then(function(challenges){
79+
console.log(challenges.plain());
8080
if (challenges.length > 0) {
81-
// FIXME until we figure out the correct sort order param
82-
8381
vm.myChallenges = challenges;
8482
vm.userHasChallenges = true;
8583
vm.loading = false;

app/my-challenges/my-challenges.jade

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,3 @@
2424
tc-paginator(data="vm.myChallenges", page-params="vm.pageParams")
2525
.data(ng-class="vm.view + '-view'")
2626
challenge-tile(ng-repeat="challenge in vm.myChallenges | orderBy:registrationEndDate:true", challenge="challenge", view="vm.view", ng-class="vm.view + '-view'")
27-
28-
.section-links
29-
.link
30-
a(href="https://www.{{vm.domain}}/challenges/?pageIndex=1") Find New Challenges
31-
32-
.link(ng-show="vm.isCopilot")
33-
a(href="https://www.{{vm.domain}}/direct") Launch Topcoder Direct
34-
35-
.link(ng-hide="vm.userHasChallenges")
36-
a(href="https://community.{{vm.domain}}/", target="_blank") View Help Library
37-
38-
hr
39-

assets/css/directives/challenge-tile.scss

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
font-size: 14px;
3737
line-height: 18px;
3838
color: $primary-text;
39-
text-decoration: none;
39+
@include link;
4040
@include ellipsis;
4141
}
4242

@@ -175,6 +175,12 @@
175175
height: 17px;
176176
background-image: url(/images/ico-posts.svg);
177177
}
178+
179+
.past-design-details {
180+
img {
181+
height: 200px;
182+
}
183+
}
178184
}
179185

180186

assets/css/my-challenges/my-challenges.scss

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
1-
2-
@import '../partials/combined';
31
@import '../partials/combined';
42

53
.my-challenges-container {
64
width: 100%;
75
display: flex;
86
flex-direction: column;
97

10-
hr {
11-
@include horizontal-rule;
12-
margin-bottom: 35px;
13-
}
14-
158
.section-loading {
169
width: 100%;
1710
height: 50px;
@@ -25,11 +18,9 @@
2518
}
2619

2720
.my-challenges {
28-
min-height: 50px;
29-
display: flex;
30-
flex-direction: column;
21+
@include module-l;
3122

32-
header {
23+
> header {
3324
position: relative;
3425
margin-bottom: 35px;
3526

assets/css/partials/_mixins.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,14 @@
121121
}
122122

123123
// Replace with classes from style guide, when it's finished
124+
@mixin link {
125+
text-decoration: none;
126+
127+
&:hover {
128+
text-decoration: underline;
129+
}
130+
}
131+
124132
@mixin button-s {
125133
height: 20px;
126134
line-height: 20px;

0 commit comments

Comments
 (0)