<?php
    /**
     * @var Articles $model
     * @var mixed    $key
     * @var integer  $index
     * @var ListView $widget
     */
    use common\components\artboximage\ArtboxImageHelper;
    use common\models\Articles;
    use yii\helpers\Html;
    use yii\widgets\ListView;
?>
<div class="col-xs-12 col-sm-12 articles_data-title">
    <div class="articles-date">
        <span>
            <?php
                echo date('d.m.Y', $model->date);
            ?>
        </span>
    </div>
    <div class="articles-title">
        <?php
            echo Html::a($model->lang->title, [ 'article/view', 'id' => $model->id ]);
        ?>
    </div>
</div>
<div class="articles col-xs-12 col-sm-12 col-md-12">
    <div class="new_article-img">
        <?php
            if(!empty($model->image)) {
                echo Html::a(ArtboxImageHelper::getImage($model->imageUrl, 'article_list'), [ 'article/view', 'id' => $model->id ]);
            } else {
                echo Html::a(ArtboxImageHelper::getImage('/storage/no-image.png', 'article_list'), [ 'article/view', 'id' => $model->id ]);
            }
        ?>
    </div>
    <div class="brand-list-desc-txt">
        <?php
            if(!empty($model->lang->body_preview)) {
                echo $model->lang->body_preview;
            } else {
                echo $model->lang->body;
            }
        ?>
        <p>
            <?php
                echo Html::a(Yii::t('app', 'Подробнее'), [ 'article/view', 'id' => $model->id ]);
            ?>
        </p>
    </div>
</div>
