Preliminary work on PrelimJudging entry list.
This commit is contained in:
parent
07f3f37be4
commit
83eff8feee
|
|
@ -12,6 +12,10 @@ class PrelimJudgingController extends Controller
|
|||
if (auth()->user()->cannot('judge', $prelimDefinition)) {
|
||||
return redirect()->route('dashboard')->with('error', 'You are not assigned to judge that prelim audition.');
|
||||
}
|
||||
$entries = $prelimDefinition->audition->entries;
|
||||
$subscores = $prelimDefinition->scoringGuide->subscores()->orderBy('display_order')->get();
|
||||
$published = $prelimDefinition->audition->hasFlag('seats_published');
|
||||
|
||||
return view('judging.prelim_entry_list', compact('prelimDefinition', 'entries', 'subscores', 'published'));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,54 @@
|
|||
@php use Illuminate\Support\Facades\Auth; @endphp
|
||||
<x-layout.app>
|
||||
<x-slot:page_title>Judging Dashboard</x-slot:page_title>
|
||||
<x-card.card>
|
||||
<x-card.heading>
|
||||
{{ $prelimDefinition->audition->name }} Prelims
|
||||
@if($published)
|
||||
<x-slot:subheading class="text-red-500">Results are published. Scores cannot be changed.</x-slot:subheading>
|
||||
@endif
|
||||
</x-card.heading>
|
||||
<x-table.table>
|
||||
<thead>
|
||||
<tr>
|
||||
<x-table.th :sortable="false"><a href="{{ url()->current() }}">Entry</a></x-table.th>
|
||||
@foreach($subscores as $subscore)
|
||||
<x-table.th :sortable="false" class="hidden md:table-cell">{{ $subscore->name }}</x-table.th>
|
||||
@endforeach
|
||||
<x-table.th :sortable="true">Timestamp</x-table.th>
|
||||
</tr>
|
||||
</thead>
|
||||
<x-table.body>
|
||||
@foreach($entries as $entry)
|
||||
{{-- @continue($entry->hasFlag('no_show'))--}}
|
||||
<tr>
|
||||
<x-table.td>
|
||||
@if(! $published && ! $entry->hasFlag('no_show'))
|
||||
<a href="#">
|
||||
@endif
|
||||
{{ $prelimDefinition->audition->name }} {{ $entry->draw_number }}
|
||||
@if($entry->hasFlag('no_show'))
|
||||
<p class="text-red-600">No Show</p>
|
||||
@endif
|
||||
@if(! $published && ! $entry->hasFlag('no_show'))
|
||||
</a>
|
||||
@endif
|
||||
</x-table.td>
|
||||
{{-- @foreach($subscores as $subscore)--}}
|
||||
{{-- <x-table.td class="hidden md:table-cell">--}}
|
||||
{{-- @php--}}
|
||||
{{-- if( $x = Auth::user()->scoresForEntry($entry->id)) echo $x[$subscore->id]['score'];--}}
|
||||
{{-- @endphp--}}
|
||||
{{-- </x-table.td>--}}
|
||||
{{-- @endforeach--}}
|
||||
|
||||
|
||||
{{-- <x-table.td>--}}
|
||||
{{-- {{ Auth::user()->timeForEntryScores($entry->id)?->setTimezone('America/Chicago')->format('m/d/y H:i') }}--}}
|
||||
{{-- </x-table.td>--}}
|
||||
</tr>
|
||||
@endforeach
|
||||
</x-table.body>
|
||||
</x-table.table>
|
||||
</x-card.card>
|
||||
</x-layout.app>
|
||||
|
|
@ -1,6 +1,8 @@
|
|||
<?php
|
||||
|
||||
use App\Actions\Draw\RunDraw;
|
||||
use App\Models\Audition;
|
||||
use App\Models\Entry;
|
||||
use App\Models\PrelimDefinition;
|
||||
use App\Models\Room;
|
||||
use App\Models\User;
|
||||
|
|
@ -36,7 +38,30 @@ describe('PrelimJudgingController:prelimEntryList', function () {
|
|||
});
|
||||
|
||||
it('shows all auditions entered in the given audition', function () {
|
||||
$judgeUser = User::factory()->create();
|
||||
$finalsRoom = Room::factory()->create();
|
||||
$audition = Audition::factory()->create(['room_id' => $finalsRoom->id, 'name' => 'Euphonium']);
|
||||
$room = Room::factory()->create();
|
||||
$prelimDefinition = PrelimDefinition::create([
|
||||
'audition_id' => $audition->id,
|
||||
'room_id' => $room->id,
|
||||
'scoring_guide_id' => 0,
|
||||
'passing_score' => 75,
|
||||
]);
|
||||
$room->addJudge($judgeUser);
|
||||
|
||||
$entries = Entry::factory()->count(5)->create(['audition_id' => $audition->id]);
|
||||
app(RunDraw::class)($audition);
|
||||
|
||||
$this->actingAs($judgeUser);
|
||||
$response = $this->get(route('judging.prelimEntryList', $prelimDefinition));
|
||||
$response->assertOk();
|
||||
foreach ($entries as $entry) {
|
||||
|
||||
$entry->refresh();
|
||||
$identifierString = $entry->audition->name.' '.$entry->draw_number;
|
||||
$response->assertSee($identifierString);
|
||||
}
|
||||
});
|
||||
|
||||
it('shows scores for previously judged entries', function () {
|
||||
|
|
|
|||
Loading…
Reference in New Issue