Skip to content

Commit 2df8efc

Browse files
committed
disable filters on in progress
)they don't work and they aren't too useful here
1 parent c83d1f5 commit 2df8efc

File tree

2 files changed

+27
-14
lines changed

2 files changed

+27
-14
lines changed

app/Livewire/Media/MediaPage.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ private function getType(): ?MediaTypeName
4141
return $this->type ? MediaTypeName::from($this->type) : null;
4242
}
4343

44+
public function disableFilters()
45+
{
46+
return $this->list === 'in-progress';
47+
}
48+
4449
private function query(): Collection
4550
{
4651
return match ($this->list) {

resources/views/livewire/media/media-page.blade.php

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,29 @@ class="select select-sm select-ghost"
1212
<option value="backlog">Backlog</option>
1313
</select>
1414

15-
<select wire:model.live="year" class="select select-sm select-ghost">
16-
<option value="">All Years</option>
17-
@foreach ($years as $year)
18-
<option value="{{ $year }}">{{ $year }}</option>
19-
@endforeach
20-
</select>
15+
<select
16+
wire:model.live="year"
17+
class="select select-sm select-ghost"
18+
@if($this->disableFilters()) disabled @endif
19+
>
20+
<option value="">All Years</option>
21+
@foreach ($years as $year)
22+
<option value="{{ $year }}">{{ $year }}</option>
23+
@endforeach
24+
</select>
2125

22-
<select wire:model.live="type" class="select select-sm select-ghost">
23-
<option value="">All Types</option>
24-
@foreach ($mediaTypes as $type)
25-
<option value="{{ $type->value }}">
26-
{{ $type->displayName() }}
27-
</option>
28-
@endforeach
29-
</select>
26+
<select
27+
wire:model.live="type"
28+
class="select select-sm select-ghost"
29+
@if($this->disableFilters()) disabled @endif
30+
>
31+
<option value="">All Types</option>
32+
@foreach ($mediaTypes as $type)
33+
<option value="{{ $type->value }}">
34+
{{ $type->displayName() }}
35+
</option>
36+
@endforeach
37+
</select>
3038
</form>
3139

3240
<div class="my-6">

0 commit comments

Comments
 (0)