This repository was archived by the owner on Mar 4, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 9 files changed +56
-34
lines changed Expand file tree Collapse file tree 9 files changed +56
-34
lines changed Original file line number Diff line number Diff line change 59
59
60
60
div( ng-switch-when ="MARATHON_MATCH" )
61
61
.marathon-score
62
- p.score {{challenge.pointTotal} }
62
+ p.score {{challenge.pointTotal || 0 }
63
63
64
64
p Total Points
65
65
Original file line number Diff line number Diff line change 1
1
.profile-widget-directive
2
2
a( ui-sref ="profile.about({userHandle: profile.handle})" )
3
- img.profile-circle ( fallback-src ="/images/avatarPlaceholder.png" , ng-src ="{{profile.photoURL}}" )
3
+ img.profile-circle ( ng-if ="profile.photoURL" , ng-src ="{{profile.photoURL}}" )
4
+ img.profile-circle ( ng-if ="!profile.photoURL" , src ="/images/ico-user-default.svg" )
4
5
5
6
.info
6
7
h1.handle {{profile.handle}}
Original file line number Diff line number Diff line change 43
43
.challenges ( ng-hide ="vm.subTrack === 'SRM'" )
44
44
.challenge.tile ( ng-repeat ="challenge in vm.challenges" )
45
45
challenge-tile( challenge ="challenge" , domain ="vm.domain" , view ="'tile'" )
46
- .div ( ng-show ="!vm.challenges || vm.challenges.length == 0" )
47
- | No past challenges available for this user
46
+ .no-challenges ( ng-show ="!vm.challenges || vm.challenges.length == 0" )
47
+ | Sorry, no successful challenges found.
48
48
49
49
.challenges ( ng-show ="vm.subTrack == 'SRM'" )
50
50
.challenge.tile ( ng-repeat ="challenge in vm.challenges" )
51
51
srm-tile( srm ="challenge" , domain ="vm.domain" , view ="'tile'" )
52
- .div ( ng-show ="!vm.challenges || vm.challenges.length == 0" )
53
- | No past SRMs available for this user
52
+ .no-challenges ( ng-show ="!vm.challenges || vm.challenges.length == 0" )
53
+ | Sorry, no rated SRMs found.
54
54
55
55
.stats ( ng-show ="vm.viewing == 'stats' && profileVm.status.stats === 'ready'" )
56
56
.graphs ()
Original file line number Diff line number Diff line change 9
9
.value {{vm.typeStats.wins}}
10
10
.name CHALLENGES
11
11
12
+ .tabs
13
+ a.left ( id ="stats" , ng-click ="vm.viewing = 'stats'" ,
14
+ ng-class ="vm.viewing == 'stats' ? 'selected' : ''"
15
+ ) Statistics
16
+
17
+ a.right ( id ="challenges" , ng-click ="vm.viewing = 'challenges'" ,
18
+ ng-class ="vm.viewing == 'challenges' ? 'selected' : ''"
19
+ ) Challenges
20
+
21
+ hr
22
+
12
23
tc-section(
13
24
ng-show ="vm.viewing == 'challenges'" ,
14
25
state ="vm.status.challenges"
18
29
.challenge.tile ( ng-repeat ="challenge in vm.challenges" )
19
30
challenge-tile( challenge ="challenge" , domain ="vm.domain" , view ="'tile'" )
20
31
21
- .div ( ng-show ="!vm.challenges || vm.challenges.length == 0" )
22
- | No past challenges available for this user
32
+ .no-challenges ( ng-show ="!vm.challenges || vm.challenges.length == 0" )
33
+ | Sorry, no successful challenges found.
23
34
24
35
.bottom ( ng-show ="vm.viewing == 'stats'" )
25
36
h2.detailed Detailed Stats
Original file line number Diff line number Diff line change 45
45
.challenges
46
46
.challenge.tile ( ng-repeat ="challenge in vm.challenges" )
47
47
challenge-tile( challenge ="challenge" , domain ="vm.domain" , view ="'tile'" )
48
- .div ( ng-show ="!vm.challenges || vm.challenges.length == 0" )
49
- | no past challenges available for this user
48
+ .no-challenges ( ng-show ="!vm.challenges || vm.challenges.length == 0" )
49
+ | Sorry, no successful challenges found.
50
50
51
51
.stats ( ng-show ="vm.viewing == 'stats' && profileVm.status.stats === 'ready'" )
52
52
.graphs
Original file line number Diff line number Diff line change 31
31
return api . one ( 'members' , handle . toLowerCase ( ) ) . all ( 'challenges' ) . getList ( params ) ;
32
32
}
33
33
34
- function getUserMarathonMatches ( handle , params ) {
35
- return api . one ( 'members' , handle . toLowerCase ( ) ) . all ( 'mms' ) . getList ( params ) ;
34
+ function getUserMarathonMatches ( handle , params , filterUnRated ) {
35
+ filterUnRated = filterUnRated || true ;
36
+ return api . one ( 'members' , handle . toLowerCase ( ) ) . all ( 'mms' ) . getList ( params )
37
+ . then ( function ( mms ) {
38
+ if ( filterUnRated ) {
39
+ mms = _ . filter ( mms , function ( m ) {
40
+ return _ . isArray ( m . rounds ) && m . rounds . length && ! _ . isUndefined ( m . rounds [ 0 ] . userMMDetails ) && m . rounds [ 0 ] . userMMDetails . rated ;
41
+ } ) ;
42
+ }
43
+ return mms ;
44
+ } ) ;
36
45
}
37
46
38
47
function getReviewEndDate ( challengeId ) {
Original file line number Diff line number Diff line change 20
20
return api . all ( 'srms' ) . getList ( params ) ;
21
21
}
22
22
23
- function getPastSRMs ( userHandle , params ) {
24
- return api . one ( 'members' , userHandle ) . all ( 'srms' ) . getList ( params )
25
- . then ( function ( srms ) {
26
- // var resultParams = {
27
- // filter: 'userId=' + userId
28
- // };
29
- // return getSRMResults(resultParams).then(function(results) {
30
- // var resultsMap = [];
31
- // angular.forEach(results, function(result) {
32
- // resultsMap[result['contestId']] = result;
33
- // });
34
- // angular.forEach(srms, function(srm) {
35
- // if (resultsMap[srm.id]) {
36
- // srm.result = resultsMap[srm.id];
37
- // }
38
- // });
39
- return srms ;
40
- } ) ;
23
+ function getPastSRMs ( userHandle , params , filterUnRated ) {
24
+ filterUnRated = filterUnRated || true ;
25
+ return api . one ( 'members' , userHandle ) . all ( 'srms' ) . getList ( params ) . then ( function ( srms ) {
26
+ // filter un rated SRMs
27
+ if ( filterUnRated ) {
28
+ srms = _ . filter ( srms , function ( s ) {
29
+ return _ . isArray ( s . rounds ) && s . rounds . length && ! _ . isUndefined ( s . rounds [ 0 ] . userSRMDetails ) && s . rounds [ 0 ] . userSRMDetails . rated ;
30
+ } ) ;
31
+ }
32
+ return srms ;
33
+ } ) ;
41
34
}
42
35
36
+ // NOT Used deprecate
43
37
function getSRMResults ( params ) {
44
38
return api . all ( 'srmResults' ) . getList ( params ) ;
45
39
}
Original file line number Diff line number Diff line change 65
65
if ( skill ) {
66
66
var skillTagId = _ . get ( skill , 'originalObject.id' ) . toString ( ) ;
67
67
// verify if skill has already been added
68
- var idx = _ . find ( vm . skills , function ( s ) { return s . tagId === skillTagId } ) ;
69
- if ( idx < 0 ) {
68
+ var idx = _ . find ( vm . skills , function ( s ) { return s . tagId == skillTagId } ) ;
69
+ // _.find returns undefined when skill isn't found
70
+ if ( ! idx ) {
70
71
// add the skill
71
72
ProfileService . addUserSkill ( vm . userData . handle , skillTagId ) . then ( function ( resp ) {
72
73
// find the new skill in response object and inject it into our existing list.
Original file line number Diff line number Diff line change 3
3
.profile-subtrack-container {
4
4
display : flex ;
5
5
flex-direction : column ;
6
-
6
+
7
7
.nav {
8
8
@include module-full-width ;
9
9
background : white ;
291
291
width : 325px ;
292
292
padding : 15px ;
293
293
}
294
+ .no-challenges {
295
+ margin : 30px ;
296
+ @include sofia-pro-regular ;
297
+ font-size : 16px ;
298
+ color : #a3a3ae ;
299
+ }
294
300
}
295
301
296
302
}
297
303
}
298
304
@media (min-width : 768px ) {
299
305
.profile-subtrack-container {
300
-
306
+
301
307
.nav {
302
308
display : flex ;
303
309
flex-direction : row ;
You can’t perform that action at this time.
0 commit comments