@extends('layouts.previews.crownPlaza')
@php
use App\Enums\ElementType;
use App\Enums\TopElementDefault;
use App\Enums\CustomElementType;
use App\Enums\MultiLangMode;
use App\Enums\FvType;
use App\Enums\NewsElementDefault;
$listImagePc = [];
$listImageSp = [];
for ($i = 1; $i <= 3; $i++) {
if (!empty($project->topPage['slide_image_pc' . $i])) {
$listImagePc[] = $project->topPage['slide_image_pc' . $i];
}
if (!empty($project->topPage['slide_image_sp' . $i])) {
$listImageSp[] = $project->topPage['slide_image_sp' . $i];
}
}
if (count($listImageSp) == 0) {
$listImageSp = $listImagePc;
}
@endphp
@section('content')
{{-- @include('preview.crownPlaza.commons.boxSearch') --}}
@if (fieldPropertyValue('fv_type', $project->topPage) == FvType::MOVIE)
{!! fieldPropertyValue('movie_tag', $project->topPage) !!}
@else
@for ($i = 0; $i < count($listImagePc); $i++)
@endfor
@endif
@if (fieldPropertyValue('fv_type_sp', $project->topPage) == FvType::MOVIE)
{!! fieldPropertyValue('movie_tag_sp', $project->topPage) !!}
@else
@for ($i = 0; $i < count($listImageSp); $i++)
@endfor
@endif
@foreach ($elements as $item)
@if (fieldPropertyValue('element_type', $item) == ElementType::DEFAULT &&
fieldPropertyValue('default_element_type', $item) == TopElementDefault::INSTAGRAM)
@include('preview.crownPlaza.defaults.tops.instagram')
@endif
@if (fieldPropertyValue('status', $item))
@if (fieldPropertyValue('element_type', $item) == ElementType::DEFAULT)
@switch(fieldPropertyValue('default_element_type', $item))
@case(TopElementDefault::PICKUP)
@include('preview.crownPlaza.defaults.tops.pickup')
@break
@case(TopElementDefault::CONCEPT)
@include('preview.crownPlaza.defaults.tops.concept')
@break
@case(TopElementDefault::ROOM)
@include('preview.crownPlaza.defaults.tops.room')
@break
@case(TopElementDefault::PLAN)
@include('preview.crownPlaza.commons.plan')
@break
@case(TopElementDefault::RESTAURANT)
@include('preview.crownPlaza.defaults.tops.restaurant')
@break
@case(TopElementDefault::BANQUET)
@include('preview.crownPlaza.defaults.tops.banquet')
@break
@case(TopElementDefault::CV_NEXT)
@php
$reserve = $item;
@endphp
@break
@endswitch
@endif
@endif
@if (textLocale('status', $item, $lang) &&
fieldPropertyValue('custom_element_type', $item) >= CustomElementType::ONE_COLUMN &&
fieldPropertyValue('custom_element_type', $item) <= CustomElementType::SIDE_CONTENT_V2)
@include('preview.customs.customContent')
@endif
@endforeach
@if (!empty($reserve))
@include('preview.crownPlaza.commons.reserve')
@endif
@endsection