<?php
    /**
     * @var Project $model
     * @var mixed $key
     * @var integer $index
     * @var ListView $widget
     */
    use common\components\artboximage\ArtboxImageHelper;
    use common\models\Project;
    use common\models\ProjectImage;
    use yii\helpers\Html;
    use yii\helpers\Url;
    use yii\widgets\ListView;

?>
<div class="col-xs-12 col-sm-12 new_articles_data-title">
    <div class="articles-title">
        <?php
            echo Html::a($model->lang->title, [
                'project/view',
                'id' => $model->project_id,
            ]);
        ?>
    </div>
</div>
<div class="articles col-xs-12 col-sm-12 col-md-12">
    <div class="new_article-img">
        <?php
            if(!empty( $model->images )) {
                $images = $model->images;
                $image = current($images);
                echo Html::a(ArtboxImageHelper::getImage($image->getImageUrl(), 'article_list'), [
                    'project/view',
                    'id' => $model->project_id,
                ]);
            }
        ?>
    </div>
<!--    <div class="new_article-img">-->
        <div class="brand-list-desc-txt">
            <?php
                echo $model->lang->description_preview?:$model->lang->description;
            ?>
            <p>
                <?php
                    echo Html::a(\Yii::t('app', 'подробнее'), [
                        'project/view',
                        'id' => $model->project_id,
                    ]);
                ?>
            </p>
        </div>
<!--    </div>-->
    <?php
//        if(!empty( $model->images ) && count($model->images) > 1) {
//            $images = array_slice($model->images, 1);
//            ?>
<!--            <div class="galery-obj-img col-xs-12 col-sm-12">-->
<!--                <a href="--><?//= Url::to([
//                    'project/view',
//                    'id' => $model->project_id,
//                ]); ?><!--">-->
<!--                    <!----размер картинок макс ширина 165, макс высота 100--->
<!--                    --><?php
//                        foreach($images as $img) {
//                            /**
//                             * @var ProjectImage $img
//                             */
//                            echo ArtboxImageHelper::getImage($img->getImageUrl(), 'project_list');
//                        }
//                    ?>
<!--                </a>-->
<!--            </div>-->
            <?php
//        }
    ?>
</div>