mirror of
https://github.com/sp-tarkov/forge.git
synced 2025-02-13 04:30:41 -05:00
Filter Count
A count of the number of filters currently applied is now displayed.
This commit is contained in:
parent
6b889d1d01
commit
41714f337f
@ -87,8 +87,24 @@ class Index extends Component
|
|||||||
public function resetFilters(): void
|
public function resetFilters(): void
|
||||||
{
|
{
|
||||||
$this->query = '';
|
$this->query = '';
|
||||||
$this->order = 'created';
|
|
||||||
$this->sptVersion = $this->getLatestMinorVersions()->pluck('version')->toArray();
|
$this->sptVersion = $this->getLatestMinorVersions()->pluck('version')->toArray();
|
||||||
$this->featured = 'include';
|
$this->featured = 'include';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Compute the count of active filters.
|
||||||
|
*/
|
||||||
|
public function getFilterCountProperty(): int
|
||||||
|
{
|
||||||
|
$count = 0;
|
||||||
|
if ($this->query !== '') {
|
||||||
|
$count++;
|
||||||
|
}
|
||||||
|
if ($this->featured !== 'include') {
|
||||||
|
$count++;
|
||||||
|
}
|
||||||
|
$count += count($this->sptVersion);
|
||||||
|
|
||||||
|
return $count;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
<svg class="mr-2 h-5 w-5 flex-none text-gray-400 group-hover:text-gray-500 dark:text-gray-600" aria-hidden="true" viewBox="0 0 20 20" fill="currentColor">
|
<svg class="mr-2 h-5 w-5 flex-none text-gray-400 group-hover:text-gray-500 dark:text-gray-600" aria-hidden="true" viewBox="0 0 20 20" fill="currentColor">
|
||||||
<path fill-rule="evenodd" d="M2.628 1.601C5.028 1.206 7.49 1 10 1s4.973.206 7.372.601a.75.75 0 01.628.74v2.288a2.25 2.25 0 01-.659 1.59l-4.682 4.683a2.25 2.25 0 00-.659 1.59v3.037c0 .684-.31 1.33-.844 1.757l-1.937 1.55A.75.75 0 018 18.25v-5.757a2.25 2.25 0 00-.659-1.591L2.659 6.22A2.25 2.25 0 012 4.629V2.34a.75.75 0 01.628-.74z" clip-rule="evenodd" />
|
<path fill-rule="evenodd" d="M2.628 1.601C5.028 1.206 7.49 1 10 1s4.973.206 7.372.601a.75.75 0 01.628.74v2.288a2.25 2.25 0 01-.659 1.59l-4.682 4.683a2.25 2.25 0 00-.659 1.59v3.037c0 .684-.31 1.33-.844 1.757l-1.937 1.55A.75.75 0 018 18.25v-5.757a2.25 2.25 0 00-.659-1.591L2.659 6.22A2.25 2.25 0 012 4.629V2.34a.75.75 0 01.628-.74z" clip-rule="evenodd" />
|
||||||
</svg>
|
</svg>
|
||||||
{{ __('Filters') }} {{-- // TODO: Ideally, we should have a count of the number of filters here: "5 Filters" --}}
|
{{ $this->filterCount }} {{ __('Filters') }}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<search class="relative group pl-6">
|
<search class="relative group pl-6">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user