63 lines
3.6 KiB
PHP
63 lines
3.6 KiB
PHP
<div class="card">
|
|
<div class="card-body">
|
|
<h4 class="header-title mb-2">{{$title}}</h4>
|
|
<div class="row">
|
|
@foreach($scores as $score)
|
|
<div class="col-12">
|
|
<button class="btn btn-warning btn-xs rounded-pill mb-1 dlscreenshot" target="compatition_team_dashboard_{{$score->id}}">Download PNG</button>
|
|
<div class="card border-primary border mb-3" id="compatition_team_dashboard_{{$score->id}}">
|
|
<div class="card-header"><i class="mdi mdi-calendar-month-outline font-18 text-success me-1"></i> {{date("d M Y h:iA", strtotime($score->validity_start))}} - {{date("d M Y h:iA", strtotime($score->validity_end)-1 )}}</div>
|
|
<div class="card-body">
|
|
<h4 class="card-title text-primary">{{$score->title}}</h4>
|
|
<!-- <p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p> -->
|
|
<div class="table-responsive">
|
|
<table class="table table-borderless table-nowrap table-hover table-centered m-0">
|
|
<thead class="table-light">
|
|
<tr>
|
|
<th>Rank</th>
|
|
<th>User Name</th>
|
|
@foreach($score->metrics as $metric)
|
|
<th>{{$metric->name}}</th>
|
|
@endforeach
|
|
<th>Total Runs</th>
|
|
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@php
|
|
$rank = 0;
|
|
$lastscore = 0;
|
|
$metrics = $score->metrics;
|
|
@endphp
|
|
@foreach($score->userscore as $participant)
|
|
@php
|
|
$score = is_object($participant->score) ? 0 : $participant->score;
|
|
if($lastscore == 0 && $score > 0) {
|
|
$rank++;
|
|
$lastscore = $score;
|
|
}
|
|
if($lastscore > 0 && $score < $lastscore) {
|
|
$rank++;
|
|
$lastscore = $score;
|
|
}
|
|
@endphp
|
|
<tr>
|
|
<td><h2>{{$rank}}</h2></td>
|
|
<td><h5 class="m-0 fw-normal">{{$participant->name}}</h5></td>
|
|
@foreach($metrics as $metric)
|
|
<td>{{ isset($participant->{$metric->id}) ? $participant->{$metric->id} : 0 }}</td>
|
|
@endforeach
|
|
<td>{{ is_object($participant->score) ? '-' : $participant->score }}</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endforeach
|
|
</div>
|
|
</div>
|
|
</div>
|