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['keywords'] = config('site.shows.detail.keywords', '');
$is_show_page = false;
$is_show_page = true;
$show = $data;
// dd($season);
$season = false;

View file

@ -68,7 +68,7 @@
<span class="movie-widget">
<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 class="movie-widget">
@ -104,7 +104,7 @@
<div class="row">
<div class="col-lg-6">
<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">
<li>
@ -131,9 +131,20 @@
<li>
<span class="caption">Cast:</span>
<span class="value">
@foreach($show['cast'] as $actor)
<a href="{{ route('person', ['person_id' => $actor['id'], 'slug' => $actor['slug']]) }}">{{ $actor['name'] }}</a> @if(!$loop->last), @endif
@endforeach</span>
@if ($episode && !empty($episode['cast']))
@foreach($episode['cast'] as $actor)
<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>
<span class="caption">Creator:</span>
@ -143,16 +154,26 @@
@endforeach
</span>
</li>
@unless (empty($show['crew']['producers']))
@if (($episode && !empty($episode['crew']['producers'])) || ($season && !empty($season['crew']['producers'])) || empty($show['crew']['producers']))
<li>
<span class="caption">Producer:</span>
<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)
{{ $actor['name'] }}@if(!$loop->last), @endif
@endforeach</span>
</li>
@endunless
@endforeach
@endif
</span>
</li>
@endif
</ul>