diff --git a/app/directives/challenge-tiles/challenge-tile.directive.jade b/app/directives/challenge-tile/challenge-tile.directive.jade similarity index 100% rename from app/directives/challenge-tiles/challenge-tile.directive.jade rename to app/directives/challenge-tile/challenge-tile.directive.jade diff --git a/app/directives/challenge-tiles/challenge-tile.directive.js b/app/directives/challenge-tile/challenge-tile.directive.js similarity index 70% rename from app/directives/challenge-tiles/challenge-tile.directive.js rename to app/directives/challenge-tile/challenge-tile.directive.js index b5aefe09f..9e3525248 100644 --- a/app/directives/challenge-tiles/challenge-tile.directive.js +++ b/app/directives/challenge-tile/challenge-tile.directive.js @@ -6,13 +6,7 @@ function challengeTile() { return { restrict: 'E', - templateUrl: function(elem, attrs) { - if (attrs.spotlight) { - return 'directives/challenge-tiles/spotlight-tile.directive.html'; - } - - return 'directives/challenge-tiles/challenge-tile.directive.html'; - }, + templateUrl: 'directives/challenge-tile/challenge-tile.directive.html', scope: { challenge: '=', view: '=' @@ -23,9 +17,7 @@ activate(); function activate() { - if (!$attrs.spotlight) { - processChallenge($scope.challenge); - } + processChallenge($scope.challenge); } function processChallenge(challenge) { diff --git a/app/directives/challenge-tiles/challenge-tile.spec.js b/app/directives/challenge-tile/challenge-tile.spec.js similarity index 100% rename from app/directives/challenge-tiles/challenge-tile.spec.js rename to app/directives/challenge-tile/challenge-tile.spec.js diff --git a/app/directives/challenge-tiles/spotlight-tile.directive.jade b/app/directives/challenge-tiles/spotlight-tile.directive.jade deleted file mode 100644 index 4bbe9c03a..000000000 --- a/app/directives/challenge-tiles/spotlight-tile.directive.jade +++ /dev/null @@ -1,24 +0,0 @@ -.challenge.tile-view - .challenge-name - a(ng-href="https://www.{{domain}}/challenge-details/{{challenge.challengeId}}/?type={{challenge.track}}") {{challenge.challengeName}} - - .challenge-details - .challenge-icons - img(ng-show="challenge.track === 'DEVELOP'", src="/images/member-program/svg/development-generic.svg") - img(ng-show="challenge.track === 'DESIGN' || challenge.track === 'Data Science'", src="/images/member-program/svg/design-generic.svg") - - p.placeholder Spotlight Challenge - - .challenge-status - .challenge-info - p.prize {{challenge.totalPrize | currency:undefined:0}} - - p.registrationDate Registration ends 8/08/15 - - .stats - .registrants(ng-show="challenge.numRegistrants > 0") - i.fa.fa-user - span {{challenge.numRegistrants}} - .submissions(ng-show="challenge.numSubmissions > 0") - i.fa.fa-files-o - span {{challenge.numSubmissions}} diff --git a/app/directives/ios-card/ios-card.directive.jade b/app/directives/ios-card/ios-card.directive.jade new file mode 100644 index 000000000..43d6b2b2d --- /dev/null +++ b/app/directives/ios-card/ios-card.directive.jade @@ -0,0 +1,38 @@ +.challenge.tile-view(ng-show="view === 'tile'", ng-class="challenge.track") + .challenge-track + + header + a(ng-href="https://www.{{DOMAIN}}/challenge-details/{{challenge.id}}/?type={{challenge.track}}") {{challenge.name}} + + p #[span iOS] {{challenge.track}} + + .challenge-details + p.prize-money(ng-show="challenge.reviewType === 'PEER'") Peer Review Challenge + + p.prize-money(ng-hide="challenge.reviewType === 'PEER'") {{challenge.totalCheckpointPrize || 0 | currency:undefined:0}} + + p.technologies {{challenge.technologies}} + + .challenge-calendar + p.starts-in Starts In + p.time-remaining 3 + p.unit-of-time days + + button.phase-action(ng-class="{'action-completed': challenge.currentPhaseActionCompleted}") Submit + + .challenge-links + .stats + a.registrants(ng-href="https://www.{{DOMAIN}}/challenge-details/{{challenge.id}}/?type={{challenge.track}}#viewRegistrant") + .registrants-icon + + p {{challenge.numRegistrants}} + + a.submissions(ng-href="https://www.{{DOMAIN}}/challenge-details/{{challenge.id}}/?type={{challenge.track}}#viewRegistrant") + .submissions-icon + + p {{challenge.numSubmissions}} + + a.forum(ng-href="http://apps.{{DOMAIN}}/forums//?module=Category&categoryID={{challenge.forumId}}") + .forum-icon + + p Posts diff --git a/app/directives/ios-card/ios-card.directive.js b/app/directives/ios-card/ios-card.directive.js new file mode 100644 index 000000000..a12eb808c --- /dev/null +++ b/app/directives/ios-card/ios-card.directive.js @@ -0,0 +1,16 @@ +(function() { + 'use strict'; + angular.module('tcUIComponents').directive('iosCard', function() { + return { + restrict: 'E', + templateUrl: 'directives/ios-card/ios-card.directive.html', + scope: { + challenge: '=challenge', + view: '=' + }, + controller: ['$scope', 'CONSTANTS', function($scope, CONSTANTS) { + $scope.DOMAIN = CONSTANTS.domain; + }] + }; + }); +})(); diff --git a/app/index.jade b/app/index.jade index 8938f4615..36ebbe8ba 100644 --- a/app/index.jade +++ b/app/index.jade @@ -60,11 +60,12 @@ html link(rel="stylesheet", href="assets/css/directives/srm-tile.css") link(rel="stylesheet", href="assets/css/directives/skill-tile.css") link(rel="stylesheet", href="assets/css/directives/profile-widget.css") + link(rel="stylesheet", href="assets/css/directives/ios-card.css") link(rel="stylesheet", href="assets/css/directives/history-graph.css") link(rel="stylesheet", href="assets/css/directives/external-link-data.css") link(rel="stylesheet", href="assets/css/directives/external-account.css") link(rel="stylesheet", href="assets/css/directives/distribution-graph.css") - link(rel="stylesheet", href="assets/css/directives/challenge-tiles.css") + link(rel="stylesheet", href="assets/css/directives/challenge-tile.css") link(rel="stylesheet", href="assets/css/directives/badge-tooltip.css") link(rel="stylesheet", href="assets/css/account/reset-password.css") link(rel="stylesheet", href="assets/css/account/register.css") @@ -137,11 +138,12 @@ html script(src="directives/account/validate-email.directive.js") script(src="directives/account/validate-register.directive.js") script(src="directives/badges/badge-tooltip.directive.js") - script(src="directives/challenge-tiles/challenge-tile.directive.js") + script(src="directives/challenge-tile/challenge-tile.directive.js") script(src="directives/distribution-graph/distribution-graph.directive.js") script(src="directives/external-account/external-account.directive.js") script(src="directives/focus-on.directive.js") script(src="directives/history-graph/history-graph.directive.js") + script(src="directives/ios-card/ios-card.directive.js") script(src="directives/on-file-change.directive.js") script(src="directives/profile-widget/profile-widget.directive.js") script(src="directives/right-placeholder.directive.js") diff --git a/app/my-dashboard/programs/programs.controller.js b/app/my-dashboard/programs/programs.controller.js index e85d166e7..8ca5d1e54 100644 --- a/app/my-dashboard/programs/programs.controller.js +++ b/app/my-dashboard/programs/programs.controller.js @@ -8,10 +8,11 @@ 'MemberCertService', 'CONSTANTS', '$log', - 'ChallengeService' + 'ChallengeService', + '$q' ]; - function ProgramsController (UserService, MemberCertService, CONSTANTS, $log, ChallengeService) { + function ProgramsController (UserService, MemberCertService, CONSTANTS, $log, ChallengeService, $q) { var vm = this; vm.domain = CONSTANTS.domain; vm.registered = false; @@ -54,15 +55,33 @@ } function loadChallenges() { - return ChallengeService.getiOSChallenges() + var challengePromises = [ + ChallengeService.getiOSChallenges({ + filter: "reviewType=peer&status=active", + limit: 3, + offset: 0, + orderBy: 'submissionEndDate' + }), + ChallengeService.getiOSChallenges({ + filter: "technologies=ios,swift&status=active", + limit: 3, + offset: 0, + orderBy: 'submissionEndDate' + }) + ]; + + return $q.all(challengePromises) .then(function(challenges) { - // When filtering by reviewType is fixed on the backend, - // we can show both types of challenges. For now, it's showing internal - // challenges + var peerChallenges = challenges[0]; + var iOSChallenges = challenges[1]; + var challenges = []; + + if (peerChallenges.length === 0) { + challenges = challenges.concat(iOSChallenges); + } else if (peerChallenges.length > 0) { + challenges = challenges.concat(peerChallenges[0]).concat(iOSChallenges.slice(0, iOSChallenges.length - 1)); + } - // var peerChallenges = challenges[0]; - // var iOSChallenges = challenges[1]; - // vm.challenges = [peerChallenges[0], iOSChallenges[0], iOSChallenges[1]]; vm.challenges = challenges; vm.loading = false; }) diff --git a/app/my-dashboard/programs/programs.jade b/app/my-dashboard/programs/programs.jade index 679e5f173..713bc0276 100644 --- a/app/my-dashboard/programs/programs.jade +++ b/app/my-dashboard/programs/programs.jade @@ -1,3 +1,6 @@ +header(ng-hide="vm.loading") + h1.section-title #[span iOS]: Show Your Skills + .section-loading(ng-show="vm.loading") section.ios(ng-hide="vm.loading") @@ -17,34 +20,14 @@ section.ios(ng-hide="vm.loading") //- p Join Us .registered(ng-show="vm.registered") - h1.section-title #[span iOS]: Show Your Skills - - .registered-badge - i.fa.fa-apple.fa-3x - - img(src="/images/member-program/svg/Member-06.svg", alt="Development Challenge Icon") - - p Badge 1 Achieved - - a(href="http://ios.{{vm.domain}}", title="topcoder iOS Member Program") View Challenges - - .challenge(ng-repeat="challenge in vm.challenges | orderBy:reviewType:true| orderBy:registrationEndDate:true") - p.title {{challenge.challengeName}} - - i.fa.fa-apple.fa-3x - - p.technologies Technologies: {{challenge.technologies}} - - p.prize(ng-class="{hidden: challenge.reviewType === 'PEER'}") {{challenge.totalPrize | currency:undefined:0}} - - p.days-remaining {{challenge.registrationEndDate | timeDiff}} - span Registration Ends + .badge-and-challenges + .registered-badge + .flex-wrapper + p iOS DEVELOPER - .stats - i.fa.fa-user - span {{challenge.numRegistrants}} + .badge-timeline + img(src="/images/member-program/svg/Member-06.svg", alt="Development Challenge Icon") - i.fa.fa-files-o - span {{challenge.numSubmissions}} + a(href="http://ios.{{vm.domain}}", title="topcoder iOS Member Program") View Challenges - a(ng-href="https://www.{{vm.domain}}/challenge-details/{{challenge.challengeId}}/?type=develop", title="Go to challenge") Register Now! + ios-card(ng-repeat="challenge in vm.challenges | orderBy:reviewType:true| orderBy:registrationEndDate:true", challenge="challenge", view="'tile'") diff --git a/app/services/challenge.service.js b/app/services/challenge.service.js index f97ddb934..09dbf7974 100644 --- a/app/services/challenge.service.js +++ b/app/services/challenge.service.js @@ -60,14 +60,8 @@ return deferred.promise; } - function getiOSChallenges() { - var iOSParams = { - filter: "technologies=ios&status=active", - limit: 3, - offset: 0, - orderBy: 'submissionEndDate' - }; - return api.all('challenges').getList(iOSParams); + function getiOSChallenges(params) { + return api.all('challenges').getList(params); } /** NOT USED NEEDS TO BE REFACTORED **/ diff --git a/assets/css/directives/challenge-tiles.scss b/assets/css/directives/challenge-tile.scss similarity index 97% rename from assets/css/directives/challenge-tiles.scss rename to assets/css/directives/challenge-tile.scss index d8816c287..f0f100279 100644 --- a/assets/css/directives/challenge-tiles.scss +++ b/assets/css/directives/challenge-tile.scss @@ -43,15 +43,6 @@ } } - // .thumbnail { - // display: flex; - // flex-direction: row; - // justify-content: center; - // margin: 20px 0; - // img { - // } - // } - .challenge-details { display: flex; flex-direction: column; diff --git a/assets/css/directives/ios-card.scss b/assets/css/directives/ios-card.scss new file mode 100644 index 000000000..ffdd9b68c --- /dev/null +++ b/assets/css/directives/ios-card.scss @@ -0,0 +1,202 @@ +@import '../partials/combined'; + +// Default Challenge Tile Stylings +.challenge.tile-view { + position: relative; + width: 270px; + border: 1px solid #DCDCDC; + border-radius: 4px; + background-color: $white; + + .challenge-track { + width: 5px; + height: 52px; + position: absolute; + top: -1px; + left: -1px; + border-top-left-radius: 4px; + } + + header { + padding: 0 20px; + height: 52px; + border-bottom: 1px solid #F0F0F0; + + a { + display: block; + width: 210px; + padding-top: 8px; + padding-bottom: 5px; + @include sofia-pro-medium; + font-size: 14px; + line-height: 18px; + color: #3D3D3D; + text-decoration: none; + @include ellipsis; + } + + p { + @include sofia-pro-light; + font-size: 11px; + line-height: 13px; + text-transform: uppercase; + + span { + text-transform: none; + } + } + } + + .challenge-details { + display: flex; + flex-direction: column; + align-items: center; + } + + .prize-money { + margin-top: 40px; + margin-bottom: 10px; + @include sofia-pro-light; + font-size: 20px; + line-height: 24px; + } + + .technologies { + @include source-sans-regular; + font-size: 13px; + line-height: 18px; + margin-bottom: 40px; + } + + .challenge-calendar { + display: flex; + flex-direction: column; + align-items: center; + width: 75px; + height: 63px; + margin-bottom: 20px; + background-image: url(/images/ico-calendar.svg); + + > p { + @include sofia-pro-bold; + } + + .starts-in { + margin-top: 3px; + font-size: 10px; + line-height: 13px; + text-transform: uppercase; + color: #7F7F7F; + } + + .time-remaining { + margin-top: 5px; + font-size: 24px; + color: #3D3D3D; + } + + .unit-of-time { + margin-top: 1px; + font-size: 10px; + text-transform: lowercase; + color: #7F7F7F; + } + } + + .phase-action { + margin-bottom: 25px; + @include button-m-wide; + } + + .roles { + min-height: 36px; + margin-bottom: 25px; + color: #3D3D3D; + @include source-sans-regular; + font-size: 13px; + line-height: 18px; + } + + .challenge-links { + display: flex; + flex-direction: row; + align-items: center; + justify-content: space-between; + height: 38px; + width: 100%; + padding: 0 20px; + border-bottom-right-radius: 3px; + border-bottom-left-radius: 3px; + background-color: #FCFCFC; + + a { + text-decoration: none; + } + + .stats, .registrants, .submissions, .forum { + display: flex; + flex-direction: row; + align-items: center; + } + + .registrants, .submissions, .form { + cursor: pointer; + } + + .registrants { + margin-right: 15px; + } + + p { + @include sofia-pro-bold; + font-size: 11px; + color: #3D3D3D; + } + + .forum p { + @include sofia-pro-regular; + text-transform: uppercase; + } + } + + div[class$="-icon"] { + margin-right: 3px; + } + + .registrants-icon { + width: 15px; + height: 16px; + background-image: url(/images/ico-users.svg); + background-size: 15px 16px; + } + + .submissions-icon { + width: 22px; + height: 14px; + background-image: url(/images/ico-submissions.svg); + } + + .forum-icon { + width: 20px; + height: 17px; + background-image: url(/images/ico-posts.svg); + } +} + +// Dynamic colors based on track +.DESIGN { + .challenge-track { background-color: $accent-color; } + header p { color: $accent-color; } +} +.DEVELOP { + .challenge-track { background-color: $success-color; } + header p { color: $success-color; } +} +.DATA_SCIENCE { + .challenge-track { background-color: #F39426; } + header p { color: #F39426; } +} +.COPILOT { + .challenge-track { background-color: #7F7F7F; } + header p { color: #7F7F7F; } +} diff --git a/assets/css/my-dashboard/community-updates.scss b/assets/css/my-dashboard/community-updates.scss index 768751c77..380d8ba8b 100644 --- a/assets/css/my-dashboard/community-updates.scss +++ b/assets/css/my-dashboard/community-updates.scss @@ -22,10 +22,14 @@ } .posts { + padding-left: 10px; + padding-right: 10px; @media only screen and (min-width: 570px) { display: flex; flex-flow: row wrap; margin: 0 auto; + padding-left: 0; + padding-right: 0; width: 550px; } @media only screen and (min-width: 850px) { diff --git a/assets/css/my-dashboard/my-challenges.scss b/assets/css/my-dashboard/my-challenges.scss index e2884637e..9c118299e 100644 --- a/assets/css/my-dashboard/my-challenges.scss +++ b/assets/css/my-dashboard/my-challenges.scss @@ -5,7 +5,7 @@ margin-bottom: 27px; @media only screen and (min-width: 900px) { font-size: 28px; - margin-bottom: 60px; + margin-bottom: 30px; } } @@ -105,7 +105,7 @@ .hasChallenges { display: flex; justify-content: center; - padding: 20px 0; + padding-top: 20px; background-color: #FCFCFC; .challenges { @@ -115,6 +115,7 @@ display: flex; flex-flow: row wrap; width: 1125px; + overflow: visible; } challenge-tile { diff --git a/assets/css/my-dashboard/my-dashboard.scss b/assets/css/my-dashboard/my-dashboard.scss index 5858b290a..d79878207 100644 --- a/assets/css/my-dashboard/my-dashboard.scss +++ b/assets/css/my-dashboard/my-dashboard.scss @@ -4,12 +4,6 @@ display: flex; flex-direction: column; align-items: center; - padding-left: 10px; - padding-right: 10px; - @media only screen and (min-width: 1262px) { - padding-left: 0; - padding-right: 0; - } .subtrack-stats, .my-challenges, .srms, .programs { @include module-l; diff --git a/assets/css/my-dashboard/programs.scss b/assets/css/my-dashboard/programs.scss index f9cf30b46..b4b372690 100644 --- a/assets/css/my-dashboard/programs.scss +++ b/assets/css/my-dashboard/programs.scss @@ -1,12 +1,18 @@ @import '../partials/combined'; .programs { + padding-top: 30px; + .section-loading { min-height: 200px; } h1.section-title { - span { text-transform: none; } + margin-bottom: 30px; + + span { + text-transform: none; + } } .unregistered { @@ -106,113 +112,72 @@ .registered { display: flex; - flex-direction: row; - justify-content: space-between; - height: 350px; - - .registered-badge, .challenge { - margin-right: 25px; - background-color: #e7e7e7; + justify-content: center; + padding-top: 20px; + padding-bottom: 15px; + background-color: #FCFCFC; + + .badge-and-challenges { + width: 100%; + @include horizontal-scroll; + @media only screen and (min-width: 1125px) { + display: flex; + flex-flow: row wrap; + width: 1125px; + overflow: visible; + } } .registered-badge { - max-width: 25%; - display: flex; - flex-direction: column; - justify-content: center; - flex: 25%; - text-align: center; - - img { + display: inline-block; + height: 370px; + width: 270px; + margin-left: 15px; + margin-right: 15px; + border: 1px solid #DCDCDC; + border-radius: 4px; + background-color: $white; + @media only screen and (min-width: 1125px) { display: block; - margin: 25px auto; - width: 22%; + margin-left: 0; } - p { - margin-top: 10px; - text-transform: uppercase; - @include source-sans-bold; - font-size: 16px; - color: #727272; - } - - a { - margin-top: 10px; - text-decoration: underline; - } - } - - .challenge { - display: flex; - flex-direction: column; - text-align: center; - flex: 25%; - - &:last-child { - margin-right: 0; + .flex-wrapper { + display: flex; + flex-direction: column; + align-items: center; } p { - color: #727272; - } - - .title { - min-height: 60px; - margin-top: 10px; - @include source-sans-semi-bold; - } - - .technologies { - margin-top: 10px; - min-height: 32px; - } - - .prize { - padding-top: 10px; - min-height: 25px; + margin-top: 60px; + margin-bottom: 37px; + @include sofia-pro-light; font-size: 20px; + color: #3D3D3D; } - .hidden { - visibility: hidden; + .badge-timeline { + width: 120px; } - .days-remaining { - margin-top: 15px; - font-size: 20px; - - span { - display: block; - margin-top: 5px; - @include source-sans-semi-bold; - font-size: 12px; - text-transform: uppercase; - } + a { + display: block; + margin-top: 37px; + @include button-m-wide; + text-decoration: none; } + } - .stats { - margin-top: 15px; - font-size: 18px; - - i { - margin-right: 5px; - } - - span { - margin-right: 10px; + ios-card { + display: inline-block; + margin-right: 15px; + @media only screen and (min-width: 1125px) { + display: block; - &:last-child { - margin-right: 0; - } + &:last-child { + margin-right: 0; } } - - a { - margin-top: 20px; - font-size: 14px; - text-decoration: underline; - } } } } diff --git a/assets/css/my-dashboard/srms.scss b/assets/css/my-dashboard/srms.scss index f07fa07f4..a2a7bc4fa 100644 --- a/assets/css/my-dashboard/srms.scss +++ b/assets/css/my-dashboard/srms.scss @@ -30,6 +30,7 @@ display: flex; flex-flow: row wrap; width: 1125px; + overflow: visible; } srm-tile{