mirror of
https://github.com/sp-tarkov/forge.git
synced 2025-02-13 04:30:41 -05:00
update version tab info
This commit is contained in:
parent
75a7e15184
commit
b429300b7b
@ -6,6 +6,7 @@ use App\Http\Requests\ModRequest;
|
|||||||
use App\Http\Resources\ModResource;
|
use App\Http\Resources\ModResource;
|
||||||
use App\Models\Mod;
|
use App\Models\Mod;
|
||||||
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
|
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
|
||||||
|
use Illuminate\Support\Facades\Log;
|
||||||
|
|
||||||
class ModController extends Controller
|
class ModController extends Controller
|
||||||
{
|
{
|
||||||
@ -29,7 +30,12 @@ class ModController extends Controller
|
|||||||
{
|
{
|
||||||
$mod = Mod::select()
|
$mod = Mod::select()
|
||||||
->withTotalDownloads()
|
->withTotalDownloads()
|
||||||
->with(['latestSptVersion', 'users:id,name'])
|
->with([
|
||||||
|
'versions' => fn($query) => $query->orderByDesc('version'),
|
||||||
|
'latestSptVersion',
|
||||||
|
'users:id,name',
|
||||||
|
'license:id,name,link'
|
||||||
|
])
|
||||||
->with('license:id,name,link')
|
->with('license:id,name,link')
|
||||||
->find($modId);
|
->find($modId);
|
||||||
|
|
||||||
|
@ -78,21 +78,40 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{-- tab panels --}}
|
{{-- tab panels --}}
|
||||||
|
{{-- Description --}}
|
||||||
<div x-show="selectedTab === '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">
|
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 during the import process. --}}
|
||||||
<p>{!! Str::markdown($mod->description) !!}</p>
|
<p>{!! Str::markdown($mod->description) !!}</p>
|
||||||
</div>
|
</div>
|
||||||
|
{{-- Versions --}}
|
||||||
<div x-show="selectedTab === 'versions'"
|
<div x-show="selectedTab === 'versions'"
|
||||||
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">
|
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">
|
||||||
@for($i = 0;$i < $mod->versions->count(); $i++)
|
@foreach($mod->versions as $version)
|
||||||
<div class="bg-gray-700">
|
@if(!$version->disabled)
|
||||||
<p>{{$mod->versions[$i]->id}}</p>
|
<div class="bg-gray-800 rounded-xl mb-2">
|
||||||
<p>{{$mod->versions[$i]->version}}</p>
|
<div class="border-b-2 border-gray-700">
|
||||||
<p>{{$mod->versions[$i]->description}}</p>
|
<div class="p-4">
|
||||||
|
<div class="flex items-center justify-between">
|
||||||
|
<a class="text-2xl" href="{{ $version->link }}">
|
||||||
|
Version {{$version->version}}
|
||||||
|
</a>
|
||||||
|
<p class="text-gray-700">{{ Number::forhumans($version->downloads) }} Downloads</p>
|
||||||
</div>
|
</div>
|
||||||
@endfor
|
<div class="flex items-center justify-between text-gray-400">
|
||||||
|
<span>Created {{ \Carbon\Carbon::parse($version->created_at)->format("M d, h:m a") }}</span>
|
||||||
|
<span>Last Updated {{ \Carbon\Carbon::parse($version->updated_at)->format("M d, h:m a") }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="p-4">
|
||||||
|
<p>{{$version->description}}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
{{-- Comments --}}
|
||||||
<div x-show="selectedTab === 'comments'"
|
<div x-show="selectedTab === 'comments'"
|
||||||
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">
|
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">
|
||||||
<p>The comments go here</p>
|
<p>The comments go here</p>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user