Renames $availableSptVersions to $activeSptVersions in Mod Listing

This commit is contained in:
Refringe 2024-09-08 22:00:26 -04:00
parent 552ecf3ac2
commit ffd5117028
Signed by: Refringe
SSH Key Fingerprint: SHA256:t865XsQpfTeqPRBMN2G6+N8wlDjkgUCZF3WGW6O9N/k
2 changed files with 6 additions and 6 deletions

View File

@ -48,14 +48,14 @@ class Index extends Component
/** /**
* The available SPT versions. * The available SPT versions.
*/ */
public Collection $availableSptVersions; public Collection $activeSptVersions;
/** /**
* The component mount method, run only once when the component is mounted. * The component mount method, run only once when the component is mounted.
*/ */
public function mount(): void public function mount(): void
{ {
$this->availableSptVersions = $this->availableSptVersions ?? Cache::remember('available-spt-versions', 60 * 60, function () { $this->activeSptVersions = $this->activeSptVersions ?? Cache::remember('active-spt-versions', 60 * 60, function () {
return SptVersion::getVersionsForLastThreeMinors(); return SptVersion::getVersionsForLastThreeMinors();
}); });
@ -67,7 +67,7 @@ class Index extends Component
*/ */
public function getLatestMinorVersions(): Collection public function getLatestMinorVersions(): Collection
{ {
return $this->availableSptVersions->filter(function (SptVersion $sptVersion) { return $this->activeSptVersions->filter(function (SptVersion $sptVersion) {
return $sptVersion->isLatestMinor(); return $sptVersion->isLatestMinor();
}); });
} }

View File

@ -53,13 +53,13 @@
<div class="mx-auto grid max-w-7xl grid-cols-2 gap-x-4 px-4 text-sm sm:px-6 md:gap-x-6 lg:px-8"> <div class="mx-auto grid max-w-7xl grid-cols-2 gap-x-4 px-4 text-sm sm:px-6 md:gap-x-6 lg:px-8">
<div class="grid auto-rows-min grid-cols-1 gap-y-10 md:grid-cols-2 md:gap-x-6"> <div class="grid auto-rows-min grid-cols-1 gap-y-10 md:grid-cols-2 md:gap-x-6">
@php @php
$totalVersions = count($availableSptVersions); $totalVersions = count($activeSptVersions);
$half = ceil($totalVersions / 2); $half = ceil($totalVersions / 2);
@endphp @endphp
<fieldset> <fieldset>
<legend class="block font-medium text-gray-900 dark:text-gray-100">{{ __('SPT Versions') }}</legend> <legend class="block font-medium text-gray-900 dark:text-gray-100">{{ __('SPT Versions') }}</legend>
<div class="space-y-6 pt-6 sm:space-y-4 sm:pt-4"> <div class="space-y-6 pt-6 sm:space-y-4 sm:pt-4">
@foreach ($availableSptVersions as $index => $version) @foreach ($activeSptVersions as $index => $version)
@if ($index < $half) @if ($index < $half)
<x-filter-checkbox id="sptVersions-{{ $index }}" name="sptVersions" value="{{ $version->version }}">{{ $version->version }}</x-filter-checkbox> <x-filter-checkbox id="sptVersions-{{ $index }}" name="sptVersions" value="{{ $version->version }}">{{ $version->version }}</x-filter-checkbox>
@endif @endif
@ -69,7 +69,7 @@
<fieldset> <fieldset>
<legend class="block font-medium text-gray-900 dark:text-gray-100">&nbsp;</legend> <legend class="block font-medium text-gray-900 dark:text-gray-100">&nbsp;</legend>
<div class="space-y-6 pt-6 sm:space-y-4 sm:pt-4"> <div class="space-y-6 pt-6 sm:space-y-4 sm:pt-4">
@foreach ($availableSptVersions as $index => $version) @foreach ($activeSptVersions as $index => $version)
@if ($index >= $half) @if ($index >= $half)
<x-filter-checkbox id="sptVersions-{{ $index }}" name="sptVersions" value="{{ $version->version }}">{{ $version->version }}</x-filter-checkbox> <x-filter-checkbox id="sptVersions-{{ $index }}" name="sptVersions" value="{{ $version->version }}">{{ $version->version }}</x-filter-checkbox>
@endif @endif