Skip to content

Commit

Permalink
Detail status WIP.
Browse files Browse the repository at this point in the history
  • Loading branch information
tkem committed Mar 24, 2024
1 parent 81e2b7e commit cee3689
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 3 deletions.
12 changes: 12 additions & 0 deletions src/app/rms/leaderboard/leaderboard-lap.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,17 @@
{{times[0] - times[3] | time:'s.sss'}}
</span>
</ng-template>
<!--
<ng-template ngSwitchCase="lastlap">
<span [ngClass]="{best: last[0] - last[1] == item.best[0], allbest: last[0] - last[1] == best[0]}">
{{last[0] - last[1] | time:'s.sss'}}
</span>
</ng-template>
-->
<ng-template ngSwitchCase="status">
<span *ngIf="last" [ngClass]="(last[0] - last[1]) > (times[0] - times[1]) ? 'pos-up' : 'pos-dn'">
</span>
</ng-template>

</div>

1 change: 1 addition & 0 deletions src/app/rms/leaderboard/leaderboard-lap.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export class LeaderboardLapComponent {
@Input() item: LeaderboardItem;
@Input() times: number[];
@Input() best: number[];
@Input() last: number[];
@Input() intlap: number;
@Input() fields: string[];
}
8 changes: 7 additions & 1 deletion src/app/rms/leaderboard/leaderboard.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,13 @@
<leaderboard-head class="row" [fields]="detailFields"></leaderboard-head>
<leaderboard-lap class="row" *ngFor="let times of detail?.laptimes; odd as isOddRow; index as i; count as n"
[ngClass]="isOddRow ? 'odd' : 'even'"
[lap]="n - i" [item]="detail" [times]="times" [best]="best" [intlap]="intlaps[detail?.id]" [fields]="detailFields">
[lap]="n - i"
[item]="detail"
[times]="times"
[best]="best"
[last]="detail?.laptimes[i + 1]"
[intlap]="intlaps[detail?.id]"
[fields]="detailFields">
</leaderboard-lap>
</ion-content>
</ng-template>
Expand Down
4 changes: 2 additions & 2 deletions src/app/rms/leaderboard/leaderboard.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ const FIELDS = [{
}];

const DETAIL_FIELDS = [
'lap laptime gap int',
'lap laptime sector1 sector2 sector3'
'lap laptime gap int status',
'lap laptime sector1 sector2 sector3 status'
];

export class LeaderboardItem {
Expand Down

0 comments on commit cee3689

Please sign in to comment.