<?php
    
    use artbox\core\components\SeoComponent;
    use yii\data\ActiveDataProvider;
    use artbox\core\helpers\Url;
    use yii\web\View;
    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
     */
    $seo = \Yii::$app->get('seo');

    $this->params[ 'breadcrumbs' ][] = \Yii::t('app', 'News');
   
?>

<div id="content">
  <div class="container">
    <div class="row">
      <!-- *** LEFT COLUMN ***
_________________________________________________________ -->
  
  
      <!--        <ul class="pager">-->
      <!--          <li class="previous"><a href="#">&larr; Назад</a>-->
      <!--          </li>-->
      <!--          <li class="next disabled"><a href="#">Вперед &rarr;</a>-->
      <!--          </li>-->
      <!--        </ul>-->
      
      <!-- /.col-md-9 -->
        
    
        <?= ListView::widget(
            [
                'dataProvider' => $dataProvider,
                'itemView'     => '_article',
                'emptyText'    =>\Yii::t('app','No results found'),
                'options'      => [
                    'class' => 'col-md-9',
                    'id'    => 'blog-listing-medium',
                ],
                'layout'       => '{items}{pager}',
                'emptyText'    => \Yii::t('app', 'No results found'),
            ]
        ); ?>
      
      
      <!-- *** LEFT COLUMN END *** -->
      
      <!-- *** RIGHT COLUMN ***
_________________________________________________________ -->
      
      <div class="col-md-3 blog-sidebar">
        
        <!-- *** MENUS AND WIDGETS ***
_________________________________________________________ -->
<!--        <div class="panel panel-default sidebar-menu">-->
<!--          -->
<!--          <div class="panel-heading">-->
<!--            <h3 class="panel-title">--><?//=\Yii::t('app', 'Company Blog')?><!--</h3>-->
<!--          </div>-->
<!--          -->
<!--          <div class="panel-body text-widget">-->
<!--            <p>-->
<!--                --><?//=\Yii::t('app', 'blog-txt')?>
<!--            </p>-->
<!--          -->
<!--          </div>-->
<!--        </div>-->           
    
<!--          --><?//= BlogSearch::widget(); ?>
          <?php if (!empty($categories)) { ?>
              <div class="panel panel-default sidebar-menu">

                  <div class="p                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             anel-heading">
                      <h3 class="panel-title"><?=\Yii::t('app', 'Categories')?></h3>
                  </div>

                  <div class="panel-body text-widget">
                      <ul class="categories-blog-index">

                          <?php foreach ($categories as $category) { ?>
                              <li>
                                  <a href="<?= Url::to(
                                      [
                                          'alias' => $category->alias
                                      ]
                                  ) ?>"><?= $category->title; ?></a>
                              </li>
                          <?php } ?>
                      </ul>

                  </div>
              </div>

              <?php
          }
            if(!empty($tags)){
                ?>
<!--                <div class="panel sidebar-menu">-->
<!--                    <div class="panel-heading">-->
<!--                        <h3 class="panel-title">--><?//=\Yii::t('app', 'Search by tag')?><!--</h3>-->
<!--                    </div>-->
<!---->
<!--                    <div class="panel-body">-->
<!--                        <ul class="tag-cloud">-->
<!--                            --><?php //foreach ($tags as $tag) { ?>
<!--                                <li><a href="--><?php //= Url::to(
//                                        [
//                                            'alias' => $tag->alias
//                                        ]
//                                    ) ?><!--"><i class="fa fa-tag"></i>&#160-->

                <!--</a>-->
<!--                                </li>-->
<!--                            --><?php //} ?>
<!--                        </ul>-->
<!--                    </div>-->
<!--                </div>-->
          <?php
            }
        ?>

        
        <!-- *** MENUS AND FILTERS END *** -->
      
      </div>
      <!-- /.col-md-3 -->
      
      <!-- *** RIGHT COLUMN END *** -->
    
    </div>
    <!-- /.row -->
  </div>
  <!-- /.container -->
</div>
<!-- /#content -->