feat: skinline tags

This commit is contained in:
Rico van Zelst
2023-11-07 13:16:46 +01:00
parent aea82ff0f6
commit ab15e38ac0
3 changed files with 45 additions and 16 deletions

View File

@@ -10,14 +10,15 @@ class HomeController extends Controller
public function index()
{
$upcomingSkins = Cache::remember('upcomingSkins_home', 60 * 4, function () {
return ChampionSkin::where('availability', 'Upcoming')->orderBy('release_date', 'desc')->get();
return ChampionSkin::where('availability', 'Upcoming')
->orderBy('release_date', 'desc')->get();
});
$latestSkins = Cache::remember('latestSkins_home', 60 * 4, function () {
return ChampionSkin::where('availability', 'Available')->orderBy('release_date', 'desc')->take(9)->get();
return ChampionSkin::where('availability', 'Available')
->orderBy('release_date', 'desc')->take(9)->get();
});
return view('home', [
'latestSkins' => $latestSkins,
'upcomingSkins' => $upcomingSkins,

View File

@@ -1,5 +1,6 @@
@php use Carbon\Carbon; @endphp
<?php /** @var App\Models\ChampionSkin $skin */ ?>
<?php
/** @var App\Models\ChampionSkin $skin */ ?>
<section class="text-white bg-stone-900">
<div class="max-w-screen-xl px-4 py-8 mx-auto sm:py-12 sm:px-6 lg:py-16 lg:px-8">
@@ -30,19 +31,31 @@
'join' => true,
]) }}
</h3>
<p class="mt-1 text-sm text-stone-300">
@foreach($skin->associated_skinline as $skinline)
<span class="sr-only">Associated Skinline:</span>
<span
class="my-2 bg-orange-100 text-orange-800 text-xs font-medium
mr-2 px-2.5 py-0.5 rounded
border border-orange-300
">
{{$skinline}}</span>
@endforeach
<p class=" text-sm text-stone-300">
@if ($skin->rp_price == '99999')
Not Available for RP
@else
{{ $skin->rp_price }} RP
@endif
</p>
</p>
<p class="mt-1 text-sm italic text-stone-300">
@if ($skin->loot_eligible)
<p class="mt-1 text-sm italic text-stone-300">
Can be obtained from loot
@endif
</p>
@endif
</div>
</div>
</div>

View File

@@ -25,18 +25,33 @@
alt="{{ $skin->skin_name }} Splash Art">
<div class="flex flex-col items-center justify-center">
<h2 class="mt-4 text-xl font-bold text-white">{{ $skin->skin_name }}</h2>
<p class="mt-1 text-sm text-stone-300">
<div class="my-1 ">
<span class="sr-only">Associated Skinline:</span>
@foreach($skin->associated_skinline as $skinline)
<span
class="bg-orange-100 text-orange-800 text-xs font-medium
@if(!$loop->last) mr-2 @endif px-2.5 rounded
border border-orange-300
">
{{$skinline}}</span>
@endforeach
</div>
<p class="text-sm text-stone-300">
@if ($skin->rp_price == '99999')
Not Available for RP
@else
{{ $skin->rp_price }} RP
@endif
</p>
<p class="mt-1 text-sm italic text-stone-300">
@if ($skin->loot_eligible)
<p class="mt-1 text-sm italic text-stone-300">
Can be obtained from loot
@endif
</p>
@endif
</div>
</div>
</div>