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

Integrated new challenges API w/ mock data #114

Merged
merged 5 commits into from
Aug 20, 2015
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 3 additions & 3 deletions app/directives/challenge-tiles/challenge-tile.directive.jade
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.challenge.tile-view(ng-show="view=='tile'")
.challenge-name
a(ng-href="https://www.{{DOMAIN}}/challenge-details/{{challenge.challengeId}}/?type={{challenge.track}}") {{challenge.challengeName}}
a(ng-href="https://www.{{DOMAIN}}/challenge-details/{{challenge.challengeId}}/?type={{challenge.track}}") {{challenge.name}}

.challenge-details
.challenge-icons
Expand Down Expand Up @@ -37,7 +37,7 @@
img(ng-show="challenge.track === 'DESIGN' || challenge.track === 'Data Science'", src="/images/member-program/svg/design-generic.svg")

.challenge-name
a(ng-href="https://www.{{DOMAIN}}/challenge-details/{{challenge.challengeId}}/?type={{challenge.track}}") {{challenge.challengeName}}
a(ng-href="https://www.{{DOMAIN}}/challenge-details/{{challenge.challengeId}}/?type={{challenge.track}}") {{challenge.name}}
.phase-status(ng-show="challenge.status === 'Active'")
i.fa.fa-check-circle-o

Expand All @@ -61,4 +61,4 @@

.challenge-links
a(ng-href="http://apps.{{DOMAIN}}/forums//?module=Category&categoryID={{challenge.forumId}}")
i.fa.fa-comment
i.fa.fa-comment
4 changes: 3 additions & 1 deletion app/directives/challenge-tiles/challenge-tile.directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
},
controller: ['$scope', 'CONSTANTS', '$attrs', function($scope, CONSTANTS, $attrs) {
$scope.DOMAIN = CONSTANTS.domain;
console.log('tile controller');

activate();

Expand All @@ -37,7 +38,8 @@
challenge.submissionClosed = now > submissionDate ? true : false;
challenge.registrationTimeLeft = (registrationDate - now)/(24*60*60*1000);
challenge.submissionTimeLeft = (submissionDate - now)/(24*60*60*1000);
challenge.track = challenge.track.trim();
// temporary...right now many challenges have a `null` track
challenge.track = challenge.track ? challenge.track.trim() : 'DEVELOP';

// challenge.phaseMsg = preparePhaseMessage(challenge);

Expand Down
2 changes: 2 additions & 0 deletions app/profile/profile.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@

vm.pastChallengesPromise = ChallengeService.getChallenges({filter: 'userId=' + profile.userId+"&status=completed"})
.then(function(data) {
console.log('challenges!');
console.log(data);
vm.status.pastChallenges = CONSTANTS.STATE_READY;
vm.pastChallenges = data;
return data;
Expand Down
6 changes: 4 additions & 2 deletions app/profile/subtrack/design/design.jade
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@
state="profileVm.status.pastChallenges"
)
.challenges
.challenge.tile(ng-repeat="challenge in vm.pastChallenges = (profileVm.pastChallenges | filter: {'track': vm.track, 'subTrack': vm.subTrack})")
challenge-tile(challenge="challenge", domain="vm.domain")
.challenge.tile(ng-repeat="challenge in vm.pastChallenges = (profileVm.pastChallenges)")
challenge-tile(challenge="challenge", domain="vm.domain", view="'tile'")
//.challenge.tile(ng-repeat="challenge in vm.pastChallenges = (profileVm.pastChallenges | filter: {'track': vm.track, 'subTrack': vm.subTrack})")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is only until APIs are available


.div(ng-show="!vm.pastChallenges || vm.pastChallenges.length == 0")
| No past challenges available for this user

Expand Down
4 changes: 3 additions & 1 deletion app/profile/subtrack/subtrack.controller.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
var sub;
(function () {

angular
Expand All @@ -7,7 +8,8 @@
ProfileSubtrackController.$inject = ['$scope', 'ProfileService', '$q', '$stateParams', 'ChallengeService', 'CONSTANTS', '$state', '$window'];

function ProfileSubtrackController($scope, ProfileService, $q, $stateParams, ChallengeService, CONSTANTS, $state, $window) {
var vm = this;
var vm = sub = this;
vm.scope = $scope;
vm.subTrack = decodeURIComponent($stateParams.subTrack || '') || '';
vm.track = $stateParams.track;
vm.viewing = 'challenges';
Expand Down
Loading