@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($about ?? ''  && $about->id)
            @method('PUT')
        @endif
        @csrf

{{--        <div class="form-group col-lg-12">--}}
{{--            <label>{{ meta('video', getCurrentLocale()) ?? __('abouts.video') }} </label>--}}
{{--            <input type="text" class="form-control {{ $errors->has('video') ? 'is-invalid' : '' }}" name="video" placeholder="{{ meta('video', getCurrentLocale()) ?? __('abouts.video') }}" value='{{ old("video", $about->video ?? "") }}'/>--}}
{{--        </div>--}}
        <div class="form-group col-lg-4">
            <label>{{ meta('projects', getCurrentLocale()) ?? __('abouts.projects') }} </label>
            <input type="number" min="1" class="form-control {{ $errors->has('projects') ? 'is-invalid' : '' }}" name="projects" placeholder="{{ meta('projects', getCurrentLocale()) ?? __('abouts.projects') }}" value='{{ old("projects", $about->projects ?? "") }}'/>
        </div>
        <div class="form-group col-lg-4">
            <label>{{ meta('consultation', getCurrentLocale()) ?? __('abouts.consultation') }} </label>
            <input type="number" min="1" class="form-control {{ $errors->has('consultation') ? 'is-invalid' : '' }}" name="consultation" placeholder="{{ meta('consultation', getCurrentLocale()) ?? __('abouts.consultation') }}" value='{{ old("consultation", $about->consultation ?? "") }}'/>
        </div>
        <div class="form-group col-lg-4">
            <label>{{ meta('client', getCurrentLocale()) ?? __('abouts.client') }} </label>
            <input type="number" min="1" class="form-control {{ $errors->has('client') ? 'is-invalid' : '' }}" name="client" placeholder="{{ meta('client', getCurrentLocale()) ?? __('abouts.client') }}" value='{{ old("client", $about->client ?? "") }}'/>
        </div>
        @foreach($languages as $language)
        <div class="form-group col-lg-6">
            <label>{{ meta('first_title', $language->local) ?? __('abouts.first_title') }} {{ count($languages) > 1 ? "({$language->name})" : '' }} </label>
            <input type="text" class="form-control {{ $errors->has('first_title_'.$language->local) ? 'is-invalid' : '' }}" name="first_title_{{ $language->local }}" placeholder="{{ meta('first_title', $language->local) ?? __('abouts.first_title') }}" value='{{ old("first_title_{$language->local}", $about[$language->local]->first_title ?? "") }}'/>
        </div>
        <div class="form-group col-lg-6">
            <label>{{ meta('second_title', $language->local) ?? __('abouts.second_title') }} {{ count($languages) > 1 ? "({$language->name})" : '' }} </label>
            <input type="text" class="form-control {{ $errors->has('second_title_'.$language->local) ? 'is-invalid' : '' }}" name="second_title_{{ $language->local }}" placeholder="{{ meta('second_title', $language->local) ?? __('abouts.second_title') }}" value='{{ old("second_title_{$language->local}", $about[$language->local]->second_title ?? "") }}'/>
        </div>
        <div class="form-group col-lg-4">
            <label>{{ meta('projects_title', $language->local) ?? __('abouts.projects_title') }} {{ count($languages) > 1 ? "({$language->name})" : '' }} </label>
            <input type="text" class="form-control {{ $errors->has('projects_title_'.$language->local) ? 'is-invalid' : '' }}" name="projects_title_{{ $language->local }}" placeholder="{{ meta('projects_title', $language->local) ?? __('abouts.projects_title') }}" value='{{ old("projects_title_{$language->local}", $about[$language->local]->projects_title ?? "") }}'/>
        </div>
        <div class="form-group col-lg-4">
            <label>{{ meta('consultation_title', $language->local) ?? __('abouts.consultation_title') }} {{ count($languages) > 1 ? "({$language->name})" : '' }} </label>
            <input type="text" class="form-control {{ $errors->has('consultation_title_'.$language->local) ? 'is-invalid' : '' }}" name="consultation_title_{{ $language->local }}" placeholder="{{ meta('consultation_title', $language->local) ?? __('abouts.consultation_title') }}" value='{{ old("consultation_title_{$language->local}", $about[$language->local]->consultation_title ?? "") }}'/>
        </div>
        <div class="form-group col-lg-4">
            <label>{{ meta('client_title', $language->local) ?? __('abouts.client_title') }} {{ count($languages) > 1 ? "({$language->name})" : '' }} </label>
            <input type="text" class="form-control {{ $errors->has('client_title_'.$language->local) ? 'is-invalid' : '' }}" name="client_title_{{ $language->local }}" placeholder="{{ meta('client_title', $language->local) ?? __('abouts.client_title') }}" value='{{ old("client_title_{$language->local}", $about[$language->local]->client_title ?? "") }}'/>
        </div>
{{--        <div class="form-group col-lg-6">--}}
{{--            <label>{{ meta('keywords', $language->local) ?? __('abouts.keywords') }} {{ count($languages) > 1 ? "({$language->name})" : '' }} </label>--}}
{{--            <input type="text" class="form-control {{ $errors->has('keywords_'.$language->local) ? 'is-invalid' : '' }}" name="keywords_{{ $language->local }}" placeholder="{{ meta('keywords', $language->local) ?? __('abouts.keywords') }}" value='{{ old("keywords_{$language->local}", $about[$language->local]->keywords ?? "") }}'/>--}}
{{--        </div>--}}
{{--        <div class="form-group col-lg-6">--}}
{{--            <label>{{ meta('meta_description', $language->local) ?? __('abouts.meta_description') }} {{ count($languages) > 1 ? "({$language->name})" : '' }} </label>--}}
{{--            <input type="text" class="form-control {{ $errors->has('meta_description_'.$language->local) ? 'is-invalid' : '' }}" name="meta_description_{{ $language->local }}" placeholder="{{ meta('meta_description', $language->local) ?? __('abouts.meta_description') }}" value='{{ old("meta_description_{$language->local}", $about[$language->local]->meta_description ?? "") }}'/>--}}
{{--        </div>--}}




        <div class="form-group col-lg-12">
            <label>{{ meta('description', $language->local) ?? __('abouts.description') }} {{ count($languages) > 1 ? "({$language->name})" : '' }} </label>
            <textarea name="description_{{ $language->local }}" class="form-control my-editor {{ $errors->has('description_'.$language->local) ? 'is-invalid' : '' }}" placeholder="{{ meta('description', $language->local) ?? __('abouts.description') }}">{{ old("description_{$language->local}", $about[$language->local]->description ?? "") }}</textarea>
        </div>

        @endforeach
        {{--Start projects image container--}}
        <div class="form-group col-lg-3">
            <label>{{ meta('projects_image', getCurrentLocale()) ?? __('abouts.projects_image') }} </label>
            <input id="projects_image_thumbnail" class="projects_image_thumbnail" type="hidden" name="projects_image" value="{{old("projects_image", $about->projects_image ?? "")}}"/>

            <div class="photos over_view_main_photo {{ old('projects_image', $about->projects_image ?? '') ? ' wow fadeInUp' : 'hide' }}">
                <div class="col-lg-12">
                    <div class="items">
                        <div class="img">
                            <a href="#" id="lfm" data-input=".projects_image_thumbnail" data-preview=".projects_image_holder" class="lfm" data-hide=".over_view_pick_button">
                                <img src="{{asset(old('projects_image', $about->projects_image ?? ''))}} "  id="projects_image_holder" class="projects_image_holder"/>
                            </a>
                        </div>
                        <a href="#" class="showHide resetImage close" data-empty=".projects_image_thumbnail" data-hide=".over_view_main_photo" data-show=".over_view_pick_button"><i class="fas fa-times"></i></a>
                    </div>
                </div>
            </div>

            <div class="clearfix"></div>
            <span class="input-group-btn over_view_pick_button {{ old('projects_image', $about->projects_image ?? '') ? 'hide' : '' }} ">
                <a id="lfm" data-input=".projects_image_thumbnail" data-preview=".projects_image_holder" data-show=".over_view_main_photo" data-hide=".over_view_pick_button" class="lfm btn btn-primary text-light">
                    <i class="fas fa-camera-retro"></i> Choose
                </a>
            </span>
        </div>
        {{--End over view image container--}}

        {{--Start consultation image container--}}
        <div class="form-group col-lg-3">
            <label>{{ meta('consultation_image', getCurrentLocale()) ?? __('abouts.consultation_image') }} </label>
            <input id="consultation_image_thumbnail" class="consultation_image_thumbnail" type="hidden" name="consultation_image" value="{{old("consultation_image", $about->consultation_image ?? "")}}"/>

            <div class="photos consultation_main_photo {{ old('consultation_image', $about->consultation_image ?? '') ? ' wow fadeInUp' : 'hide' }}">
                <div class="col-lg-12">
                    <div class="items">
                        <div class="img">
                            <a href="#" id="lfm" data-input=".consultation_image_thumbnail" data-preview=".consultation_image_holder" class="lfm" data-hide=".over_view_pick_button">
                                <img src="{{asset(old('consultation_image', $about->consultation_image ?? ''))}} "  id="consultation_image_holder" class="consultation_image_holder"/>
                            </a>
                        </div>
                        <a href="#" class="showHide resetImage close" data-empty=".consultation_image_thumbnail" data-hide=".consultation_main_photo" data-show=".consultation_pick_button"><i class="fas fa-times"></i></a>
                    </div>
                </div>
            </div>

            <div class="clearfix"></div>
            <span class="input-group-btn consultation_pick_button {{ old('consultation_image', $about->consultation_image ?? '') ? 'hide' : '' }} ">
                <a id="lfm" data-input=".consultation_image_thumbnail" data-preview=".consultation_image_holder" data-show=".consultation_main_photo" data-hide=".consultation_pick_button" class="lfm btn btn-primary text-light">
                    <i class="fas fa-camera-retro"></i> Choose
                </a>
            </span>
        </div>
        {{--End why us image container--}}

        {{--Start client image container--}}
        <div class="form-group col-lg-3">
            <label>{{ meta('client_image', getCurrentLocale()) ?? __('abouts.client_image') }} </label>
            <input id="client_image_thumbnail" class="client_image_thumbnail" type="hidden" name="client_image" value="{{old("client_image", $about->client_image ?? "")}}"/>

            <div class="photos quality_main_photo {{ old('client_image', $about->client_image ?? null) ? ' wow fadeInUp' : 'hide' }}">
                <div class="col-lg-12">
                    <div class="items">
                        <div class="img">
                            <a href="#" id="lfm" data-input=".client_image_thumbnail" data-preview=".client_image_holder" class="lfm" data-hide=".over_view_pick_button">
                                <img src="{{asset(old('client_image', $about->client_image ?? ''))}} "  id="client_image_holder" class="client_image_holder"/>
                            </a>
                        </div>
                        <a href="#" class="showHide resetImage close" data-empty=".client_image_thumbnail" data-hide=".quality_main_photo" data-show=".quality_pick_button"><i class="fas fa-times"></i></a>
                    </div>
                </div>
            </div>

            <div class="clearfix"></div>
            <span class="input-group-btn quality_pick_button {{ old('client_image', $about->client_image ?? '') ? 'hide' : '' }} ">
                <a id="lfm" data-input=".client_image_thumbnail" data-preview=".client_image_holder" data-show=".quality_main_photo" data-hide=".quality_pick_button" class="lfm btn btn-primary text-light">
                    <i class="fas fa-camera-retro"></i> Choose
                </a>
            </span>
        </div>
        {{--End over view image container--}}

        {{--Start video container--}}
        <div class="form-group col-lg-3">
            <label>{{ meta('video', getCurrentLocale()) ?? __('services.video') }} </label>
            <input id="video_image_thumbnail" class="video_image_thumbnail" type="hidden" name="video" value="{{old("video", $about->video ?? "")}}"/>

            <div class="photos video_main_photo {{ old('video', $about->video ?? '') ? ' wow fadeInUp' : 'hide' }}">
                <div class="col-lg-12">
                    <div class="items">
                        <div class="img">
                            <a href="#" id="lfm" data-input=".video_image_thumbnail" data-preview=".video_image_holder" class="lfm" data-hide=".video_pick_button">
                                <img src="{{asset('assets/web/images/icons/video.png')}} " />
                            </a>
                        </div>
                        <a href="#" class="showHide resetImage close" data-empty=".video_image_thumbnail" data-hide=".video_main_photo" data-show=".video_pick_button"><i class="fas fa-times"></i></a>
                    </div>
                </div>
            </div>

            <div class="clearfix"></div>
            <span class="input-group-btn video_pick_button {{ old('video', $about->video ?? '') ? 'hide' : '' }} ">
                <a id="lfm" data-input=".video_image_thumbnail" data-preview=".video_image_holder" data-show=".video_main_photo" data-hide=".video_pick_button" class="lfm btn btn-primary text-light">
                    <i class="fas fa-camera-retro"></i> Choose
                </a>
            </span>
        </div>
        {{--End image container--}}

        <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>
        var route_prefix = "{{ url(config('lfm.prefix')) }}";
        var url = "{{url('/')}}/",
            currentLanguage = "{{getCurrentLocale()}}",
            inputName = '';
    </script>
    <script src="{{ asset('assets/admin/js/editor.js') }}"></script>
    <script src="{{ asset('assets/admin/js/lfm.js') }}"></script>

@endsection



