<?php
    
    use artbox\core\components\SeoComponent;
    use artbox\core\helpers\Url;
    use yii\data\ActiveDataProvider;
    use yii\helpers\Html;
    use yii\web\View;
    use yii\widgets\ActiveForm;
    use yii\widgets\ListView;
    
    /**
     * @var View               $this
     * @var ActiveDataProvider $dataProvider
     * @var SeoComponent       $seo
     * @var \common\models\blog\Tag[]              $tags
     * @var common\models\blog\Category[] $categories
     * @var \common\models\blog\Tag $model
     */
    $seo = \Yii::$app->get('seo');
    
    $this->params[ 'breadcrumbs' ][] = [
        'label' => \Yii::t('app', 'Blog'),
        'url' => Url::to(['blog/index'])
    ];
    $this->params['breadcrumbs'][] = $model->title;

?>

<section class="blog-all-bg">
  <div class="container">
    <div class="row">
      <div class="col-xs-12 col-sm-12">
        <div class="blog-title title-pages"><?=\Yii::t('app', 'Blog');?></div>
      </div>
    </div>
    <div class="row">
      <div class="col-xs-12 col-sm-5 col-md-4 col-lg-3">
        <div class="fb-subscribe">
            <?=\Yii::t('app','Follow to news on FB');?>
        </div>
      </div>
    </div>
    <div class="row">
      <div class="col-xs-12 col-sm-12">
        <div class="style fb-subscribe-btn">
          <a target="_blank" href="#" class="btn_"><?=\Yii::t('app','Follow');?></a>
        </div>
      </div>
    </div>
  </div>
</section>

<section class="blog-all-section">
  <div class="container">
    <div class="row">
      <div class="col-xs-12 col-sm-12 select-blog-col">
        <div class="select-blog">
            <?php $form = ActiveForm::begin();?>
          <div class="input-wr">
              <?=Html::dropDownList('categories', null,
                  ['' => \Yii::t('app','All categories')]+$categories, [
                  'id' => 'blog-categories'
              ])?>
          </div>
            <?php ActiveForm::end()?>
        </div>
      </div>
    </div>
    <div class="row blog-list-row">
        <?= ListView::widget(
            [
                'dataProvider' => $dataProvider,
                'itemView'     => '_article',
                'options'      => [
                    'class' => 'col-xs-12 col-sm-4 col-md-4 blog-list-col',
                ],
                'layout'       => '{items}{pager}',
            ]
        ); ?>
      
      <div class="col-xs-12 col-sm-12">
        <div class="style navi-c-a">
            
            <?php  echo \frontend\widgets\FrontendPager::widget(
                [
                    'pagination'     => $dataProvider->pagination,
                    'prevPageLabel'  => 'previous',
                    'nextPageLabel'  => 'next',
                    'maxButtonCount' => 5,
                    'lastPageLabel'  => 'last_number',
                ]
            );?>
        </div>
      </div>
    </div>
  </div>
</section>