{{ __('admin::lang.Content Items') }} {{ collect($contents)->count() }}
@if(count($contents) > 0) @if($viewMode === 'grid')
@foreach($contents as $item)
@php $deviceImages = []; @endphp @if(isset($item->content_type) && $item->content_type === 'product') @php $product = $item->displayable_product; @endphp @if($product && $product->image_path) {{ $product->title }} @else
@endif @elseif(isset($item->content_type) && $item->content_type === 'category') @php $category = $item->displayable_category; @endphp @if($category && $category->image) {{ $category->title }} @else
@endif @else @php $deviceImages = [ 'desktop' => $item->desktop_image_url, 'tablet' => $item->tablet_image_url, 'mobile' => $item->mobile_image_url, ]; @endphp @if($deviceImages['desktop'] || $deviceImages['tablet'] || $deviceImages['mobile']) @else
@endif @endif
@foreach([ 'desktop' => ['fe-monitor', 'admin::lang.Desktop'], 'tablet' => ['fe-tablet', 'admin::lang.Tablet'], 'mobile' => ['fe-smartphone', 'admin::lang.Mobile'], ] as $deviceKey => [$icon, $label]) @if(isset($deviceImages) && ($deviceImages[$deviceKey] ?? null)) @endif @endforeach
@if($item->status->value === 'active') {{ $item->status->label() }} @elseif($item->status->value === 'scheduled') {{ $item->status->label() }} @else {{ $item->status->label() }} @endif
@if(isset($item->content_type) && $item->content_type === 'product') @php $product = $item->displayable_product; @endphp
{{ $product ? $product->title : 'N/A' }}
@elseif(isset($item->content_type) && $item->content_type === 'category') @php $category = $item->displayable_category; @endphp
{{ $category ? $category->title : 'N/A' }}
@else
{{ $item->name }}
@endif {{ $item->priority }}
{{ $item->start_date ? $item->start_date->format('Y-m-d') : __('admin::lang.No date') }}
@endforeach
@else
@foreach($contents as $item) @endforeach
{{ __('admin::lang.Preview') }} {{ __('admin::lang.Details') }} {{ __('admin::lang.Status') }} {{ __('admin::lang.Schedule') }} {{ __('admin::lang.Priority') }} {{ __('admin::lang.Actions') }}
@if(isset($item->content_type) && $item->content_type === 'product') @php $product = $item->displayable_product; @endphp @if($product && $product->image_path) {{ $product->title }} @else
@endif @elseif(isset($item->content_type) && $item->content_type === 'category') @php $category = $item->displayable_category; @endphp @if($category && $category->image) {{ $category->title }} @else
@endif @elseif(isset($item->content_type) && $item->content_type === 'merchant') @php $merchant = $item->displayable_merchant; @endphp @if($merchant && $merchant->logo) {{ $merchant->name }} @else
@endif @else @php $tabletDeviceImages = [ 'desktop' => $item->desktop_image_url, 'tablet' => $item->tablet_image_url, 'mobile' => $item->mobile_image_url, ]; @endphp
@foreach([ 'desktop' => 'fe-monitor', 'tablet' => 'fe-tablet', 'mobile' => 'fe-smartphone', ] as $deviceKey => $icon) @if($tabletDeviceImages[$deviceKey] ?? null) @endif @endforeach
@endif
@if(isset($item->content_type) && $item->content_type === 'product') @php $product = $item->displayable_product; @endphp
{{ $product ? $product->title : 'N/A' }}
Product ID: {{ $item->product_id }} @elseif(isset($item->content_type) && $item->content_type === 'category') @php $category = $item->displayable_category; @endphp
{{ $category ? $category->title : 'N/A' }}
Category ID: {{ $item->category_id }} @elseif(isset($item->content_type) && $item->content_type === 'merchant') @php $merchant = $item->displayable_merchant; @endphp
{{ $merchant ? $merchant->name : 'N/A' }}
Merchant ID: {{ $item->merchant_id }} @else
{{ $item->name }}
{{ isset($item->title) ? Str::limit($item->title, 60) : '' }} @endif
@if($item->status->value == 'active') {{ $item->status->label() }} @elseif($item->status->value == 'scheduled') {{ $item->status->label() }} @else {{ $item->status->label() }} @endif @if($item->start_date)
{{ $item->start_date->format('Y-m-d') }} @if($item->end_date) {{ $item->end_date->format('Y-m-d') }} @endif
@else - @endif
{{ $item->priority }}
@endif @else
{{ __('admin::lang.No content items found') }}

{{ __('admin::lang.Add your first item to this placement') }}

@endif @push('js') @endpush @push('css') @endpush