Show if an entry has bonus scores on hte seating form
This commit is contained in:
parent
9742cdbd76
commit
a52b91d601
|
|
@ -40,7 +40,7 @@ class RankAuditionEntries
|
||||||
{
|
{
|
||||||
$this->basicValidation($mode, $audition);
|
$this->basicValidation($mode, $audition);
|
||||||
$entries = match ($mode) {
|
$entries = match ($mode) {
|
||||||
'seating' => $audition->entries()->forSeating()->with('scoreSheets')->get(),
|
'seating' => $audition->entries()->forSeating()->with('scoreSheets')->withCount('bonusScores')->get(),
|
||||||
'advancement' => $audition->entries()->forAdvancement()->with('scoreSheets')->get(),
|
'advancement' => $audition->entries()->forAdvancement()->with('scoreSheets')->get(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -120,6 +120,7 @@ class SeatAuditionFormController extends Controller
|
||||||
'drawNumber' => $entry->draw_number,
|
'drawNumber' => $entry->draw_number,
|
||||||
'totalScore' => $totalScoreColumn,
|
'totalScore' => $totalScoreColumn,
|
||||||
'fullyScored' => $fullyScored,
|
'fullyScored' => $fullyScored,
|
||||||
|
'hasBonusScores' => $entry->bonus_scores_count > 0,
|
||||||
'doubleData' => $doublerData,
|
'doubleData' => $doublerData,
|
||||||
'doublerRequest' => $entry->student->doublerRequests()->where('event_id',
|
'doublerRequest' => $entry->student->doublerRequests()->where('event_id',
|
||||||
$audition->event_id)->first()?->request,
|
$audition->event_id)->first()?->request,
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@ use Illuminate\Database\Eloquent\Builder;
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
|
||||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||||
use Illuminate\Database\Eloquent\Relations\HasOne;
|
use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||||
use Illuminate\Database\Eloquent\Relations\HasOneThrough;
|
use Illuminate\Database\Eloquent\Relations\HasOneThrough;
|
||||||
|
|
@ -55,9 +54,9 @@ class Entry extends Model
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function bonusScores(): BelongsToMany
|
public function bonusScores(): HasMany
|
||||||
{
|
{
|
||||||
return $this->belongsToMany(BonusScore::class);
|
return $this->hasMany(BonusScore::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function advancementVotes(): HasMany
|
public function advancementVotes(): HasMany
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,9 @@
|
||||||
{{-- @foreach($judges as $judge)--}}
|
{{-- @foreach($judges as $judge)--}}
|
||||||
{{-- <x-table.th>{{ $judge->short_name() }}</x-table.th>--}}
|
{{-- <x-table.th>{{ $judge->short_name() }}</x-table.th>--}}
|
||||||
{{-- @endforeach--}}
|
{{-- @endforeach--}}
|
||||||
|
@if($audition->bonusScore()->count() > 0)
|
||||||
|
<x-table.th>Bonus Score</x-table.th>
|
||||||
|
@endif
|
||||||
<x-table.th>Total Score</x-table.th>
|
<x-table.th>Total Score</x-table.th>
|
||||||
<x-table.th>All Scores?</x-table.th>
|
<x-table.th>All Scores?</x-table.th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
@ -45,6 +48,13 @@
|
||||||
{{-- @include('tabulation.auditionSeating-doubler-block')--}}
|
{{-- @include('tabulation.auditionSeating-doubler-block')--}}
|
||||||
{{-- @endif--}}
|
{{-- @endif--}}
|
||||||
</x-table.td>
|
</x-table.td>
|
||||||
|
@if($audition->bonusScore()->count() > 0)
|
||||||
|
@if($entry['hasBonusScores'])
|
||||||
|
<x-table.td><x-icons.checkmark color="green"/></x-table.td>
|
||||||
|
@else
|
||||||
|
<x-table.td></x-table.td>
|
||||||
|
@endif
|
||||||
|
@endif
|
||||||
<x-table.td>{{ $entry['totalScore'] }}</x-table.td>
|
<x-table.td>{{ $entry['totalScore'] }}</x-table.td>
|
||||||
<x-table.td>
|
<x-table.td>
|
||||||
@if($entry['fullyScored'])
|
@if($entry['fullyScored'])
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue