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

Commit 258c25f

Browse files
author
Nick Litwin
committed
Basic tile view of past design challenges
1 parent 09767e3 commit 258c25f

File tree

4 files changed

+82
-5
lines changed

4 files changed

+82
-5
lines changed

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

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,27 @@
5353

5454
.winner-ribbon(ng-show="challenge.wonFirst")
5555

56-
.challenge-details
56+
.challenge-details(ng-hide="challenge.track === 'DESIGN'")
5757
p.place(ng-class="{ 'first-place': challenge.wonFirst }") {{challenge.highestPlacement}}#[span {{challenge.highestPlacement | ordinal:true}}] Place
5858

5959
.challenge-score
6060
p.score {{challenge.userDetails.submissionReviewScore/100 | percentage}}
6161

6262
p Review Score
6363

64+
.challenge-details(ng-show="challenge.track === 'DESIGN'")
65+
p.place(ng-class="{ 'first-place': challenge.wonFirst }") {{challenge.highestPlacement}}#[span {{challenge.highestPlacement | ordinal:true}}] Place
66+
67+
.thumbnail
68+
img(ng-src="http://studio.{{DOMAIN}}/studio.jpg?module=DownloadSubmission&sbmid={{challenge.thumbnailId}}&sbt=thumb", fallback-src="/images/ico-picture.svg")
69+
70+
.thumbnail-gallery(ng-click="challenge.showLightbox()")
71+
.gallery-icon
72+
73+
.num-images {{3}} images
74+
75+
76+
6477
.challenge.list-view(ng-show="view=='list'", ng-class="challenge.track")
6578
.challenge-track
6679

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

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

1919
function activate() {
20-
// console.log($scope.challenge.plain());
21-
// if (challenge.track == 'DESIGN' && challenge.userDetails.submissions && challenge.userDetails.submissions.length > 0) {
22-
// challenge.thumbnailId = challenge.userDetails.submissions[0].id;
23-
// }
20+
// move to service helper, called from controller
21+
if ($scope.challenge.track == 'DESIGN' && $scope.challenge.userDetails.submissions && $scope.challenge.userDetails.submissions.length > 0) {
22+
$scope.challenge.thumbnailId = $scope.challenge.userDetails.submissions[0].id;
23+
24+
$scope.challenge.highestPlacement = _.max($scope.challenge.userDetails.submissions, 'placement').placement;
25+
26+
if ($scope.challenge.highestPlacement == 1) {
27+
$scope.challenge.wonFirst = true;
28+
}
29+
}
2430
}
2531
}]
2632
};

assets/css/directives/challenge-tile.scss

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ challenge-tile .challenge.tile-view {
270270
@include sofia-pro-regular;
271271
font-size: 20px;
272272
color: $gray-darkest;
273+
text-transform: uppercase;
273274

274275
&.first-place {
275276
font-weight: bold;
@@ -278,6 +279,7 @@ challenge-tile .challenge.tile-view {
278279

279280
span {
280281
@include superscript;
282+
text-transform: lowercase;
281283
}
282284
}
283285

@@ -305,6 +307,46 @@ challenge-tile .challenge.tile-view {
305307
text-transform: uppercase;
306308
}
307309
}
310+
311+
.thumbnail {
312+
position: relative;
313+
width: 268px;
314+
height: 200px;
315+
overflow: hidden;
316+
317+
img {
318+
width: 100%;
319+
height: auto;
320+
overflow: hidden;
321+
}
322+
323+
.thumbnail-gallery {
324+
position: absolute;
325+
display: flex;
326+
flex-direction: row;
327+
align-items: center;
328+
width: 270px;
329+
height: 32px;
330+
bottom: 0;
331+
left: 0;
332+
background-color: rgba(0, 0, 0, 0.4);
333+
cursor: pointer;
334+
335+
.gallery-icon {
336+
margin-left: 10px;
337+
@include background-image-size(21px, 17px);
338+
background: url(/images/ico-gallery.svg);
339+
}
340+
341+
.num-images {
342+
margin-left: 8px;
343+
@include sofia-pro-regular;
344+
font-size: 10px;
345+
color: $gray-lighter;
346+
text-transform: uppercase;
347+
}
348+
}
349+
}
308350
}
309351
}
310352

assets/images/ico-picture.svg

Lines changed: 16 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)