Cleanup work on scoring guides and rooms
This commit is contained in:
parent
73eede9fe2
commit
0ac37b6879
|
|
@ -13,8 +13,8 @@ class RoomController extends Controller
|
|||
public function index()
|
||||
{
|
||||
if(! Auth::user()->is_admin) abort(403);
|
||||
$unassignedAuditions = Audition::with('entries')->where('room_id','=','0')->orderBy('score_order')->get();
|
||||
#$unassignedAuditions = Audition::with('entries')->where('room_id','=','0')->orderBy('score_order')->get();
|
||||
$rooms = Room::with('auditions.entries')->orderBy('name')->get();
|
||||
return view('admin.rooms.index', ['rooms' => $rooms, 'unassignedAuditions' => $unassignedAuditions]);
|
||||
return view('admin.rooms.index', ['rooms' => $rooms]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,4 +15,9 @@ class ScoringGuide extends Model
|
|||
{
|
||||
return $this->hasMany(Audition::class)->orderBy('score_order');
|
||||
}
|
||||
|
||||
public function subscores(): HasMany
|
||||
{
|
||||
return $this->hasMany(SubscoreDefinition::class);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,8 @@ class RoomFactory extends Factory
|
|||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
//
|
||||
'name' => 'Room ' . fake()->numberBetween(7,500),
|
||||
'description' => fake()->sentence()
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,3 +54,4 @@
|
|||
</tr>
|
||||
</tfoot>
|
||||
</x-table.table>
|
||||
{{-- TODO need to be able to edit subscores --}}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
@continue
|
||||
@endif
|
||||
<tr>
|
||||
<x-table.td>{{ $guide->name }}</x-table.td>
|
||||
<x-table.td>{{ $guide->name }} <span class="text-xs text-gray-400">{{ $guide->subscores->count() }} subscores</span></x-table.td>
|
||||
<x-table.td class="text-right text-indigo-600"><a href="/admin/scoring/guides/{{ $guide->id }}/edit">Edit</a></x-table.td>
|
||||
{{-- TODO add a link to delete if the guide is not in use--}}
|
||||
</tr>
|
||||
|
|
|
|||
Loading…
Reference in New Issue