<?php

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

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

?>

<div class="blog_container">
    <div class="container">
        <div class="row">
            <div class="col-md-8 col-xs-8 col-sm-12">
                <section class="blog">

                    <h1><?=Yii::t('app', 'Tag')?>: <?=$model->name;?></h1>

                    <?php foreach ($model->posts as $post) : ?>

                        <article class="article_short">
                            <a href="<?=Url::to(['/blog/'.$post->url])?>" class="article_short_title"><?=$post->lang->title?></a>
                            <div class="article_short_head">
                                <span class="article_short_date"><?=date('d.m.Y', $post->created_at)?></span>
                                <!-- <span class="article_short_view">
                                    180
                                    <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 ($post->postTags as $tag) : ?>

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

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

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

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

                    <?php endforeach; ?>

                    <?=$this->render('_subscribe', ['title' => 'Тег: ' . $model->name])?>

                </section>
            </div>
            
            <?=$this->render('_sidebar')?>

        </div>
    </div>
</div>

<!-- <div class="end_keys_neft"></div> -->

<?=$this->render('@app/views/layouts/footer');?>