MEOBDA rules - allow admin to filter nominations to those without an assigned split.
This commit is contained in:
parent
e72f51728d
commit
fd35913fd6
|
|
@ -72,13 +72,20 @@ class MeobdaNominationAdminController extends Controller implements NominationAd
|
|||
}
|
||||
|
||||
if ($filterData['split'] ?? false) {
|
||||
$splitFilter = explode('---', $filterData['split']);
|
||||
$nominations = $nominations->where('nomination_ensemble_id', $splitFilter[0]);
|
||||
if ($splitFilter[1] != 'all') {
|
||||
$nominations = $nominations->where('data->split', $splitFilter[1]);
|
||||
if ($filterData['split'] == 'NO-SPLIT-ASSIGNED') {
|
||||
$nominations = $nominations->whereNull('data->split');
|
||||
} else {
|
||||
$splitFilter = explode('---', $filterData['split']);
|
||||
$nominations = $nominations->where('nomination_ensemble_id', $splitFilter[0]);
|
||||
if ($splitFilter[1] != 'all') {
|
||||
$nominations = $nominations->where('data->split', $splitFilter[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Sort
|
||||
$nominations = $nominations->orderBy('id', 'desc');
|
||||
|
||||
$nominations = $nominations->paginate(50);
|
||||
|
||||
return view('nomination_ensembles.meobda.admin.nominations',
|
||||
|
|
|
|||
|
|
@ -31,6 +31,10 @@
|
|||
<x-form.select name="split" onchange="this.form.submit()" colspan="2">
|
||||
<x-slot:label>Split</x-slot:label>
|
||||
<option value="">All</option>
|
||||
<option value="NO-SPLIT-ASSIGNED"
|
||||
@if($filterData['split'] ?? null == 'NO-SPLIT-ASSIGNED') SELECTED @endif>
|
||||
No Split Assigned
|
||||
</option>
|
||||
@foreach ($splits as $value => $name)
|
||||
<option value="{{$value}}"
|
||||
@if($value == ($filterData['split'] ?? null)) SELECTED @endif>
|
||||
|
|
|
|||
Loading…
Reference in New Issue