From e274754b3893bcd3bdf6d25b8cef8751fc9941b0 Mon Sep 17 00:00:00 2001 From: Parth Shah Date: Sat, 17 Oct 2015 10:44:22 -0700 Subject: [PATCH] stats are ordered by most recent event date --- app/my-dashboard/subtrack-stats/subtrack-stats.jade | 6 +++--- app/profile/about/about.jade | 2 +- app/services/profile.service.js | 12 ++++++++---- assets/css/my-dashboard/community-updates.scss | 2 +- assets/css/my-dashboard/programs.scss | 1 - 5 files changed, 13 insertions(+), 10 deletions(-) diff --git a/app/my-dashboard/subtrack-stats/subtrack-stats.jade b/app/my-dashboard/subtrack-stats/subtrack-stats.jade index 55b8db163..8a2835b9d 100644 --- a/app/my-dashboard/subtrack-stats/subtrack-stats.jade +++ b/app/my-dashboard/subtrack-stats/subtrack-stats.jade @@ -3,9 +3,9 @@ .ratings(ng-if="vm.hasRanks && !vm.loading") .tracks - .track(ng-repeat="subtrack in vm.subtrackRanks | orderBy: ['track', 'rank']", ui-sref="profile.subtrack({userHandle: vm.handle, track: subtrack.track, subTrack: subtrack.subTrack})") + .track(ng-repeat="subtrack in vm.subtrackRanks | orderBy:'mostRecentEventDate':true", ui-sref="profile.subtrack({userHandle: vm.handle, track: subtrack.track, subTrack: subtrack.subTrack})") .flex-wrapper - p.subtrack {{subtrack.subTrack | underscoreStrip}} + p.subtrack {{subtrack.subTrack | underscoreStrip}} p.rating(ng-if="subtrack.track !== 'DESIGN'", style="color: {{subtrack.stat | ratingColor}}") {{subtrack.stat | number}} span(style="background-color: {{subtrack.stat | ratingColor}}", ng-if="subtrack.track === 'DEVELOP' || subtrack.track === 'DATA_SCIENCE'") @@ -16,7 +16,7 @@ ul(rn-carousel, rn-carousel-controls) li(ng-repeat="subtracks in vm.subtrackRanksCollection") - .track(ng-repeat="subtrack in subtracks", ui-sref="profile.subtrack({userHandle: vm.handle, track: subtrack.track, subTrack: subtrack.subTrack})") + .track(ng-repeat="subtrack in subtracks | orderBy:'mostRecentEventDate':true", ui-sref="profile.subtrack({userHandle: vm.handle, track: subtrack.track, subTrack: subtrack.subTrack})") .flex-wrapper p.subtrack {{subtrack.subTrack | underscoreStrip}} diff --git a/app/profile/about/about.jade b/app/profile/about/about.jade index 540fda58b..6c63d668e 100644 --- a/app/profile/about/about.jade +++ b/app/profile/about/about.jade @@ -56,7 +56,7 @@ span {{track | track | uppercase}} a.subtrack( - ng-repeat="subtrack in profileVm.categories[track]", + ng-repeat="subtrack in profileVm.categories[track] | orderBy:'mostRecentEventDate':true", ui-sref="profile.subtrack({track: subtrack.track, subTrack: subtrack.subTrack})", class="{{$index == 0 && 'first'}}" ) diff --git a/app/services/profile.service.js b/app/services/profile.service.js index d62ec7af7..5fb83559b 100644 --- a/app/services/profile.service.js +++ b/app/services/profile.service.js @@ -101,7 +101,8 @@ 'subTrack': subTrack.name, 'rank': subTrack.rank ? subTrack.rank.overallRank : 0, 'rating': subTrack.rank.rating || 0, - 'wins': subTrack.wins + 'wins': subTrack.wins, + 'mostRecentEventDate': new Date(subTrack.mostRecentEventDate) }; }).filter(function(subTrack) { return !(subTrack.subTrack == 'COPILOT_POSTING' && subTrack.track == 'DEVELOP'); @@ -114,7 +115,8 @@ 'track': 'DESIGN', 'subTrack': subTrack.name, 'rank': false, - 'wins': subTrack.wins + 'wins': subTrack.wins, + 'mostRecentEventDate': new Date(subTrack.mostRecentEventDate) }; }); } @@ -124,7 +126,8 @@ 'track': 'DATA_SCIENCE', 'subTrack': 'SRM', 'rank': srmStats.rank.rank, - 'rating': srmStats.rank.rating + 'rating': srmStats.rank.rating, + 'mostRecentEventDate': new Date(srmStats.rank.mostRecentEventDate) }); } if (stats.DATA_SCIENCE && stats.DATA_SCIENCE.MARATHON_MATCH && stats.DATA_SCIENCE.MARATHON_MATCH.rank) { @@ -133,7 +136,8 @@ 'track': 'DATA_SCIENCE', 'subTrack': 'MARATHON_MATCH', 'rank': marathonStats.rank.rank, - 'rating': marathonStats.rank.rating + 'rating': marathonStats.rank.rating, + 'mostRecentEventDate': new Date(marathonStats.rank.mostRecentEventDate) }); } if (stats.COPILOT) { diff --git a/assets/css/my-dashboard/community-updates.scss b/assets/css/my-dashboard/community-updates.scss index 11b6f7751..b14e8ad6b 100644 --- a/assets/css/my-dashboard/community-updates.scss +++ b/assets/css/my-dashboard/community-updates.scss @@ -42,7 +42,7 @@ border: 1px solid #F0F0F0; @media only screen and (min-width: 570px) { width: 270px; - height: 386px; + // height: 386px; &:nth-child(2n + 1) { margin-right: 10px; diff --git a/assets/css/my-dashboard/programs.scss b/assets/css/my-dashboard/programs.scss index dab7f4c93..fa7074422 100644 --- a/assets/css/my-dashboard/programs.scss +++ b/assets/css/my-dashboard/programs.scss @@ -103,7 +103,6 @@ display: inline-block; margin-top: 30px; font-size: 13px; - color: $white; text-decoration: none; text-transform: uppercase; @media only screen and (min-width: 1000px) {