<table class="table table-bordered table-stickyhead" [class.hideHistory]="!ui.showHistory" [class.onlySums]="ui.showOnlySums">
	<thead>
	<tr>
		<th colspan="3" class="headercell">
			<h4>
				{{info.tick < 0 ? 'No results yet' : 'Results from:'}}
				<a class="btn btn-link" (click)="showTick(shownTick-1)" title="Previous tick"
				   *ngIf="shownTick > 0"><i class="fas fa-chevron-left"></i></a>
				{{info.tick < 0 ? '' : 'Tick ' + info.tick}}
				<a class="btn btn-link" (click)="showTick(shownTick+1)" title="Next tick"
				   *ngIf="shownTick < backend.currentState.scoreboard_tick"><i class="fas fa-chevron-right"></i></a>
				<a class="btn btn-link" (click)="showTick(backend.currentState.scoreboard_tick)" title="Go to current tick"
				   *ngIf="shownTick < backend.currentState.scoreboard_tick"><i class="fas fa-fast-forward"></i></a>

				<span *ngIf="shownTick != info.tick" class="fas fa-spinner fa-spin"></span>
			</h4>
		</th>
		<!-- service cell -->
		<app-table-service-header-cell [services]="info.services"></app-table-service-header-cell>
	</tr>
	</thead>
	<tbody>
	<ng-container *ngFor="let rank of info.scoreboard; let i = index; trackBy: teamTrackBy">
		<tr *ngIf="backend.teams[rank.team_id] && i < dummyRowStart">
			<!-- Team row -->
			<td class="rankcell"><h4>{{rank.rank}}</h4></td>
			<td class="teamcell">
				<div class="media-left team-logo-media" *ngIf="ui.showImages">
					<a [routerLink]="['team', rank.team_id]">
						<img class="media-object" [src]="backend.teams[rank.team_id].logo" alt="" loading="lazy">
					</a>
				</div>
				<div class="media-body">
					<h4 class="team-name" [class.blocked]="backend.bannedTeams[rank.team_id]">
						<a [routerLink]="['team', rank.team_id]" [title]="backend.teams[rank.team_id].name + ' - See team\'s details'">{{backend.teams[rank.team_id].name}}</a>
					</h4>
					<span class="team-vulnbox">{{backend.teams[rank.team_id].vulnbox}}</span><br>
					<span class="team-total-points">
						<i class="fas fa-chart-line"></i>&nbsp;{{rank.points.toFixed(1)}}
						<span class="delta"><small title="New points this tick">({{floatToString(rank.do + rank.dd + rank.ds)}})</small></span>
					</span>
				</div>
			</td>

			<tablelinecells [rank]="rank" [tick]="info.tick"></tablelinecells>
		</tr>
		<tr class="dummyrow" *ngIf="!backend.teams[rank.team_id] || i >= dummyRowStart"></tr>
	</ng-container>
	</tbody>
</table>
