You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
135 lines
4.4 KiB
135 lines
4.4 KiB
<?php |
|
|
|
use yii\helpers\Html; |
|
use yii\widgets\DetailView; |
|
|
|
/* @var $this yii\web\View */ |
|
/* @var $page \common\modules\pages\entities\Page */ |
|
/* @var $history \common\modules\pages\entities\Page[] */ |
|
|
|
$this->title = $page->title; |
|
$this->params['breadcrumbs'][] = ['label' => Yii::t('page', 'Pages'), 'url' => ['index']]; |
|
$this->params['breadcrumbs'][] = $this->title; |
|
?> |
|
<div class="user-view"> |
|
|
|
<p> |
|
<?= Html::a(Yii::t('page','Pages'), ['index'], ['class' => 'btn btn-default']) ?> |
|
<?= Html::a(Yii::t('buttons', 'Edit'), ['update', 'id' => $page->id], ['class' => 'btn btn-primary']) ?> |
|
<?= Html::a(Yii::t('buttons', 'Delete'), ['delete', 'id' => $page->id], [ |
|
'class' => 'btn btn-danger', |
|
'data' => [ |
|
'confirm' => Yii::t('buttons', 'Are you sure you want to delete this item?'), |
|
'method' => 'post', |
|
], |
|
]) ?> |
|
</p> |
|
|
|
<div class="row"> |
|
<div class="col-md-9"> |
|
|
|
<div class="box"> |
|
<div class="box-header with-border"><?= Yii::t('page', 'Common') ?></div> |
|
<div class="box-body"> |
|
<?= DetailView::widget([ |
|
'model' => $page, |
|
'attributes' => [ |
|
'id', |
|
'title', |
|
'slug', |
|
], |
|
]) ?> |
|
</div> |
|
</div> |
|
|
|
<div class="box"> |
|
<div class="box-header with-border"><?= Yii::t('page', 'Content') ?></div> |
|
<div class="box-body"> |
|
<?= Yii::$app->formatter->asHtml($page->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('page', 'SEO') ?></div> |
|
<div class="box-body"> |
|
<?= DetailView::widget([ |
|
'model' => $page, |
|
'attributes' => [ |
|
[ |
|
'attribute' => 'meta.title', |
|
'label' => Yii::t('main', 'Title'), |
|
], |
|
[ |
|
'attribute' => 'meta.description', |
|
'label' => Yii::t('main', 'Description'), |
|
], |
|
[ |
|
'attribute' => 'meta.keywords', |
|
'label' => Yii::t('main', 'Keywords'), |
|
], |
|
], |
|
]) ?> |
|
</div> |
|
</div> |
|
|
|
</div> |
|
|
|
<div class="col-md-3"> |
|
<div class="box"> |
|
<div class="box-header with-border"><?= Yii::t('page', 'History') ?></div> |
|
<div class="box-body"> |
|
|
|
<?php if ($history): ?> |
|
<ul> |
|
<?php foreach ($history as $item): ?> |
|
<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(['/pages/page/preview', 'id' => $item->id])), [ |
|
'style' => 'font-size:11px;', |
|
'target' => '_blank', |
|
]) ?> |
|
|
|
| |
|
|
|
<?= Html::a(Yii::t('page', 'Restore'), ['/pages/manage/page/restore-history', 'id' => $item->id], [ |
|
'style' => 'font-size:11px; color: red', |
|
'data' => [ |
|
'confirm' => Yii::t('page', 'Are you sure you want to restore this history item?'), |
|
'method' => 'post', |
|
], |
|
]) ?> |
|
|
|
<?php else: ?> |
|
<strong><?= Yii::t('page', 'Current Edition') ?></strong> |
|
<?php endif; ?> |
|
</li> |
|
<?php endforeach; ?> |
|
</ul> |
|
|
|
<?= Html::a(Yii::t('page', 'Clear History'), ['/pages/manage/page/clear-history', 'id' => $page->id], [ |
|
'class' => 'btn btn-danger btn-sm pull-right', |
|
'data' => [ |
|
'confirm' => Yii::t('page', 'Are you sure you want to remove this history?'), |
|
'method' => 'post', |
|
], |
|
]) ?> |
|
<?php else: ?> |
|
<div style="padding: 20px 0; text-align: center"><?= Yii::t('page', 'History is empty') ?></div> |
|
<?php endif; ?> |
|
|
|
</div> |
|
</div> |
|
</div> |
|
|
|
</div> |
|
|
|
</div>
|
|
|