mirror of
https://github.com/sp-tarkov/forge.git
synced 2025-02-12 20:20:41 -05:00
Mod Teaser Updates
- Updates the import script to import the full mod teaser text, up to 255 characters. - Updates mod detail page to show teaser in the main detail card. - Updates mod listing component to show the first 100 characters of the teaser. - Adjusts padding on the mod listing component. Resolves #22
This commit is contained in:
parent
593b44150c
commit
3d5697e04b
@ -633,7 +633,7 @@ class ImportHubData implements ShouldBeUnique, ShouldQueue
|
|||||||
'users' => $modAuthors,
|
'users' => $modAuthors,
|
||||||
'name' => $modContent?->subject ?? '',
|
'name' => $modContent?->subject ?? '',
|
||||||
'slug' => Str::slug($modContent?->subject ?? ''),
|
'slug' => Str::slug($modContent?->subject ?? ''),
|
||||||
'teaser' => Str::limit($modContent?->teaser ?? ''),
|
'teaser' => Str::limit($modContent?->teaser ?? '', 255),
|
||||||
'description' => $this->cleanHubContent($modContent?->message ?? ''),
|
'description' => $this->cleanHubContent($modContent?->message ?? ''),
|
||||||
'thumbnail' => $this->fetchModThumbnail($curl, $mod->fileID, $mod->iconHash, $mod->iconExtension),
|
'thumbnail' => $this->fetchModThumbnail($curl, $mod->fileID, $mod->iconHash, $mod->iconExtension),
|
||||||
'license_id' => License::whereHubId($mod->licenseID)->value('id'),
|
'license_id' => License::whereHubId($mod->licenseID)->value('id'),
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col w-full justify-between p-5">
|
<div class="flex flex-col w-full justify-between p-5">
|
||||||
<div>
|
<div class="pb-3">
|
||||||
<div class="flex justify-between items-center space-x-3">
|
<div class="flex justify-between items-center space-x-3">
|
||||||
<h3 class="block mt-1 text-lg leading-tight font-medium text-black dark:text-white group-hover:underline">{{ $mod->name }}</h3>
|
<h3 class="block mt-1 text-lg leading-tight font-medium text-black dark:text-white group-hover:underline">{{ $mod->name }}</h3>
|
||||||
<span class="badge-version {{ $mod->{$versionScope}->sptVersion->color_class }} inline-flex items-center rounded-md px-2 py-1 text-xs font-medium text-nowrap">
|
<span class="badge-version {{ $mod->{$versionScope}->sptVersion->color_class }} inline-flex items-center rounded-md px-2 py-1 text-xs font-medium text-nowrap">
|
||||||
@ -24,7 +24,7 @@
|
|||||||
<p class="text-sm italic text-slate-600 dark:text-gray-200">
|
<p class="text-sm italic text-slate-600 dark:text-gray-200">
|
||||||
By {{ $mod->users->pluck('name')->implode(', ') }}
|
By {{ $mod->users->pluck('name')->implode(', ') }}
|
||||||
</p>
|
</p>
|
||||||
<p class="mt-2 text-slate-500 dark:text-gray-300">{{ $mod->teaser }}</p>
|
<p class="mt-2 text-slate-500 dark:text-gray-300">{{ Str::limit($mod->teaser, 100) }}</p>
|
||||||
</div>
|
</div>
|
||||||
<x-mod-list-stats :mod="$mod" :modVersion="$mod->{$versionScope}"/>
|
<x-mod-list-stats :mod="$mod" :modVersion="$mod->{$versionScope}"/>
|
||||||
</div>
|
</div>
|
||||||
|
@ -43,16 +43,21 @@
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{{-- Mod teaser --}}
|
||||||
|
@if ($mod->teaser)
|
||||||
|
<p class="mt-6 pt-3 border-t-2 border-gray-200 dark:border-gray-800 text-gray-800 dark:text-gray-200">{{ $mod->teaser }}</p>
|
||||||
|
@endif
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{{-- Mobile Download Button --}}
|
||||||
|
<a href="{{ $latestVersion->link }}" class="block lg:hidden">
|
||||||
|
<button class="text-lg font-extrabold hover:bg-cyan-400 dark:hover:bg-cyan-600 shadow-md dark:shadow-gray-950 drop-shadow-2xl bg-cyan-500 dark:bg-cyan-700 rounded-xl w-full h-20">{{ __('Download Latest Version') }} ({{ $latestVersion->version }})</button>
|
||||||
|
</a>
|
||||||
|
|
||||||
{{-- Tabs --}}
|
{{-- Tabs --}}
|
||||||
<div x-data="{ selectedTab: window.location.hash ? window.location.hash.substring(1) : 'description' }" x-init="$watch('selectedTab', (tab) => {window.location.hash = tab})" class="lg:col-span-2 flex flex-col gap-6">
|
<div x-data="{ selectedTab: window.location.hash ? window.location.hash.substring(1) : 'description' }" x-init="$watch('selectedTab', (tab) => {window.location.hash = tab})" class="lg:col-span-2 flex flex-col gap-6">
|
||||||
<div>
|
<div>
|
||||||
{{-- Mobile Download Button --}}
|
|
||||||
<a href="{{ $latestVersion->link }}" class="block lg:hidden mb-6">
|
|
||||||
<button class="text-lg font-extrabold hover:bg-cyan-400 dark:hover:bg-cyan-600 shadow-md dark:shadow-gray-950 drop-shadow-2xl bg-cyan-500 dark:bg-cyan-700 rounded-xl w-full h-20">{{ __('Download Latest Version') }} ({{ $latestVersion->version }})</button>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
{{-- Mobile Dropdown --}}
|
{{-- Mobile Dropdown --}}
|
||||||
<div class="sm:hidden">
|
<div class="sm:hidden">
|
||||||
<label for="tabs" class="sr-only">{{ __('Select a tab') }}</label>
|
<label for="tabs" class="sr-only">{{ __('Select a tab') }}</label>
|
||||||
@ -84,7 +89,7 @@
|
|||||||
|
|
||||||
{{-- Mod Description --}}
|
{{-- Mod Description --}}
|
||||||
<div x-show="selectedTab === 'description'" class="user-markdown p-4 sm:p-6 bg-white dark:bg-gray-950 rounded-xl shadow-md dark:shadow-gray-950 drop-shadow-2xl">
|
<div x-show="selectedTab === 'description'" class="user-markdown p-4 sm:p-6 bg-white dark:bg-gray-950 rounded-xl shadow-md dark:shadow-gray-950 drop-shadow-2xl">
|
||||||
{{-- The description below is safe to write directly because it has been run though HTMLPurifier during the import process. --}}
|
{{-- The description below is safe to write directly because it has been run though HTMLPurifier. --}}
|
||||||
{!! Str::markdown($mod->description) !!}
|
{!! Str::markdown($mod->description) !!}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user