@extends('admin.layouts.container')

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

<div class="border-item">
    <form class="form-row" >
        @if($notification->type == '0')

        <div class="form-group col-lg-6">
            <label>{{ meta('title', getCurrentLocale()) ?? __('notifications.title') }} </label>
            <input disabled type="text" class="form-control {{ $errors->has('title') ? 'is-invalid' : '' }}" name="title" placeholder="{{ meta('title', getCurrentLocale()) ??__('notifications.title') }}" value='{{ old("title", $notification->title ?? "") }}'/>
        </div>
        <div class="form-group col-lg-6"></div>

        <div class="form-group col-lg-12">
            <label>{{ meta('description', getCurrentLocale()) ?? __('notifications.description') }} </label>
            <textarea disabled type="number" class="form-control {{ $errors->has('description') ? 'is-invalid' : '' }}" name="description" placeholder="{{ meta('description', getCurrentLocale()) ?? __('notifications.description') }}">{{ old("description", $notification->description ?? "") }}</textarea>
        </div>
        @else
        
  
        
        <div class="form-group col-lg-6">
            <label>{{ meta('title', getCurrentLocale()) ?? __('tasks.title') }} </label>
            <input type="text" disabled class="form-control" value='{{ old("title", $task->title ?? "") }}'/>
        </div>

    
           <div class="form-group col-lg-6">
            <label>{{ meta('description', getCurrentLocale()) ?? __('tasks.description') }} </label>
            <textarea class="form-control" disabled>{{$task->description}}</textarea>  
        </div>
           <div class="form-group col-lg-6">
            <label>{{ meta('time', getCurrentLocale()) ?? __('tasks.time') }} </label>
           <input type="text" disabled class="form-control" value='{{ old("time", $task->time ?? "") }}'/>
        </div>
          @if($task ?? ''  && $task->id)
        @php
        $start =  str_replace(" ","T",$task->start);
        $end =  str_replace(" ","T",$task->end);
       
        @endphp
        @endif
          <div class="form-group col-lg-6">
            <label>{{ meta('start', getCurrentLocale()) ?? __('tasks.start') }} </label>
            <input type="datetime-local" class="form-control" disabled value='{{ old("start", $start ?? "") }}'/>
        </div>
       
          <div class="form-group col-lg-6">
            <label>{{ meta('end', getCurrentLocale()) ?? __('tasks.end') }} </label>
            <input type="datetime-local" class="form-control" disabled value='{{ old("end", $end ?? "") }}'/>
        </div>
        
       
        
        
        
              <div class="row pricing-list-item border-item mb-4 col-lg-12" @if(!($task ?? ''  && $task->id))  style="display:none" @endif id="files">
                 @if($task ?? ''  && $task->id)
                    @foreach($task_files as $key=>$row)
                    
               <div class="form-group col-lg-12">
            <label>{{ meta('file', getCurrentLocale()) ?? __('tasks.file') }} </label>

            <div class="images main_image{{$key}} {{ old('file', $row->file ?? '') ? ' wow fadeInUp' : 'hide' }}">
                <div class="col-lg-12">
                    <div class="items">
                        <div class="img">
                            <a  id="lfm"  class="lfm" data-hide=".pick_button">
                               {{$row->file}}
                            </a>
                        </div>
                         </div>
                </div>
            </div>

           
        </div>
            
             @endforeach
             @endif
                </div>

        
        
        
        
       <div class="border-item photos col-md-12 other_image_container">
            <div class="row">
                @if ($task ?? false)
                    @foreach ($task_photos as $photo)
                        <div class="col-md-4">
                            <div class="items">
                                <div class="img">
                                    <a href="{{ asset($photo->file ?? '')}}" data-fancybox="gallery"><img src="{{ asset($photo->file ?? '')}}" alt=""></a>
                                </div>
                                <input type="hidden" name="images[]" value="{{ $photo->file ?? "" }}">
                                
                            </div>
                        </div>
                    @endforeach
                @endif
            </div>
            
        </div>
       
       
        
        @endif
        
    </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('/')}}/",
            imagePath = "{{asset('')}}";
    </script>
    <script src="{{ asset('assets/admin/js/editor.js') }}"></script>
    <script src="{{ asset('assets/admin/js/lfm.js') }}"></script>
@endsection
