@extends('layouts.front')
@section('meta')
<title>আর্কাইভ - {{ $gs->title ?? 'Channel 5 Bangla' }}</title>
<meta property="og:title" content="আর্কাইভ - {{ $gs->title ?? 'Channel 5 Bangla' }}" />
<meta property="og:image" content="{{asset('assets/images/logo/'.$gs->og_baner)}}" />
@endsection
@section('contents')

<!-- main div -->
<div class="mainDiv">
<!-- desktop and mobile version start -->
<div class="bgWHite">
  <div class="container">
    <div class="row">

      <!-- header -->
      <div class="col-sm-12 col-md-12 marginB20 hidden-xs marginT10">
        <h1 class="desktopCategoryTitle"><span class="titleLeftDesign1"></span> <a href="{{ route('frontend.archive') }}"><strong>আর্কাইভ</strong></a></h1>
      </div>
      <div class="col-sm-12 col-md-12 paddingLR20 xs-paddingL15 marginB10 visible-xs paddingT10">
        <h1 class="sectionTitle displayInline border0 margin0 marginB0"><span class="titleLeftDesign1"></span> <a href="{{ route('frontend.archive') }}"><strong>আর্কাইভ</strong></a></h1>
      </div>

      <div class="col-sm-9 col-md-9">
        <div class="row">
          <!-- search form -->
          <div class="col-sm-12 col-md-12 marginB20">
            <form method="get" action="{{ route('frontend.archive') }}">
              <input type="hidden" name="search" value="yes">
              <div class="panel panel-default borderRadius0 borderAsh1 marginB0">
                <div class="panel-body bgAsh">
                  <div class="row">
                    <div class="col-md-6">
                      <div>
                        <input value="{{ $headline ?? '' }}" name="headline" class="form-control borderRadius5 h40" type="text" placeholder="শিরোনাম" autocomplete="off">
                      </div>
                    </div>
                    <div class="col-md-3 paddingL0 paddingR0 xs-paddingL15 xs-paddingR15 xs-marginT10">
                      <div class="input-group date h40" id="datePicker">
                        <input name="date" value="{{ $date ?? '' }}" placeholder="তারিখ" class="form-control borderRadius5 h40" type="text" autocomplete="off">
                        <span class="input-group-addon borderRadius5"><i class="fa fa-calendar"></i></span>
                      </div>
                    </div>
                    <div class="col-md-3 xs-marginT10">
                      <button type="submit" class="btn btn-block borderRadius5 width100P bgBrand title1_8 colorWhite h40 padding3"><i class="fa fa-search title1_6 verticalAlignMiddle"></i> খুঁজুন</button>
                    </div>
                  </div>
                </div>
              </div>
            </form>
          </div>

          <!-- news grid -->
          @if ($datas->count() > 0)
          <div class="col-sm-12 col-md-12">
            <div class="row desktopFlexRow marginLR-15 borderR3rdItemNone">
              @foreach ($datas as $post)
              <div class="col-md-4 col-xs-12 marginB20 xs-marginB15 paddingLR15 borderC1R1 desktopSectionLead">
                <div class="thumbnail h100P borderC1B1 borderRadius0">
                  <div class="positionRelative">
                    @if($post->category)
                    <p class="marginT15 marginB13 positionAbsolute bottom0 marginL10"><span class="categoryNameClass borderC1-1 bg9 colorWhite"><i class="fa fa-regular fa-tag"></i> {{ $post->category->title }}</span></p>
                    @endif
                    <img src="{{asset('assets/images/post/'.$post->image_big)}}" class="img-responsive borderRadius0" alt="{{ strlen($post->title)>80 ? mb_substr($post->title,0,80,'utf-8').'...' : $post->title}}">
                    @if($post->video_code)
                    <span class="pvIconMedium"><i class="fa fa-play"></i></span>
                    @endif
                  </div>
                  <div class="caption paddingLR0">
                    <h1 class="title11 colorBlack marginT10">{{ strlen($post->title)>100 ? mb_substr($post->title,0,100,'utf-8').'...' : $post->title}}</h1>
                    <p class="desktopTime"><i class="fa fa-clock title1_4 color2 verticalAlignMiddle marginT2"></i> {{ $post->createdAt() }}</p>
                  </div>
                  <a href="{{ route('frontend.postBySubcategory.details',[$post->category->slug ?? '',$post->slug])}}" class="linkOverlay"></a>
                </div>
              </div>
              @endforeach
            </div>
          </div>

          <!-- pagination -->
          <div class="col-sm-12 col-md-12">
            <div class="pagination2 text-center marginB30 marginT30 xs-marginT10">
              {{ $datas->appends(request()->query())->links() }}
            </div>
          </div>
          @else
          <div class="col-sm-12 col-md-12">
            <div class="text-center padding20">
              <p class="colorBrand">কোন তথ্য পাওয়া যায়নি।</p>
            </div>
          </div>
          @endif
        </div>
      </div>

      <!-- sidebar -->
      <div class="col-sm-3 col-md-3 hidden-xs">
        <!-- latest popular news -->
        <div class="row">
          <div class="col-sm-12 col-md-12 marginB20">
            @include('partial.front.sidebar-latest-popular')
          </div>
        </div>
        <!-- latest popular news end -->
      </div>

    </div>
  </div>
</div>
<!-- desktop and mobile version end -->
</div>
<!-- main div end -->

@endsection
