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

added links #622

Merged
merged 7 commits into from
Dec 23, 2015
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions app/directives/srm-tile/srm-tile.directive.jade
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
.challenge-track

header
a(ng-href="https://community.{{DOMAIN}}/tc?module=MatchDetails&rd={{srm.rounds[0].id}}") {{srm.name}}
a(ng-href="https://community.{{DOMAIN}}/stat?c=round_overview&rd={{srm.rounds[0].id}}") {{srm.name}}

.srm-details
p.starts-in Starts in #[span {{srm.codingStartAt | timeDiff:"quantity"}} {{srm.codingStartAt | timeDiff:'unit'}}]
Expand All @@ -17,22 +17,22 @@
.phase-status
.registered(ng-show="srm.userStatus === CONSTANTS.REGISTERED") Registered
.unregistered(ng-hide="srm.currentPhase !== CONSTANTS.REGISTRATION || srm.userStatus === CONSTANTS.REGISTERED")
a.tc-btn.tc-btn-s.tc-btn-wide(href="https://community.{{DOMAIN}}/tc?module=MatchDetails&rd={{srm.rounds[0].id}}") Register
a.tc-btn.tc-btn-s.tc-btn-wide(href="https://community.{{DOMAIN}}/stat?c=round_overview&rd={{srm.rounds[0].id}}") Register
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tladendo I don't think we need to update this link as the updated link does not have register option for the member and the purpose of this link/button is to take user to a page from where he/she can register for the SRM. @oyeanuj Please correct me if I missed something here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @vikasrohit


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

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

.member-stats
p.points #[span {{srm.result.finalPoints }}] #[span Points]
.ranks
.division
a.division(href="https://community.{{DOMAIN}}/stat?c=round_stats&rd={{srm.rounds[0].id}}&dn={{srm.result.division}}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do SRMs always have at least one round with an id and a result property with a division property? If not, we may want to handle the logic for this link in the controller that owns this HTML and pass a single, determined value to the link like srm.roundId. But it may be unnecessary if the API always returns those values :)

p.rank {{srm.result.divisionPlacement}}
p.label #[span Division {{srm.result.division}}]
.room
a.room(href="https://community.{{DOMAIN}}/stat?c=coder_room_stats&cr={{userId}}&rd={{srm.rounds[0].id}}")
p.rank #[span {{srm.result.roomPlacement}}]
p.label #[span Room]
p.placement Placement
Expand All @@ -42,7 +42,7 @@
.challenge-track
header
.srm-name
a(ng-href="https://community.{{DOMAIN}}/tc?module=MatchDetails&rd={{srm.rounds[0].id}}") {{srm.name}}
a(ng-href="https://community.{{DOMAIN}}/stat?c=round_overview&rd={{srm.rounds[0].id}}") {{srm.name}}

.srm-details
p.starts-in Starts in #[span {{srm.codingStartAt | timeDiff:"quantity"}} {{srm.codingStartAt | timeDiff:'unit'}}]
Expand All @@ -56,7 +56,7 @@
.challenge-track
header
.srm-name
a(ng-href="https://community.{{DOMAIN}}/tc?module=MatchDetails&rd={{srm.rounds[0].id}}") {{srm.name}}
a(ng-href="https://community.{{DOMAIN}}/stat?c=round_overview&rd={{srm.rounds[0].id}}") {{srm.name}}

.srm-details
p.ended-on Ended {{srm.codingEndAt | timeDiff:"quantity"}} {{srm.codingEndAt | timeDiff:'unit'}} ago
Expand Down
3 changes: 2 additions & 1 deletion app/directives/srm-tile/srm-tile.directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
srm: '=srm',
view: '=',
showResults: '=',
showFooter: '='
showFooter: '=',
userId: '='
},
controller: ['$scope', '$filter', 'CONSTANTS', 'SRMService',
function($scope, $filter, CONSTANTS, SRMService) {
Expand Down
1 change: 1 addition & 0 deletions app/my-dashboard/srms/srms.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

var userId = UserService.getUserIdentity().userId;
var handle = UserService.getUserIdentity().handle;
vm.userId = userId;

activate();

Expand Down
2 changes: 1 addition & 1 deletion app/my-dashboard/srms/srms.jade
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ header

tc-section(state="vm.state")
.srm-tiles
srm-tile(ng-repeat="srm in vm.srms", srm="srm", view="'tile'", ng-class="'tile-view'")
srm-tile(ng-repeat="srm in vm.srms", srm="srm", view="'tile'", ng-class="'tile-view'", user-id="vm.userId")

.srm-links-card
.flex-wrapper
Expand Down
1 change: 1 addition & 0 deletions app/my-srms/my-srms.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

var userId = UserService.getUserIdentity().userId;
var userHandle = UserService.getUserIdentity().handle;
vm.userId = userId;
vm.handle = userHandle;

activate();
Expand Down
2 changes: 1 addition & 1 deletion app/my-srms/my-srms.jade
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
.data(ng-class="vm.view + '-view'")
srm-tile.srm-tile(
ng-repeat="srm in vm.srms | orderBy:vm.orderBy:vm.reverseOrder",
srm="srm", view="vm.view", ng-class="vm.view + '-view'", show-results="vm.statusFilter === 'past'")
srm="srm", view="vm.view", ng-class="vm.view + '-view'", show-results="vm.statusFilter === 'past'", user-id="vm.userId")

tc-endless-paginator(state="vm.loading", page-params="vm.pageParams")
2 changes: 1 addition & 1 deletion app/profile/subtrack/data/data-challenges.jade
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

.challenges(ng-show="vm.subTrack == 'SRM'")
.challenge.tile(ng-repeat="challenge in vm.challenges")
srm-tile(srm="challenge", domain="vm.domain", view="'tile'")
srm-tile(srm="challenge", domain="vm.domain", view="'tile'", user-id="profileVm.profile.userId")

.no-challenges(ng-show="!vm.challenges || vm.challenges.length == 0")
| Sorry, no rated SRMs found.
Expand Down