Show if an entry has bonus scores on hte seating form

This commit is contained in:
Matt Young 2024-11-22 11:38:10 -06:00
parent 9742cdbd76
commit a52b91d601
4 changed files with 14 additions and 4 deletions

View File

@ -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(),
}; };

View File

@ -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,

View File

@ -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

View File

@ -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'])