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

Feature/sup 2839 invite only challenge card #720

Merged
merged 3 commits into from
Feb 8, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions app/directives/challenge-tile/challenge-tile.jade
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

p.date-completed {{challenge.submissionEndDate | date : 'MMMM yyyy'}}

.winner-ribbon(ng-show="challenge.wonFirst")
.winner-ribbon(ng-show="challenge.wonFirst && !challenge.isPrivate")

.challenge-card__bottom.challenge-card__bottom--completed
.challenge-details(ng-switch-when="DATA_SCIENCE", ng-switch="challenge.subTrack", ng-class="challenge.track")
Expand All @@ -55,10 +55,16 @@
p Total Points

.challenge-details(ng-switch-when="DEVELOP")
dev-challenge-user-place(challenge="challenge", view="view")
dev-challenge-user-place(challenge="challenge", view="view", ng-hide="challenge.isPrivate")
.invite-only-banner(ng-show="challenge.isPrivate")
img(src=require("../../../assets/images/ico-invite-only-prj.svg"))
span INVITE-ONLY CHALLENGE

.challenge-details(ng-switch-when="DESIGN")
design-challenge-user-place(challenge="challenge", view="view")
design-challenge-user-place(challenge="challenge", view="view", ng-hide="challenge.isPrivate")
.invite-only-banner(ng-show="challenge.isPrivate")
img(src=require("../../../assets/images/ico-invite-only-prj.svg"))
span INVITE-ONLY CHALLENGE

// Only show if not data science track
p.roles
Expand Down Expand Up @@ -113,7 +119,11 @@
p Total Points

.challenge-details(ng-switch-when="DEVELOP")
dev-challenge-user-place(challenge="challenge", view="view")
dev-challenge-user-place(challenge="challenge", view="view", ng-hide="challenge.isPrivate")
.invite-only-banner(ng-show="challenge.isPrivate")
img(src=require("../../../assets/images/ico-invite-only-prj.svg"))

.challenge-details(ng-switch-when="DESIGN")
design-challenge-user-place(challenge="challenge", view="view")
design-challenge-user-place(challenge="challenge", view="view", ng-hide="challenge.isPrivate")
.invite-only-banner(ng-show="challenge.isPrivate")
img(src=require("../../../assets/images/ico-invite-only-prj.svg"))
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,18 @@
p.place.completed(ng-show="challenge.userStatus === 'COMPLETED'") COMPLETED

.thumbnail(ng-click="!challenge.isPrivate && imageURL && openLightbox()", ng-class="{hidden: challenge.userStatus !== 'PASSED_REVIEW'}")
img(ng-show="!challenge.isPrivate", ng-src="{{imageURL || require('../../../assets/images/card-bg-no-image.svg')}}", fallback-src=require("../../../assets/images/card-bg-no-image.svg"))
img(ng-show="challenge.isPrivate", src=require("../../../assets/images/card-bg-private-project.svg"))
img(ng-show="challenge.submissionViewable && imageURL", ng-src="{{imageURL}}")
img(ng-show="challenge.submissionViewable && !imageURL", ng-src="../../../assets/images/card-bg-no-image.svg")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add require statement here, so Webpack can handle the dependency on the image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching it. :)

.private-challenge-banner(ng-show="!challenge.submissionViewable")
img(src=require("../../../assets/images/ico-private-prj.svg"))
span PRIVATE CHALLENGE

.thumbnail-gallery(ng-show="numImages", ng-click="!challenge.isPrivate && imageURL && openLightbox()")
.gallery-icon

.num-images {{numImages}} IMAGES
.num-images
span(ng-show="challenge.submissionViewable") {{numImages}} IMAGES
span(ng-show="!challenge.submissionViewable") No image is visible

.list-view(ng-show="view === 'list'")
.place-date
Expand All @@ -21,14 +26,18 @@
p.place.completed(ng-show="challenge.userStatus === 'COMPLETED'") COMPLETED
p.date-completed {{challenge.submissionEndDate | date : 'MMMM yyyy'}}

.winner-ribbon(ng-show="challenge.wonFirst")
.winner-ribbon(ng-show="challenge.wonFirst && !challenge.isPrivate")


.thumbnail(ng-click="!challenge.isPrivate && imageURL && openLightbox()", ng-class="{hidden: challenge.userStatus !== 'PASSED_REVIEW'}")
img(ng-show="!challenge.isPrivate", ng-src="{{imageURL || require('../../../assets/images/card-bg-no-image.svg')}}", fallback-src=require("../../../assets/images/ico-picture.svg"))
img(ng-show="challenge.isPrivate", src=require("../../../assets/images/card-bg-private-project.svg"))
img(ng-show="challenge.submissionViewable && imageURL", ng-src="{{imageURL}}")
img(ng-show="challenge.submissionViewable && !imageURL", ng-src="../../../assets/images/card-bg-no-image.svg")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here too

.private-challenge-banner(ng-show="!challenge.submissionViewable")
img(src=require("../../../assets/images/ico-private-prj.svg"))

.thumbnail-gallery(ng-show="numImages", ng-click="!challenge.isPrivate && imageURL && openLightbox()")
.gallery-icon

.num-images {{numImages}} IMAGES
.num-images
span(ng-show="challenge.submissionViewable") {{numImages}} IMAGES
span(ng-show="!challenge.submissionViewable") No image is visible
2 changes: 2 additions & 0 deletions app/services/challenge.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@ import moment from 'moment'
if (!challenge.userHasSubmitterRole) {
challenge.userStatus = 'COMPLETED'
}
// FIXME, replace with field from response
challenge.submissionViewable = !challenge.isPrivate
}
})
}
Expand Down
46 changes: 46 additions & 0 deletions assets/css/directives/challenge-tile.scss
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,52 @@ challenge-tile .challenge.tile-view {
flex: 2;
}

.private-challenge-banner {
width: 100%;
background-color: $gray-darkest;
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;

img {
width: auto;
}

span {
@include font-with-weight('Sofia Pro', 300);
font-size: 12px;
line-height: 16px;
text-transform: uppercase;
color: $gray-dark;
margin-top: 20px;
}
}

.invite-only-banner {
width: 100%;
background-color: $gray-darkest;
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;

img {
width: auto;
}

span {
@include font-with-weight('Sofia Pro', 300);
font-size: 12px;
line-height: 16px;
text-transform: uppercase;
color: $gray-dark;
margin-top: 20px;
}
}

// roles bar is common for both active and completed
.roles {
width: 100%;
Expand Down
2 changes: 2 additions & 0 deletions assets/css/directives/design-challenge-user-place.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ design-challenge-user-place {
width: 268px;
height: 200px;
overflow: hidden;
display: flex;
flex-direction: column;

img {
width: 100%;
Expand Down
13 changes: 13 additions & 0 deletions assets/images/ico-invite-only-prj.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions assets/images/ico-private-prj.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.