mirror of
https://github.com/sp-tarkov/forge.git
synced 2025-02-12 20:20:41 -05:00
Merge remote-tracking branch 'upstream/develop' into user-profile-info
This commit is contained in:
commit
2179da3c4d
@ -8,7 +8,6 @@ use Illuminate\Contracts\View\View;
|
|||||||
use Illuminate\Database\Eloquent\Collection;
|
use Illuminate\Database\Eloquent\Collection;
|
||||||
use Illuminate\Support\Facades\Cache;
|
use Illuminate\Support\Facades\Cache;
|
||||||
use Livewire\Attributes\Computed;
|
use Livewire\Attributes\Computed;
|
||||||
use Livewire\Attributes\Session;
|
|
||||||
use Livewire\Attributes\Url;
|
use Livewire\Attributes\Url;
|
||||||
use Livewire\Component;
|
use Livewire\Component;
|
||||||
use Livewire\WithPagination;
|
use Livewire\WithPagination;
|
||||||
@ -21,28 +20,24 @@ class Index extends Component
|
|||||||
* The search query value.
|
* The search query value.
|
||||||
*/
|
*/
|
||||||
#[Url]
|
#[Url]
|
||||||
#[Session]
|
|
||||||
public string $query = '';
|
public string $query = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The sort order value.
|
* The sort order value.
|
||||||
*/
|
*/
|
||||||
#[Url]
|
#[Url]
|
||||||
#[Session]
|
|
||||||
public string $order = 'created';
|
public string $order = 'created';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The SPT versions filter value.
|
* The SPT versions filter value.
|
||||||
*/
|
*/
|
||||||
#[Url]
|
#[Url]
|
||||||
#[Session]
|
|
||||||
public array $sptVersions = [];
|
public array $sptVersions = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The featured filter value.
|
* The featured filter value.
|
||||||
*/
|
*/
|
||||||
#[Url]
|
#[Url]
|
||||||
#[Session]
|
|
||||||
public string $featured = 'include';
|
public string $featured = 'include';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -102,9 +97,6 @@ class Index extends Component
|
|||||||
$this->query = '';
|
$this->query = '';
|
||||||
$this->sptVersions = $this->getLatestMinorVersions()->pluck('version')->toArray();
|
$this->sptVersions = $this->getLatestMinorVersions()->pluck('version')->toArray();
|
||||||
$this->featured = 'include';
|
$this->featured = 'include';
|
||||||
|
|
||||||
// Clear local storage
|
|
||||||
$this->dispatch('clear-filters');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -88,16 +88,19 @@ class ModListSection extends Component
|
|||||||
'title' => __('Featured Mods'),
|
'title' => __('Featured Mods'),
|
||||||
'mods' => $this->modsFeatured,
|
'mods' => $this->modsFeatured,
|
||||||
'versionScope' => 'latestVersion',
|
'versionScope' => 'latestVersion',
|
||||||
|
'link' => '/mods?featured=only',
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'title' => __('Newest Mods'),
|
'title' => __('Newest Mods'),
|
||||||
'mods' => $this->modsLatest,
|
'mods' => $this->modsLatest,
|
||||||
'versionScope' => 'latestVersion',
|
'versionScope' => 'latestVersion',
|
||||||
|
'link' => '/mods',
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'title' => __('Recently Updated Mods'),
|
'title' => __('Recently Updated Mods'),
|
||||||
'mods' => $this->modsUpdated,
|
'mods' => $this->modsUpdated,
|
||||||
'versionScope' => 'lastUpdatedVersion',
|
'versionScope' => 'lastUpdatedVersion',
|
||||||
|
'link' => '/mods?order=updated',
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ class DatabaseSeeder extends Seeder
|
|||||||
// how many of each "thing" to make during seeding
|
// how many of each "thing" to make during seeding
|
||||||
$userCount = 100;
|
$userCount = 100;
|
||||||
$modCount = 300;
|
$modCount = 300;
|
||||||
$modVersionCount = 500;
|
$modVersionCount = 3000;
|
||||||
|
|
||||||
// Create a few SPT versions.
|
// Create a few SPT versions.
|
||||||
$spt_versions = SptVersion::factory(30)->create();
|
$spt_versions = SptVersion::factory(30)->create();
|
||||||
|
@ -1,10 +1,6 @@
|
|||||||
@props(['mods', 'versionScope', 'title'])
|
@props(['mods', 'versionScope', 'title', 'link'])
|
||||||
|
|
||||||
<div class="mx-auto max-w-7xl px-4 pt-16 sm:px-6 lg:px-8">
|
<div class="mx-auto max-w-7xl px-4 pt-16 sm:px-6 lg:px-8">
|
||||||
{{--
|
<x-page-content-title :title="$title" button-text="View All" :button-link="$link" />
|
||||||
TODO: The button-link should be dynamic based on the versionScope. Eg. Featured `View All` button should take
|
|
||||||
the user to the mods page with the `featured` query parameter set.
|
|
||||||
--}}
|
|
||||||
<x-page-content-title :title="$title" button-text="View All" button-link="/mods" />
|
|
||||||
<x-mod-list :mods="$mods" :versionScope="$versionScope" />
|
<x-mod-list :mods="$mods" :versionScope="$versionScope" />
|
||||||
</div>
|
</div>
|
||||||
|
@ -3,5 +3,6 @@
|
|||||||
'title' => $section['title'],
|
'title' => $section['title'],
|
||||||
'mods' => $section['mods'],
|
'mods' => $section['mods'],
|
||||||
'versionScope' => $section['versionScope'],
|
'versionScope' => $section['versionScope'],
|
||||||
|
'link' => $section['link']
|
||||||
])
|
])
|
||||||
@endforeach
|
@endforeach
|
||||||
|
@ -1,18 +1,32 @@
|
|||||||
<p {{ $attributes->class(['text-slate-700 dark:text-gray-300 text-sm']) }}>
|
<p {{ $attributes->class(['text-slate-700 dark:text-gray-300 text-sm']) }}>
|
||||||
<span title="{{ __('Exactly') }} {{ $mod->downloads }}">{{ Number::downloads($mod->downloads) }} downloads</span>
|
<div class="flex items-end w-full text-sm">
|
||||||
@if(!is_null($mod->created_at))
|
<div class="flex items-end w-full">
|
||||||
<span>
|
<div class="flex items-center gap-1">
|
||||||
— Created
|
<svg width="20" height="20" fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||||
<time datetime="{{ $mod->created_at->format('c') }}">
|
<path d="M21 8.5v9.25A3.25 3.25 0 0 1 17.75 21H6.25A3.25 3.25 0 0 1 3 17.75V8.5h18ZM7.25 15a1.25 1.25 0 1 0 0 2.5 1.25 1.25 0 0 0 0-2.5ZM12 15a1.25 1.25 0 1 0 0 2.5 1.25 1.25 0 0 0 0-2.5Zm-4.75-4.5a1.25 1.25 0 1 0 0 2.5 1.25 1.25 0 0 0 0-2.5Zm4.75 0a1.25 1.25 0 1 0 0 2.5 1.25 1.25 0 0 0 0-2.5Zm4.75 0a1.25 1.25 0 1 0 0 2.5 1.25 1.25 0 0 0 0-2.5Zm1-7.5A3.25 3.25 0 0 1 21 6.25V7H3v-.75A3.25 3.25 0 0 1 6.25 3h11.5Z"/>
|
||||||
{{ Carbon::dynamicFormat($mod->created_at) }}
|
</svg>
|
||||||
</time>
|
<span>
|
||||||
</span>
|
@if(!is_null($mod->updated_at))
|
||||||
@elseif(!is_null($modVersion->updated_at))
|
<time datetime="{{ $modVersion->updated_at->format('c') }}">
|
||||||
<span>
|
{{ Carbon::dynamicFormat($modVersion->updated_at) }}
|
||||||
— Updated
|
</time>
|
||||||
<time datetime="{{ $modVersion->updated_at->format('c') }}">
|
@elseif(!is_null($mod->created_at))
|
||||||
{{ Carbon::dynamicFormat($modVersion->updated_at) }}
|
<time datetime="{{ $modVersion->created_at->format('c') }}">
|
||||||
</time>
|
{{ Carbon::dynamicFormat($modVersion->created_at) }}
|
||||||
</span>
|
</time>
|
||||||
@endif
|
@else
|
||||||
|
N/A
|
||||||
|
@endif
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex justify-end items-center gap-1">
|
||||||
|
<span title="{{ __('Exactly') }} {{ $mod->downloads }}">
|
||||||
|
{{ Number::downloads($mod->downloads) }}
|
||||||
|
</span>
|
||||||
|
<svg width="20" height="20" fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M5.25 20.5h13.498a.75.75 0 0 1 .101 1.493l-.101.007H5.25a.75.75 0 0 1-.102-1.494l.102-.006h13.498H5.25Zm6.633-18.498L12 1.995a1 1 0 0 1 .993.883l.007.117v12.59l3.294-3.293a1 1 0 0 1 1.32-.083l.094.084a1 1 0 0 1 .083 1.32l-.083.094-4.997 4.996a1 1 0 0 1-1.32.084l-.094-.083-5.004-4.997a1 1 0 0 1 1.32-1.498l.094.083L11 15.58V2.995a1 1 0 0 1 .883-.993L12 1.995l-.117.007Z"/>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</p>
|
</p>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user