added no image and tweak display fields
This commit is contained in:
parent
d3a6bc2989
commit
a738115b0a
@ -1,8 +1,7 @@
|
||||
<?php
|
||||
|
||||
use app\components\Git;
|
||||
use kartik\detail\DetailView;
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\DetailView;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model app\models\Package */
|
||||
@ -13,27 +12,40 @@ use yii\widgets\DetailView;
|
||||
<h2><?= Html::a(Html::encode($model->name), ['view', 'name' => $model->name]) ?></h2>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-2">
|
||||
<?php
|
||||
if ($model->screenshots) {
|
||||
echo Html::a(Html::img($model->screenshots[0], ['class' => 'thumbnail']), ['view', 'name' => $model->name]);
|
||||
} else {
|
||||
echo Html::a(Html::img('@web/img/no-image.png', ['class' => 'thumbnail']), ['view', 'name' => $model->name]);
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div class="col-sm-10">
|
||||
<?= DetailView::widget([
|
||||
'model' => $model,
|
||||
'hideIfEmpty' => true,
|
||||
'attributes' => [
|
||||
'description',
|
||||
'keywords',
|
||||
[
|
||||
'label' => 'Authors',
|
||||
'value' => $model->getAuthorsHtml(),
|
||||
'format' => 'raw',
|
||||
],
|
||||
[
|
||||
'label' => 'License',
|
||||
'value' => $model->getLicenseHtml(),
|
||||
'format' => 'raw',
|
||||
],
|
||||
[
|
||||
'label' => 'Links',
|
||||
'value' => $model->getLinksHtml(true),
|
||||
'value' => $model->getLinksHtml(),
|
||||
'format' => 'raw',
|
||||
],
|
||||
],
|
||||
]) ?>
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
<?php
|
||||
if ($model->screenshots) {
|
||||
echo Html::a(Html::img($model->screenshots[0], ['class' => 'thumbnail']), ['view', 'name' => $model->name]);
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
@ -37,11 +37,6 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
'name',
|
||||
//'description',
|
||||
'keywords',
|
||||
[
|
||||
'label' => 'Links',
|
||||
'value' => $model->getLinksHtml(false),
|
||||
'format' => 'raw',
|
||||
],
|
||||
[
|
||||
'label' => 'Authors',
|
||||
'value' => $model->getAuthorsHtml(),
|
||||
@ -52,6 +47,11 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
'value' => $model->getLicenseHtml(),
|
||||
'format' => 'raw',
|
||||
],
|
||||
[
|
||||
'label' => 'Links',
|
||||
'value' => $model->getLinksHtml(),
|
||||
'format' => 'raw',
|
||||
],
|
||||
//'hits',
|
||||
'created_at',
|
||||
//[
|
||||
|
BIN
web/img/no-image.png
Normal file
BIN
web/img/no-image.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.5 KiB |
Loading…
x
Reference in New Issue
Block a user