Add alert when no bower.json file exists.

This commit is contained in:
cornernote 2015-08-09 17:35:35 +09:30
parent 1087ddf9ef
commit a8b60e0112
2 changed files with 15 additions and 3 deletions

View File

@ -25,7 +25,7 @@ use yii\widgets\DetailView;
?>
<div class="row">
<div class="col-md-10">
<div class="col-sm-10">
<?= DetailView::widget([
'model' => $model,
'attributes' => [
@ -45,7 +45,7 @@ use yii\widgets\DetailView;
],
]) ?>
</div>
<div class="col-md-2">
<div class="col-sm-2">
<?= Html::a(Html::img($model->screenshot, [
'class' => 'thumbnail',
'style' => 'max-width:100%',

View File

@ -1,6 +1,7 @@
<?php
use app\components\Git;
use yii\bootstrap\Alert;
use yii\helpers\Html;
use yii\widgets\DetailView;
@ -15,9 +16,20 @@ $this->params['breadcrumbs'][] = $this->title;
<h1>
<?= Html::encode($this->title) ?>
<?= Html::a('Update', ['update', 'name' => $model->name], ['class' => 'btn btn-primary pull-right']) ?>
<?= Html::a('Update bower.json', ['update', 'name' => $model->name], ['class' => 'btn btn-primary pull-right']) ?>
</h1>
<?php
if (!$model->bower) {
echo Alert::widget([
'options' => [
'class' => 'alert-danger',
],
'body' => 'This mod has no ' . Html::a('bower.json', ['/docs/bower-json-format']) . ' file. Please consider adding one to the <a href="' . Git::getUrl($model->url) . '">repository</a>.',
]);
}
?>
<?= DetailView::widget([
'model' => $model,
'attributes' => [