This repository was archived by the owner on Mar 4, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 7 files changed +63
-44
lines changed Expand file tree Collapse file tree 7 files changed +63
-44
lines changed Original file line number Diff line number Diff line change 13
13
var vm = this ;
14
14
vm . domain = CONSTANTS . domain ;
15
15
vm . defaultPhotoUrl = "/images/avatarPlaceholder.png" ;
16
- vm . isCopilot = true ;
16
+ vm . isCopilot = false ;
17
17
vm . loading = true ;
18
+ vm . hasRatings = true ;
18
19
19
20
activate ( ) ;
20
21
26
27
vm . profile = profile ;
27
28
} ) ;
28
29
29
- ProfileService . getUserStats ( username ) . then ( function ( stats ) {
30
+ ProfileService . getUserStats ( username )
31
+ . then ( function ( stats ) {
30
32
vm . rankStats = ProfileService . getRanks ( stats ) ;
33
+
34
+ if ( vm . rankStats . length === 0 ) {
35
+ vm . hasRatings = false ;
36
+ }
37
+
31
38
vm . loading = false ;
32
- } ) . catch ( function ( err ) {
39
+ } )
40
+ . catch ( function ( err ) {
41
+ vm . hasRatings = false ;
33
42
vm . loading = false ;
34
43
// todo handle error
35
44
} )
36
45
37
- ProfileService . getUserFinancials ( username ) . then ( function ( financials ) {
46
+ ProfileService . getUserFinancials ( username )
47
+ . then ( function ( financials ) {
38
48
vm . moneyEarned = financials . overallEarning ;
39
49
} ) ;
40
50
Original file line number Diff line number Diff line change 8
8
//- a(ng-href="http://community.{{vm.domain}}/tc?module=MyHome") Edit Profile
9
9
10
10
profile-widget( profile ="vm.profile" , edit-profile-link ="true" )
11
-
11
+
12
12
.user-stats
13
13
.money-earned
14
14
p( ng-bind ='vm.moneyEarned || 0 | currency:undefined:0' )
@@ -22,13 +22,16 @@ header
22
22
23
23
hr
24
24
25
- .section-loading ( ng-show ="vm.loading" )
25
+ .loading ( ng-show ="vm.loading" )
26
+ .section-loading
27
+
28
+ hr
26
29
27
- .ratings ( ng-hide = " vm.loading")
30
+ .ratings ( ng-if = "vm.hasRatings && ! vm.loading")
28
31
.track ( ng-repeat ="r in vm.rankStats" )
29
32
p( ng-bind ="r.rank" )
30
33
31
34
p {{r.track}}:
32
35
p {{r.subTrack}}
33
36
34
- hr
37
+ hr
Original file line number Diff line number Diff line change 11
11
vm . loading = true ;
12
12
vm . myChallenges = [ ] ;
13
13
14
+ // Can we remove these since the filter is going on a different page?
14
15
vm . viewActiveChallenges = viewActiveChallenges ;
15
16
vm . viewPastChallenges = viewPastChallenges ;
16
17
17
- var activate = function ( ) {
18
+ var userId = UserService . getUserIdentity ( ) . userId ;
19
+
20
+ activate ( ) ;
21
+
22
+ function activate ( ) {
18
23
viewActiveChallenges ( ) ;
19
24
}
20
25
21
- var userId = UserService . getUserIdentity ( ) . userId ;
26
+ function viewActiveChallenges ( ) {
27
+ vm . myChallenges = [ ] ;
28
+ getChallenges ( 'Active' , 'submissionEndDate asc' ) ;
29
+ } ;
30
+
31
+ function viewPastChallenges ( ) {
32
+ vm . myChallenges = [ ] ;
33
+ getChallenges ( 'Completed' , 'submissionEndDate asc' ) ;
34
+ } ;
22
35
23
36
// get ACTIVE challenges and spotlight challenges
24
- var getChallenges = function ( status , orderBy ) {
37
+ function getChallenges ( status , orderBy ) {
25
38
vm . loading = true ;
26
39
var challengeOptions = {
27
40
limit : 6 ,
57
70
} ) ;
58
71
}
59
72
60
- function viewActiveChallenges ( ) {
61
- vm . myChallenges = [ ] ;
62
- getChallenges ( 'Active' , 'submissionEndDate asc' ) ;
63
- } ;
64
-
65
- function viewPastChallenges ( ) {
66
- vm . myChallenges = [ ] ;
67
- getChallenges ( 'Completed' , 'submissionEndDate asc' ) ;
68
- } ;
69
-
70
- activate ( ) ;
71
-
72
73
function processChallengesResponse ( data ) {
73
74
angular . forEach ( data , function ( challenge ) {
74
75
var now = moment ( ) ;
Original file line number Diff line number Diff line change 9
9
section.challenges ( ng-hide ="vm.loading" )
10
10
challenge-tile.tile ( ng-repeat ="challenge in vm.myChallenges" , challenge ="challenge" , domain ="vm.domain" )
11
11
12
- challenge-tile.tile.spotlight ( challenge ="vm.spotlightChallenge" , domain ="vm.domain" , spotlight )
12
+ challenge-tile.tile.spotlight ( spotlight , challenge ="vm.spotlightChallenge" , domain ="vm.domain" )
13
13
14
14
.section-links
15
15
.new-challenges.link
Original file line number Diff line number Diff line change 1
1
@import ' ../partials/combined' ;
2
2
3
+ // Default Challenge Tile Stylings
3
4
.tile {
4
5
background-color : $medium-gray ;
5
6
box-sizing : border-box ;
99
100
}
100
101
}
101
102
}
103
+
104
+ // Stylings for Spotlight Challenges
105
+ .spotlight {
106
+ width : 48% ;
107
+
108
+ .placeholder {
109
+ font-size : 22px ;
110
+ color : $dark-gray ;
111
+ text-align : center ;
112
+ margin-top : 30px ;
113
+ }
114
+
115
+ .challenge-status {
116
+ display : flex ;
117
+ flex-direction : row ;
118
+ justify-content : space-between ;
119
+ padding-top : 50px ;
120
+ }
121
+ }
Original file line number Diff line number Diff line change 70
70
}
71
71
}
72
72
73
+ .loading {
74
+ margin-top : -20px ;
75
+ }
76
+
73
77
.ratings {
74
78
display : flex ;
75
79
flex-flow : row wrap ;
76
80
justify-content : center ;
77
- margin-bottom : 27px ;
78
81
font-size : 13px ;
79
82
80
83
.track {
81
84
width : 120px ;
85
+ margin-bottom : 20px ;
82
86
text-align : center ;
83
87
84
88
p :first-child {
Original file line number Diff line number Diff line change @@ -34,24 +34,5 @@ $url_10: url(../images/sort-arrows.png);
34
34
/* The negative margin here removes the leftmost tiles'
35
35
margin, since we can't use .tile:first-child here */
36
36
margin-left : -20px ;
37
-
38
- .spotlight {
39
- width : 48% ;
40
-
41
- .placeholder {
42
- font-size : 22px ;
43
- color : $dark-gray ;
44
- text-align : center ;
45
- margin-top : 15px ;
46
- margin-bottom : 15px ;
47
- }
48
-
49
- .challenge-status {
50
- display : flex ;
51
- flex-direction : row ;
52
- justify-content : space-between ;
53
- padding-top : 50px ;
54
- }
55
- }
56
37
}
57
38
}
You can’t perform that action at this time.
0 commit comments