@extends($_layout.'main') {{-- khai báo title --}} @section('title', ($style?'Cập nhật':'Tạo').' Style Sample') {{-- tên modul xuất hiện trong sub header --}} @section('module.name', "Style Sample") {{-- Nội dung --}} @section('content')
{{--

Cập nhật Style mẫu

--}}
@csrf @if ($style) @endif

{{$style?'Cập nhật':'Tạo'}} style Sample

@if ($errors->first())
Có vẻ như bạn chưa điền đầy đủ thông tin. Vui lòng kiểm tra lại thông tin của mỗi loại item
@endif
@if ($errors->has('thumbnail'))
{{$errors->first('thumbnail')}}
@endif
@if (count($templateDetail->itemConfigs)) @php $frameWidth = $templateDetail->width; $frameHeight = $templateDetail->height; @endphp @foreach ($templateDetail->itemConfigs as $item) @php $previewConfig = $item->preview_config; $width = $previewConfig['width'] && $previewConfig['width'] > 0?$previewConfig['width']:1; $height = $previewConfig['height'] && $previewConfig['height'] > 0?$previewConfig['height']:1; $oldItemId = old('items.'.$item->id, 0); @endphp
@endforeach @endif
@if ($errors->has('name'))
{{$errors->first('name')}}
@endif
    @if (count($templateDetail->itemConfigs)) @foreach ($templateDetail->itemConfigs as $item)
  • {{$item->itemConfig->name}}
  • @endforeach @endif
@if (count($templateDetail->itemConfigs)) @foreach ($templateDetail->itemConfigs as $item) @php $previewConfig = $item->preview_config; $width = $previewConfig['width'] && $previewConfig['width'] > 0?$previewConfig['width']:1; $height = $previewConfig['height'] && $previewConfig['height'] > 0?$previewConfig['height']:1; $ratio = $height/$width * 100; @endphp
@php $oldItemId = old('items.'.$item->id, 0); @endphp @if (is_mobile())
@if (count($item->templateItems)) @foreach ($item->templateItems as $tempItem)
id==$oldItemId || in_array($tempItem->id, $styleItems)) checked @endif>
@endforeach @endif
End
@else
@if (count($item->templateItems)) @foreach ($item->templateItems as $tempItem)
id==$oldItemId || in_array($tempItem->id, $styleItems)) checked @endif>
@endforeach @endif
@endif @if ($errors->has('items.'.$item->id))
{{$errors->first('items.'.$item->id)}}
@endif @php $attr_values = $style && is_array($style->set_data) && ($set_data = $style->set_data) && array_key_exists('attr_values', $set_data) && is_array($set_data['attr_values']) && array_key_exists($item->id, $set_data['attr_values']) ? array_values($set_data['attr_values'][$item->id]) : []; @endphp @include($_current.'attributes', [ 'attributes' => $item->attributes, 'item_id' => $item->id, 'attr_values' => $attr_values ])
@endforeach @if ($errors->has('items'))
{{$errors->first('items')}}
@endif @endif
@endsection {{-- thêm js mà layout chua co --}} @php add_css_link('static/features/style-sets/slick/slick.min.css'); add_css_link('static/features/style-sets/style-form.min.css'); add_js_src('static/features/style-sets/slick/slick.js'); add_js_src('static/features/style-sets/slick/slick-animation.min.js'); add_js_src('static/features/style-sets/style-form.js'); add_js_data('style_template_data', $templateDetail->toArray()) @endphp @section('css') @endsection