Auditionadmin 20 - Bonus scores are fully functional #25
|
|
@ -30,10 +30,11 @@ class JudgingController extends Controller
|
||||||
|
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
$rooms = Auth::user()->judgingAssignments;
|
$rooms = Auth::user()->judgingAssignments()->with('auditions')->get();
|
||||||
$rooms->load('auditions');
|
$bonusScoresToJudge = Auth::user()->bonusJudgingAssignments()->with('auditions')->get();
|
||||||
|
|
||||||
return view('judging.index', compact('rooms'));
|
//$rooms->load('auditions');
|
||||||
|
return view('judging.index', compact('rooms', 'bonusScoresToJudge'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function auditionEntryList(Request $request, Audition $audition)
|
public function auditionEntryList(Request $request, Audition $audition)
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,8 @@
|
||||||
<x-layout.app>
|
<x-layout.app>
|
||||||
<x-slot:page_title>Judging Dashboard</x-slot:page_title>
|
<x-slot:page_title>Judging Dashboard</x-slot:page_title>
|
||||||
|
|
||||||
<h2 class="overflow-hidden mx-auto max-w-md py-3 px-1 text-base font-semibold leading-7 text-gray-900">Choose auditon to judge</h2>
|
<h2 class="overflow-hidden mx-auto max-w-md py-3 px-1 text-base font-semibold leading-7 text-gray-900">Choose
|
||||||
|
audition to judge</h2>
|
||||||
|
|
||||||
@foreach($rooms as $room)
|
@foreach($rooms as $room)
|
||||||
<x-card.card class="mx-auto max-w-md mb-3">
|
<x-card.card class="mx-auto max-w-md mb-3">
|
||||||
|
|
@ -16,5 +17,20 @@
|
||||||
</x-card.card>
|
</x-card.card>
|
||||||
@endforeach
|
@endforeach
|
||||||
|
|
||||||
|
@foreach($bonusScoresToJudge as $bonusScore)
|
||||||
|
<x-card.card class="mx-auto max-w-md mb-3">
|
||||||
|
<x-card.heading>{{ $bonusScore->name }}</x-card.heading>
|
||||||
|
<x-card.list.body>
|
||||||
|
@foreach($bonusScore->auditions as $audition)
|
||||||
|
<a href="#">
|
||||||
|
<x-card.list.row class="!py-3 ml-3">
|
||||||
|
{{ $audition->name }}
|
||||||
|
</x-card.list.row>
|
||||||
|
</a>
|
||||||
|
@endforeach
|
||||||
|
</x-card.list.body>
|
||||||
|
</x-card.card>
|
||||||
|
@endforeach
|
||||||
|
|
||||||
|
|
||||||
</x-layout.app>
|
</x-layout.app>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use App\Models\Audition;
|
use App\Models\Audition;
|
||||||
|
use App\Models\BonusScoreDefinition;
|
||||||
use App\Models\Entry;
|
use App\Models\Entry;
|
||||||
use App\Models\Room;
|
use App\Models\Room;
|
||||||
use App\Models\ScoringGuide;
|
use App\Models\ScoringGuide;
|
||||||
|
|
@ -113,3 +114,37 @@ it('does not show the user room and auditions they are not assigned to judge', f
|
||||||
->assertDontSee($otherRoom->name)
|
->assertDontSee($otherRoom->name)
|
||||||
->assertDontSee($otherAudition->name);
|
->assertDontSee($otherAudition->name);
|
||||||
});
|
});
|
||||||
|
it('shows bonus scores the user is assigned to judge', function () {
|
||||||
|
// Arrange
|
||||||
|
$bonusScore = BonusScoreDefinition::factory()->create();
|
||||||
|
$judge = User::factory()->create();
|
||||||
|
$bonusScore->judges()->attach($judge);
|
||||||
|
$this->actingAs($judge);
|
||||||
|
// Act & Assert
|
||||||
|
$this->get(route('judging.index'))
|
||||||
|
->assertSee($bonusScore->name);
|
||||||
|
});
|
||||||
|
it('does not show bonus scores the user is not assigned to judge', function () {
|
||||||
|
// Arrange
|
||||||
|
$bonusScore = BonusScoreDefinition::factory()->create();
|
||||||
|
$otherBonusScore = BonusScoreDefinition::factory()->create();
|
||||||
|
$judge = User::factory()->create();
|
||||||
|
$bonusScore->judges()->attach($judge);
|
||||||
|
$this->actingAs($judge);
|
||||||
|
// Act & Assert
|
||||||
|
$this->get(route('judging.index'))
|
||||||
|
->assertSee($bonusScore->name)
|
||||||
|
->assertDontSee($otherBonusScore->name);
|
||||||
|
});
|
||||||
|
it('shows auditions in a bonus score assignment', function () {
|
||||||
|
// Arrange
|
||||||
|
$bonusScore = BonusScoreDefinition::factory()->create();
|
||||||
|
$audition = Audition::factory()->create();
|
||||||
|
$bonusScore->auditions()->attach($audition);
|
||||||
|
$judge = User::factory()->create();
|
||||||
|
$bonusScore->judges()->attach($judge);
|
||||||
|
$this->actingAs($judge);
|
||||||
|
// Act & Assert
|
||||||
|
$this->get(route('judging.index'))
|
||||||
|
->assertSee($audition->name);
|
||||||
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue