@extends('admin.layouts.container')

@section('content')
<div class="side-title">
    <h3>{{ $head ?? ''}}</h3>
</div>

<div class="border-item">
    <form class="form-row" method="post" action="{{ $action }}" enctype="multipart/form-data">
        
        @if($slider ?? ''  && $slider->id)
            @method('PUT')
        @endif
        @csrf
       

<div class="form-group col-lg-6">
            <label>{{ __('products.link')}} </label>
            <input type="text" name="link" id="link"  class="form-control {{ $errors->has('link') ? 'is-invalid' : '' }}" placeholder="{{ __('products.link')}}" value='{{ old("link", $product->link ?? "") }}'>
        </div>
 <div class="form-group col-lg-6">
            <h5>{{ meta('show', getCurrentLocale()) ?? __('products.show') }}</h5>
            
            <div class="row">
              <div class="form-group col-lg-3">
            <input  name="show" type="radio"  @if($slider ?? ''  && $slider->id) @if($slider->show == 'yes') checked @endif @else checked  @endif value="yes"> {{__('products.yes')}}
            </div>
            <div class="form-group col-lg-6">
            <input  name="show" type="radio" @if($slider ?? ''  && $bannervideo->id) @if($slider->show == 'no') checked @endif  @endif value="no"> {{__('products.no')}}
          </div>
          </div>
        </div>
<div class="form-group col-lg-12 banner_container">
            <label>{{ meta('image', getCurrentLocale()) ?? __('products.image') }} </label>
            <input id="banner_thumbnail" class="banner_thumbnail" type="hidden" name="image" value="{{old("image", $product->image ?? "")}}"/>

            <div class="photos mainbanner_photo {{ old('image', $product->image ?? '') ? ' wow fadeInUp' : 'hide' }}">
                <div class="col-md-4">
                    <div class="items">
                        <div class="img">
                            <a href="#" id="lfm" data-input=".banner_thumbnail" data-preview=".banner_holder" class="lfm" data-hide=".pickbanner_button">
                                <img src="{{asset(old('image', $product->image ?? ''))}} "  id="banner_holder" class="banner_holder"/>
                            </a>
                        </div>
                        <a href="#" class="showHide resetImage close" data-empty=".banner_thumbnail" data-hide=".mainbanner_photo" data-show=".pickbanner_button"><i class="fas fa-times"></i></a>
                    </div>
                </div>
            </div>

            <div class="clearfix"></div>
            <span class="input-group-btn pickbanner_button {{ old('image', $product->image ?? '') ? 'hide' : '' }} ">
                <a id="lfm"  data-input=".banner_thumbnail" data-preview=".banner_holder" data-show=".mainbanner_photo" data-hide=".pickbanner_button" class="lfm btn btn-primary text-light">
                    <i class="fas fa-camera-retro"></i> Choose
                </a>
             </span>
        </div>
       
        
        <div class="text-center mt-5 col-12">
            <button class="butn"><span>{{ __('dashboard.save') }}</span></button>
        </div>
    </form>
</div>

@endsection

@section('inner_js')
    <!-- Editor JS files -->
{{--    <script src="{{ asset('/assets/admin/js/lib/tinymce.min.js') }}"></script>--}}
        <script src="//cdn.tinymce.com/4/tinymce.min.js"></script>
    <script>
        let route_prefix = "{{ url(config('lfm.prefix')) }}",
            url = "{{url('/')}}/",
            currentLanguage = "{{getCurrentLocale()}}",
            imagePath = "{{asset('')}}";
    </script>
    <script src="{{ asset('assets/admin/js/editor.js') }}"></script>
    <script src="{{ asset('assets/admin/js/lfm.js') }}"></script>
    <script src="{{ asset('assets/admin/js/articles.js') }}"></script>
@endsection



