added no image and tweak display fields

master
cornernote 2015-08-12 09:42:36 +09:30
parent d3a6bc2989
commit a738115b0a
3 changed files with 27 additions and 15 deletions

View File

@ -1,8 +1,7 @@
<?php <?php
use app\components\Git; use kartik\detail\DetailView;
use yii\helpers\Html; use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */ /* @var $this yii\web\View */
/* @var $model app\models\Package */ /* @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> <h2><?= Html::a(Html::encode($model->name), ['view', 'name' => $model->name]) ?></h2>
<div class="row"> <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"> <div class="col-sm-10">
<?= DetailView::widget([ <?= DetailView::widget([
'model' => $model, 'model' => $model,
'hideIfEmpty' => true,
'attributes' => [ 'attributes' => [
'description', 'description',
'keywords', 'keywords',
[
'label' => 'Authors',
'value' => $model->getAuthorsHtml(),
'format' => 'raw',
],
[
'label' => 'License',
'value' => $model->getLicenseHtml(),
'format' => 'raw',
],
[ [
'label' => 'Links', 'label' => 'Links',
'value' => $model->getLinksHtml(true), 'value' => $model->getLinksHtml(),
'format' => 'raw', 'format' => 'raw',
], ],
], ],
]) ?> ]) ?>
</div> </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>
</div> </div>

View File

@ -37,11 +37,6 @@ $this->params['breadcrumbs'][] = $this->title;
'name', 'name',
//'description', //'description',
'keywords', 'keywords',
[
'label' => 'Links',
'value' => $model->getLinksHtml(false),
'format' => 'raw',
],
[ [
'label' => 'Authors', 'label' => 'Authors',
'value' => $model->getAuthorsHtml(), 'value' => $model->getAuthorsHtml(),
@ -52,6 +47,11 @@ $this->params['breadcrumbs'][] = $this->title;
'value' => $model->getLicenseHtml(), 'value' => $model->getLicenseHtml(),
'format' => 'raw', 'format' => 'raw',
], ],
[
'label' => 'Links',
'value' => $model->getLinksHtml(),
'format' => 'raw',
],
//'hits', //'hits',
'created_at', 'created_at',
//[ //[

BIN
web/img/no-image.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB