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

Commit 0ac2fda

Browse files
committed
Merge pull request #57 from appirio-tech/tom-add-challenge-tiles
Added tiles to develop page
2 parents 446c7ab + f9a9a6c commit 0ac2fda

File tree

3 files changed

+36
-4
lines changed

3 files changed

+36
-4
lines changed

app/profile/develop/develop.controller.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@
44
.module('tc.profile')
55
.controller('ProfileDevelopController', ProfileDevelopController);
66

7-
ProfileDevelopController.$inject = ['$scope', 'ProfileService', '$q', '$stateParams'];
7+
ProfileDevelopController.$inject = ['$scope', 'ProfileService', '$q', '$stateParams', 'ChallengeService', 'CONSTANTS'];
88

9-
function ProfileDevelopController($scope, ProfileService, $q, $stateParams) {
9+
function ProfileDevelopController($scope, ProfileService, $q, $stateParams, ChallengeService, CONSTANTS) {
1010
var vm = this;
1111
vm.subTrack = $stateParams.subTrack;
12-
// vm.profile = {};
12+
vm.viewing = 'stats';
13+
vm.domain = CONSTANTS.domain;
14+
vm.challenges = [];
15+
vm.profile = {};
1316

1417
activate();
1518

@@ -19,6 +22,11 @@
1922
vm.deferred = $q.defer();
2023
vm.deferred.promise.then(function() {
2124
vm.typeStats = ProfileService.getChallengeTypeStats(vm.stats, 'develop', vm.subTrack.toLowerCase().replace(/ /g, ''));
25+
ChallengeService.getChallenges({
26+
filter: 'userId=' + vm.profile.userId
27+
}).then(function(data) {
28+
vm.challenges = data;
29+
});
2230
});
2331
}
2432

app/profile/develop/develop.jade

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,15 @@
2424
.value {{vm.typeStats.reliability | percentage}}
2525
.name RELIABILITY
2626

27-
.stats
27+
.buttons
28+
button(ng-click="vm.viewing = 'challenges'") Challenges
29+
button(ng-click="vm.viewing = 'stats'") Stats
30+
31+
.challenges(ng-show="vm.viewing == 'challenges'")
32+
.challenge.tile(ng-repeat="challenge in vm.challenges")
33+
challenge-tile(challenge="challenge", domain="vm.domain")
34+
35+
.stats(ng-show="vm.viewing == 'stats'")
2836
h2.detailed Detailed Stats
2937

3038
ul.vertical-stats

assets/css/profile/develop.scss

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,21 @@
1818
}
1919
}
2020
}
21+
22+
.buttons {
23+
display: flex;
24+
flex-direction: row;
25+
justify-content: center;
26+
margin: 30px 0;
27+
button {
28+
width: 100px;
29+
}
30+
}
31+
32+
.challenges {
33+
display: flex;
34+
flex-direction: row;
35+
flex-wrap: wrap;
36+
}
2137

2238
}

0 commit comments

Comments
 (0)