<commit_before><?php

use yii\helpers\Html;
use common\models\Blog;
use yii\helpers\Url;
use common\models\Subscribers;

/* @var $this yii\web\View */
/* @var $model common\models\Pages */
$this->title = Html::encode($model->title);
$this->registerMetaTag([
    'name' => 'description',
    'content' => Html::encode($model->description),
]);
$this->registerMetaTag([
    'name' => 'keywords',
    'content' => Html::encode($model->keywords)
]);
?>
<section class="blog">
    <div class="blog-header"></div>
    <div class="inner">
        <aside class="side-right">
            <?php if(isset($model->boxes['banner'])):?>
            <div class="b-module">
                <?= Html::img('@boxes/' . $model->boxes['banner']['image'])?>
            </div>
            <?php endif;?>
            <div class="b-module rss">
                <?= Yii::$app->session->hasFlash('message') ? Html::tag('legend', Yii::$app->session->getFlash('message'), ['class' => 'flash_message']) : ''?>
                <h3>
                    Подписывайтесь на наш блог
                </h3>
                <?= $this->render('/partials/_subscribe_form', ['model' => new Subscribers()])?>
            </div>
            <div class="b-module rss screen">
                <h3>
                    Популярные тэги
                </h3>
            </div>
        </aside>
        <div class="b-content">
        <?php if ($model = Blog::getAllBlogs()):?>
            <?php foreach ($model as $blog): ?>
                <article>
                    <h2>
                        <?= Html::a($blog['name'], Url::to(['blog/view', 'alias' => $blog['alias']]))?>
                    </h2>
                    <div class="date">
                        <?= Yii::$app->formatter->asRelativeTime($blog['created_at'])?>
                    </div>
                    <?php if($blog['image']):?>
                        <div class="media">
                            <?= Html::img('@blog/' . $blog['image'], ['alt' => '', 'title' => ''])?>
                        </div>
                    <?php endif;?>
                    <?= str_replace('[image]','',$blog['text'])?>
                </article>
            <?php endforeach; ?>
        <?php endif; ?>
        </div>
    </div>
</section><commit_msg>Блог - вывод части тескта на общей странице<commit_after><?php

use yii\helpers\Html;
use common\models\Blog;
use yii\helpers\Url;
use common\models\Subscribers;
use yii\helpers\StringHelper;

/* @var $this yii\web\View */
/* @var $model common\models\Pages */
$this->title = Html::encode($model->title);
$this->registerMetaTag([
    'name' => 'description',
    'content' => Html::encode($model->description),
]);
$this->registerMetaTag([
    'name' => 'keywords',
    'content' => Html::encode($model->keywords)
]);
?>
<section class="blog">
    <div class="blog-header"></div>
    <div class="inner">
        <aside class="side-right">
            <?php if(isset($model->boxes['banner'])):?>
            <div class="b-module">
                <?= Html::img('@boxes/' . $model->boxes['banner']['image'])?>
            </div>
            <?php endif;?>
            <div class="b-module rss">
                <?= Yii::$app->session->hasFlash('message') ? Html::tag('legend', Yii::$app->session->getFlash('message'), ['class' => 'flash_message']) : ''?>
                <h3>
                    Подписывайтесь на наш блог
                </h3>
                <?= $this->render('/partials/_subscribe_form', ['model' => new Subscribers()])?>
            </div>
            <div class="b-module rss screen">
                <h3>
                    Популярные тэги
                </h3>
            </div>
        </aside>
        <div class="b-content">
        <?php if ($model = Blog::getAllBlogs()):?>
            <?php foreach ($model as $blog): ?>
                <article>
                    <h2>
                        <?= Html::a($blog['name'], Url::to(['blog/view', 'alias' => $blog['alias']]))?>
                    </h2>
                    <div class="date">
                        <?= Yii::$app->formatter->asRelativeTime($blog['created_at'])?>
                    </div>
                    <?php if($blog['image']):?>
                        <div class="media">
                            <?= Html::img('@blog/' . $blog['image'], ['alt' => '', 'title' => ''])?>
                        </div>
                    <?php endif;?>
                    <?= StringHelper::truncate(str_replace('[image]','',$blog['text']), 700)?>
                </article>
            <?php endforeach; ?>
        <?php endif; ?>
        </div>
    </div>
</section>
{'fraction_non_alphanumeric': 0.2088101921831138, 'fraction_numerical': 0.0032390412437918376, 'mean_word_length': 1.6930232558139535, 'pattern_counts': {'":': 0, '<': 91, '<?xml version=': 0, '>': 139, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4711289', 'n_tokens_mistral': 1428, 'n_tokens_neox': 1385, 'n_words': 238}