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

Commit f47be20

Browse files
committed
Cleanup
1 parent 5e4a63e commit f47be20

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

app/directives/srm-tile/srm-tile.directive.jade

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
.challenge-track
44

55
header
6-
a(ng-href="https://community.{{DOMAIN}}/stat?c=round_overview&rd={{srm.rounds[0].id}}") {{srm.name}}
6+
a(ng-href="https://community.{{DOMAIN}}/stat?c=round_overview&rd={{roundId}}") {{srm.name}}
77

88
.srm-details
99
p.starts-in Starts in #[span {{srm.codingStartAt | timeDiff:"quantity"}} {{srm.codingStartAt | timeDiff:'unit'}}]
@@ -17,22 +17,22 @@
1717
.phase-status
1818
.registered(ng-show="srm.userStatus === CONSTANTS.REGISTERED") Registered
1919
.unregistered(ng-hide="srm.currentPhase !== CONSTANTS.REGISTRATION || srm.userStatus === CONSTANTS.REGISTERED")
20-
a.tc-btn.tc-btn-s.tc-btn-wide(href="https://community.{{DOMAIN}}/tc?module=MatchDetails&rd={{srm.rounds[0].id}}") Register
20+
a.tc-btn.tc-btn-s.tc-btn-wide(href="https://community.{{DOMAIN}}/tc?module=MatchDetails&rd={{roundId}}") Register
2121

2222
.past-srm(ng-show="srm.status === 'PAST'")
2323
.challenge-track
2424

2525
header
26-
a(ng-href="https://community.{{DOMAIN}}/stat?c=round_overview&rd={{srm.rounds[0].id}}") {{srm.name}}
26+
a(ng-href="https://community.{{DOMAIN}}/stat?c=round_overview&rd={{roundId}}") {{srm.name}}
2727
.ended-on #[span {{srm.codingEndAt | localTime:"MMM DD, YYYY" }}]
2828

2929
.member-stats
3030
p.points #[span {{srm.result.finalPoints }}] #[span Points]
3131
.ranks
32-
a.division(href="https://community.{{DOMAIN}}/stat?c=round_stats&rd={{srm.rounds[0].id}}&dn={{srm.result.division}}")
32+
a.division(href="https://community.{{DOMAIN}}/stat?c=round_stats&rd={{roundId}}&dn={{division}}")
3333
p.rank {{srm.result.divisionPlacement}}
3434
p.label #[span Division {{srm.result.division}}]
35-
a.room(href="https://community.{{DOMAIN}}/stat?c=coder_room_stats&cr={{userId}}&rd={{srm.rounds[0].id}}")
35+
a.room(href="https://community.{{DOMAIN}}/stat?c=coder_room_stats&cr={{userId}}&rd={{roundId}}")
3636
p.rank #[span {{srm.result.roomPlacement}}]
3737
p.label #[span Room]
3838
p.placement Placement
@@ -42,21 +42,21 @@
4242
.challenge-track
4343
header
4444
.srm-name
45-
a(ng-href="https://community.{{DOMAIN}}/stat?c=round_overview&rd={{srm.rounds[0].id}}") {{srm.name}}
45+
a(ng-href="https://community.{{DOMAIN}}/stat?c=round_overview&rd={{roundId}}") {{srm.name}}
4646

4747
.srm-details
4848
p.starts-in Starts in #[span {{srm.codingStartAt | timeDiff:"quantity"}} {{srm.codingStartAt | timeDiff:'unit'}}]
4949

5050
.phase-status
5151
.registered(ng-show="srm.userStatus === CONSTANTS.REGISTERED") Registered
5252
.unregistered(ng-hide="srm.currentPhase !== CONSTANTS.REGISTRATION || srm.userStatus === CONSTANTS.REGISTERED")
53-
a.tc-btn.tc-btn-s.tc-btn-wide(href="https://community.{{DOMAIN}}/tc?module=MatchDetails&rd={{srm.rounds[0].id}}") Register
53+
a.tc-btn.tc-btn-s.tc-btn-wide(href="https://community.{{DOMAIN}}/tc?module=MatchDetails&rd={{roundId}}") Register
5454

5555
.past-srm(ng-show="srm.status === 'PAST'")
5656
.challenge-track
5757
header
5858
.srm-name
59-
a(ng-href="https://community.{{DOMAIN}}/stat?c=round_overview&rd={{srm.rounds[0].id}}") {{srm.name}}
59+
a(ng-href="https://community.{{DOMAIN}}/stat?c=round_overview&rd={{roundId}}") {{srm.name}}
6060

6161
.srm-details
6262
p.ended-on Ended {{srm.codingEndAt | timeDiff:"quantity"}} {{srm.codingEndAt | timeDiff:'unit'}} ago
@@ -65,10 +65,10 @@
6565
p.points #[span {{srm.result.finalPoints }}] Points
6666

6767
.ranks
68-
a.division(ng-class="{noclick: !srm.result.divisionPlacement}")
68+
a.division(ng-class="{noclick: !srm.result.divisionPlacement}", href="https://community.{{DOMAIN}}/stat?c=round_stats&rd={{roundId}}&dn={{division}}")
6969
p.rank {{srm.result.divisionPlacement}}
7070
p.label #[span Div {{srm.result.division}}] #[span Placement]
71-
a.room(ng-class="{noclick: !srm.result.roomPlacement}")
71+
a.room(ng-class="{noclick: !srm.result.roomPlacement}", href="https://community.{{DOMAIN}}/stat?c=coder_room_stats&cr={{userId}}&rd={{roundId}}")
7272
p.rank #[span {{srm.result.roomPlacement}}]
7373
p.label #[span Room] #[span Placement]
7474

app/directives/srm-tile/srm-tile.directive.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@
1313
},
1414
controller: ['$scope', '$filter', 'CONSTANTS', 'SRMService',
1515
function($scope, $filter, CONSTANTS, SRMService) {
16-
$scope.DOMAIN = CONSTANTS.domain;
17-
$scope.CONSTANTS = CONSTANTS;
18-
$scope.srm.userStatus = _.get($scope.srm, 'userStatus', null);
19-
SRMService.processSRM($scope.srm);
16+
$scope.DOMAIN = CONSTANTS.domain;
17+
$scope.CONSTANTS = CONSTANTS;
18+
$scope.srm.userStatus = _.get($scope.srm, 'userStatus', null);
19+
SRMService.processSRM($scope.srm);
20+
$scope.roundId = $scope.srm.rounds.length && $scope.srm.rounds[0].id;
21+
$scope.division = $scope.srm.result && $scope.srm.result.division;
2022
}]
2123
};
2224
});

0 commit comments

Comments
 (0)