<?php

use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $searchModel backend\models\search\HistorySearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = Yii::t('common', 'Histories');
$this->params['breadcrumbs'][] = $this->title;
?>
<?php $this->beginBlock('content-header') ?>
<?= $this->title . ' ' . Html::a(Yii::t('common', 'Create History'), ['create'], ['class' => 'btn btn-success']) ?>
<?php $this->endBlock() ?>
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>

<div class="box box-success">
    <div class="box-body">
        <?= GridView::widget([
            'dataProvider' => $dataProvider,
            'filterModel' => $searchModel,
            'columns' => [
                'year',
                'title',
                [
                    'attribute' => 'cover',
                    'format' => ['image', ['style' => 'height: 60px; width: auto;border: none;']],
                    'contentOptions' => ['class' => 'media-content']
                ],

                [
                    'class' => 'backend\widgets\grid\SwitcherColumn',
                    'attribute' => 'status'
                ],

                ['class' => 'common\helpers\DiyActionColumn'],
            ],
        ]); ?>
    </div>
</div>
