|
|
@ -8,6 +8,7 @@ use yii\widgets\DetailView; |
|
|
|
/* @var $this yii\web\View */ |
|
|
|
/* @var $this yii\web\View */ |
|
|
|
/* @var $post \common\modules\blog\entities\BlogPost */ |
|
|
|
/* @var $post \common\modules\blog\entities\BlogPost */ |
|
|
|
/* @var $modificationsProvider yii\data\ActiveDataProvider */ |
|
|
|
/* @var $modificationsProvider yii\data\ActiveDataProvider */ |
|
|
|
|
|
|
|
/* @var $history \common\modules\blog\entities\BlogPost[] */ |
|
|
|
|
|
|
|
|
|
|
|
$title = $post->title; |
|
|
|
$title = $post->title; |
|
|
|
$this->title = $title; |
|
|
|
$this->title = $title; |
|
|
@ -33,114 +34,172 @@ $this->params['breadcrumbs'][] = $title; |
|
|
|
]) ?> |
|
|
|
]) ?> |
|
|
|
</p> |
|
|
|
</p> |
|
|
|
|
|
|
|
|
|
|
|
<div class="box"> |
|
|
|
|
|
|
|
<div class="box-header with-border"><?= Yii::t('blog', 'Common') ?></div>
|
|
|
|
<div class="row"> |
|
|
|
<div class="box-body"> |
|
|
|
<div class="col-md-9"> |
|
|
|
<?= DetailView::widget([ |
|
|
|
|
|
|
|
'model' => $post, |
|
|
|
<div class="box"> |
|
|
|
'attributes' => [ |
|
|
|
<div class="box-header with-border"><?= Yii::t('blog', 'Common') ?></div>
|
|
|
|
'id', |
|
|
|
<div class="box-body"> |
|
|
|
[ |
|
|
|
<?= DetailView::widget([ |
|
|
|
'attribute' => 'status', |
|
|
|
'model' => $post, |
|
|
|
'value' => BlogPostHelper::statusLabel($post->status), |
|
|
|
'attributes' => [ |
|
|
|
'format' => 'raw', |
|
|
|
'id', |
|
|
|
], |
|
|
|
[ |
|
|
|
'title', |
|
|
|
'attribute' => 'status', |
|
|
|
[ |
|
|
|
'value' => BlogPostHelper::statusLabel($post->status), |
|
|
|
'attribute' => 'category_id', |
|
|
|
'format' => 'raw', |
|
|
|
'value' => ArrayHelper::getValue($post, 'category.name'), |
|
|
|
], |
|
|
|
], |
|
|
|
'title', |
|
|
|
[ |
|
|
|
[ |
|
|
|
'label' => Yii::t('post', 'Tags'), |
|
|
|
'attribute' => 'category_id', |
|
|
|
'format' => 'raw', |
|
|
|
'value' => ArrayHelper::getValue($post, 'category.name'), |
|
|
|
'value' => '<i class="fa fa-tag" aria-hidden="true"></i> ' . implode(' <i class="fa fa-tag" aria-hidden="true"></i> ', ArrayHelper::getColumn($post->tags, 'name')), |
|
|
|
], |
|
|
|
], |
|
|
|
[ |
|
|
|
], |
|
|
|
'label' => Yii::t('post', 'Tags'), |
|
|
|
]) ?> |
|
|
|
'format' => 'raw', |
|
|
|
</div> |
|
|
|
'value' => '<i class="fa fa-tag" aria-hidden="true"></i> ' . implode(' <i class="fa fa-tag" aria-hidden="true"></i> ', ArrayHelper::getColumn($post->tags, 'name')), |
|
|
|
</div> |
|
|
|
], |
|
|
|
|
|
|
|
], |
|
|
|
<?php if ($post->image): ?> |
|
|
|
]) ?> |
|
|
|
<div class="box"> |
|
|
|
</div> |
|
|
|
<div class="box-header with-border"><?= Yii::t('blog', 'Image') ?></div>
|
|
|
|
</div> |
|
|
|
<div class="box-body"> |
|
|
|
|
|
|
|
<?= Html::img($post->getThumbFileUrl('image', 'thumb_gallery_view'), [ |
|
|
|
<?php if ($post->image): ?> |
|
|
|
'class' => 'thumbnail', |
|
|
|
<div class="box"> |
|
|
|
'width' => 300, |
|
|
|
<div class="box-header with-border"><?= Yii::t('blog', 'Image') ?></div>
|
|
|
|
]) ?> |
|
|
|
<div class="box-body"> |
|
|
|
</div> |
|
|
|
<?= Html::img($post->getThumbFileUrl('image', 'thumb_gallery_view'), [ |
|
|
|
</div> |
|
|
|
'class' => 'thumbnail', |
|
|
|
<?php endif; ?> |
|
|
|
'width' => 300, |
|
|
|
|
|
|
|
]) ?> |
|
|
|
<?php if (!$post->image && $post->video): ?> |
|
|
|
</div> |
|
|
|
<div class="box"> |
|
|
|
</div> |
|
|
|
<div class="box-header with-border"><?= Yii::t('blog', 'Image') ?></div>
|
|
|
|
<?php endif; ?> |
|
|
|
<div class="box-body"> |
|
|
|
|
|
|
|
<!-- < ?= Html::img('https://i.ytimg.com/vi/' . BlogPostHelper::parseYoutubeUrl($post->video) . '/maxresdefault.jpg', [ |
|
|
|
<?php if (!$post->image && $post->video): ?> |
|
|
|
'width' => 300, |
|
|
|
<div class="box"> |
|
|
|
'class' => 'thumbnail', |
|
|
|
<div class="box-header with-border"><?= Yii::t('blog', 'Image') ?></div>
|
|
|
|
]) ?> --> |
|
|
|
<div class="box-body"> |
|
|
|
<?= Html::img(\core\helpers\VideoHelper::getThumb($post->video), [ |
|
|
|
<!-- < ?= Html::img('https://i.ytimg.com/vi/' . BlogPostHelper::parseYoutubeUrl($post->video) . '/maxresdefault.jpg', [ |
|
|
|
'width' => 300, |
|
|
|
'width' => 300, |
|
|
|
'class' => 'thumbnail', |
|
|
|
'class' => 'thumbnail', |
|
|
|
]) ?> |
|
|
|
]) ?> --> |
|
|
|
</div> |
|
|
|
<?= Html::img(\core\helpers\VideoHelper::getThumb($post->video), [ |
|
|
|
|
|
|
|
'width' => 300, |
|
|
|
|
|
|
|
'class' => 'thumbnail', |
|
|
|
|
|
|
|
]) ?> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<?php endif; ?> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<?php if ($post->video): ?> |
|
|
|
|
|
|
|
<div class="box"> |
|
|
|
|
|
|
|
<div class="box-header with-border"><?= Yii::t('blog', 'Video') ?></div>
|
|
|
|
|
|
|
|
<div class="box-body"> |
|
|
|
|
|
|
|
<?= \core\widgets\VideoWidget::widget([ |
|
|
|
|
|
|
|
'src' => $post->video, |
|
|
|
|
|
|
|
'style' => '', |
|
|
|
|
|
|
|
]) ?> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<?php endif; ?> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="box"> |
|
|
|
|
|
|
|
<div class="box-header with-border"><?= Yii::t('blog', 'Description') ?></div>
|
|
|
|
|
|
|
|
<div class="box-body"> |
|
|
|
|
|
|
|
<?= Yii::$app->formatter->asNtext($post->description) ?> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="box"> |
|
|
|
|
|
|
|
<div class="box-header with-border"><?= Yii::t('blog', 'Content') ?></div>
|
|
|
|
|
|
|
|
<div class="box-body"> |
|
|
|
|
|
|
|
<?= Yii::$app->formatter->asHtml($post->content, [ |
|
|
|
|
|
|
|
'Attr.AllowedRel' => array('nofollow'), |
|
|
|
|
|
|
|
'HTML.SafeObject' => true, |
|
|
|
|
|
|
|
'Output.FlashCompat' => true, |
|
|
|
|
|
|
|
'HTML.SafeIframe' => true, |
|
|
|
|
|
|
|
'URI.SafeIframeRegexp'=>'%^(https?:)?//(www\.youtube(?:-nocookie)?\.com/embed/|player\.vimeo\.com/video/)%', |
|
|
|
|
|
|
|
]) ?> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="box"> |
|
|
|
|
|
|
|
<div class="box-header with-border"><?= Yii::t('blog', 'SEO') ?></div>
|
|
|
|
|
|
|
|
<div class="box-body"> |
|
|
|
|
|
|
|
<?= DetailView::widget([ |
|
|
|
|
|
|
|
'model' => $post, |
|
|
|
|
|
|
|
'attributes' => [ |
|
|
|
|
|
|
|
[ |
|
|
|
|
|
|
|
'attribute' => 'meta.title', |
|
|
|
|
|
|
|
'value' => $post->meta->title, |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
[ |
|
|
|
|
|
|
|
'attribute' => 'meta.description', |
|
|
|
|
|
|
|
'value' => $post->meta->description, |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
[ |
|
|
|
|
|
|
|
'attribute' => 'meta.keywords', |
|
|
|
|
|
|
|
'value' => $post->meta->keywords, |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
]) ?> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<?php endif; ?> |
|
|
|
<div class="col-md-3"> |
|
|
|
|
|
|
|
<div class="box"> |
|
|
|
<?php if ($post->video): ?> |
|
|
|
<div class="box-header with-border"><?= Yii::t('blog', 'History') ?></div>
|
|
|
|
<div class="box"> |
|
|
|
<div class="box-body"> |
|
|
|
<div class="box-header with-border"><?= Yii::t('blog', 'Video') ?></div>
|
|
|
|
|
|
|
|
<div class="box-body"> |
|
|
|
<?php if ($history): ?> |
|
|
|
<?= \core\widgets\VideoWidget::widget([ |
|
|
|
<ul> |
|
|
|
'src' => $post->video, |
|
|
|
<?php foreach ($history as $item): ?> |
|
|
|
'style' => '', |
|
|
|
<li> |
|
|
|
]) ?> |
|
|
|
<?php if ($item->revision_id): ?> |
|
|
|
|
|
|
|
<?= date('d.m.Y H:i', $item->revision_at) ?> |
|
|
|
|
|
|
|
→ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<?= Html::a(Yii::t('blog', 'View'), \yii\helpers\Url::to(Yii::$app->get('frontendUrlManager')->createAbsoluteUrl(['/blog/post/preview', 'id' => $item->id])), [ |
|
|
|
|
|
|
|
'style' => 'font-size:11px;', |
|
|
|
|
|
|
|
'target' => '_blank', |
|
|
|
|
|
|
|
]) ?> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<?= Html::a(Yii::t('blog', 'Restore'), ['/blog/manage/post/restore-history', 'id' => $item->id], [ |
|
|
|
|
|
|
|
'style' => 'font-size:11px; color: red', |
|
|
|
|
|
|
|
'data' => [ |
|
|
|
|
|
|
|
'confirm' => Yii::t('blog', 'Are you sure you want to restore this history item?'), |
|
|
|
|
|
|
|
'method' => 'post', |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
]) ?> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<?php else: ?> |
|
|
|
|
|
|
|
<strong><?= Yii::t('blog', 'Current Edition') ?></strong>
|
|
|
|
|
|
|
|
<?php endif; ?> |
|
|
|
|
|
|
|
</li> |
|
|
|
|
|
|
|
<?php endforeach; ?> |
|
|
|
|
|
|
|
</ul> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<?= Html::a(Yii::t('blog', 'Clear History'), ['/blog/manage/post/clear-history', 'id' => $post->id], [ |
|
|
|
|
|
|
|
'class' => 'btn btn-danger btn-sm pull-right', |
|
|
|
|
|
|
|
'data' => [ |
|
|
|
|
|
|
|
'confirm' => Yii::t('blog', 'Are you sure you want to remove this history?'), |
|
|
|
|
|
|
|
'method' => 'post', |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
]) ?> |
|
|
|
|
|
|
|
<?php else: ?> |
|
|
|
|
|
|
|
<div style="padding: 20px 0; text-align: center"><?= Yii::t('blog', 'History is empty') ?></div>
|
|
|
|
|
|
|
|
<?php endif; ?> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<?php endif; ?> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div class="box"> |
|
|
|
|
|
|
|
<div class="box-header with-border"><?= Yii::t('blog', 'Description') ?></div>
|
|
|
|
|
|
|
|
<div class="box-body"> |
|
|
|
|
|
|
|
<?= Yii::$app->formatter->asNtext($post->description) ?> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="box"> |
|
|
|
|
|
|
|
<div class="box-header with-border"><?= Yii::t('blog', 'Content') ?></div>
|
|
|
|
|
|
|
|
<div class="box-body"> |
|
|
|
|
|
|
|
<?= Yii::$app->formatter->asHtml($post->content, [ |
|
|
|
|
|
|
|
'Attr.AllowedRel' => array('nofollow'), |
|
|
|
|
|
|
|
'HTML.SafeObject' => true, |
|
|
|
|
|
|
|
'Output.FlashCompat' => true, |
|
|
|
|
|
|
|
'HTML.SafeIframe' => true, |
|
|
|
|
|
|
|
'URI.SafeIframeRegexp'=>'%^(https?:)?//(www\.youtube(?:-nocookie)?\.com/embed/|player\.vimeo\.com/video/)%', |
|
|
|
|
|
|
|
]) ?> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="box"> |
|
|
|
|
|
|
|
<div class="box-header with-border"><?= Yii::t('blog', 'SEO') ?></div>
|
|
|
|
|
|
|
|
<div class="box-body"> |
|
|
|
|
|
|
|
<?= DetailView::widget([ |
|
|
|
|
|
|
|
'model' => $post, |
|
|
|
|
|
|
|
'attributes' => [ |
|
|
|
|
|
|
|
[ |
|
|
|
|
|
|
|
'attribute' => 'meta.title', |
|
|
|
|
|
|
|
'value' => $post->meta->title, |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
[ |
|
|
|
|
|
|
|
'attribute' => 'meta.description', |
|
|
|
|
|
|
|
'value' => $post->meta->description, |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
[ |
|
|
|
|
|
|
|
'attribute' => 'meta.keywords', |
|
|
|
|
|
|
|
'value' => $post->meta->keywords, |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
]) ?> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|