This commit is contained in:
Constantin Plaiasu 2024-08-30 20:38:24 +03:00
parent 6eab26d677
commit 782b1dd3b4
2 changed files with 32 additions and 11 deletions

View file

@ -46,7 +46,7 @@ public function index(TmdbClient $tmdb, ApiClient $api, int $id, string $slug)
$meta['description'] = Str::limit(Str::replace(['{OVERVIEW}'], [$data['overview']], config('site.shows.detail.description')), 150); $meta['description'] = Str::limit(Str::replace(['{OVERVIEW}'], [$data['overview']], config('site.shows.detail.description')), 150);
$meta['keywords'] = config('site.shows.detail.keywords', ''); $meta['keywords'] = config('site.shows.detail.keywords', '');
$is_show_page = false; $is_show_page = true;
$show = $data; $show = $data;
// dd($season); // dd($season);
$season = false; $season = false;

View file

@ -68,7 +68,7 @@
<span class="movie-widget"> <span class="movie-widget">
<i class="lar la-star base--color"></i> <i class="lar la-star base--color"></i>
<span>{{$show['vote_average']}}</span> <span>{{ $episode['vote_average'] ?? $season['vote_average'] ?? $show['vote_average'] }}</span>
</span> </span>
<span class="movie-widget"> <span class="movie-widget">
@ -104,7 +104,7 @@
<div class="row"> <div class="row">
<div class="col-lg-6"> <div class="col-lg-6">
<h4 class="mb-3">Details</h4> <h4 class="mb-3">Details</h4>
<p>{{ $show['overview'] }}</p> <p>{{ $episode['overview'] ?? $season['overview'] ?? $show['overview'] }}</p>
<ul class="movie-details-list mt-3"> <ul class="movie-details-list mt-3">
<li> <li>
@ -131,9 +131,20 @@
<li> <li>
<span class="caption">Cast:</span> <span class="caption">Cast:</span>
<span class="value"> <span class="value">
@foreach($show['cast'] as $actor) @if ($episode && !empty($episode['cast']))
<a href="{{ route('person', ['person_id' => $actor['id'], 'slug' => $actor['slug']]) }}">{{ $actor['name'] }}</a> @if(!$loop->last), @endif @foreach($episode['cast'] as $actor)
@endforeach</span> <a href="{{ route('person', ['person_id' => $actor['id'], 'slug' => $actor['slug']]) }}">{{ $actor['name'] }}</a> @if(!$loop->last), @endif
@endforeach
@elseif ($season && !empty($season['cast']) && !$is_show_page)
@foreach($season['cast'] as $actor)
<a href="{{ route('person', ['person_id' => $actor['id'], 'slug' => $actor['slug']]) }}">{{ $actor['name'] }}</a> @if(!$loop->last), @endif
@endforeach
@else
@foreach($show['cast'] as $actor)
<a href="{{ route('person', ['person_id' => $actor['id'], 'slug' => $actor['slug']]) }}">{{ $actor['name'] }}</a> @if(!$loop->last), @endif
@endforeach
@endif
</span>
</li> </li>
<li> <li>
<span class="caption">Creator:</span> <span class="caption">Creator:</span>
@ -143,16 +154,26 @@
@endforeach @endforeach
</span> </span>
</li> </li>
@unless (empty($show['crew']['producers'])) @if (($episode && !empty($episode['crew']['producers'])) || ($season && !empty($season['crew']['producers'])) || empty($show['crew']['producers']))
<li> <li>
<span class="caption">Producer:</span> <span class="caption">Producer:</span>
<span class="value"> <span class="value">
@if ($episode && !empty($episode['crew']['producers']))
@foreach($episode['crew']['producers'] as $actor)
{{ $actor['name'] }}@if(!$loop->last), @endif
@endforeach
@elseif ($season && !empty($season['crew']['producers']) && !$is_show_page)
@foreach($season['crew']['producers'] as $actor)
{{ $actor['name'] }}@if(!$loop->last), @endif
@endforeach
@else
@foreach($show['crew']['producers'] as $actor) @foreach($show['crew']['producers'] as $actor)
{{ $actor['name'] }}@if(!$loop->last), @endif {{ $actor['name'] }}@if(!$loop->last), @endif
@endforeach</span> @endforeach
</li> @endif
@endunless </span>
</li>
@endif
</ul> </ul>