<?php

use yii\helpers\Html;
use yii\helpers\Url;

/* @var $this yii\web\View */
/* @var $model common\modules\blog\models\Post */

?>

<?php foreach ($models as $model) : ?>

    <article class="article_short">
        <a href="<?=Url::to(['/blog/'.$model->url])?>" class="article_short_title"><?=$model->lang->title?></a>
        <div class="article_short_head">
            <span class="article_short_date"><?=date('d.m.Y', $model->created_at)?></span>
            <span class="article_short_view">
                <?=$model->getViews()->count()?>
                <div class="blog_toltip_left">Количество просмотров</div>
            </span>
            <!-- <ul class="article_short_social">
                <li>
                    <a href="#"><img src="/images/icon/sh_social_vk.png" height="30" width="30" alt=""></a>
                    <a href="#"><img src="/images/icon/sh_social_fb.png" height="30" width="30" alt=""></a>
                    <a href="#"><img src="/images/icon/sh_social_tw.png" height="30" width="30" alt=""></a>
                    <a href="#"><img src="/images/icon/sh_social_gp.png" height="30" width="30" alt=""></a>
                    <a href="#"><img src="/images/icon/sh_social_t.png" height="30" width="30" alt=""></a>
                </li>
            </ul> -->
        </div>
        <div class="article_short_tags">

            <?php foreach ($model->postTags as $tag) : ?>

                <a href="<?=$tag->url;?>"># <?=$tag->name?></a>

            <?php endforeach; ?>
            
        </div>
        <div class="article_short_txt">

            <?php if($model->preview) :
                echo Html::img($model->preview);
            endif; ?>

            <?=$model->lang->text?>
        </div>
    </article>

<?php endforeach; ?>