From ad2187adbd296733bb42eda134248541eea868ad Mon Sep 17 00:00:00 2001 From: Anastasia Date: Thu, 14 Jun 2018 13:21:08 +0300 Subject: [PATCH] - book, author in admin --- backend/views/book/_form.php | 10 ++++++++-- backend/views/book/update.php | 6 +++--- backend/views/layouts/menu_items.php | 10 ++++++++++ 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/backend/views/book/_form.php b/backend/views/book/_form.php index 0c618b5..bc79c0c 100644 --- a/backend/views/book/_form.php +++ b/backend/views/book/_form.php @@ -1,6 +1,7 @@ field($model, 'title') ->textInput([ 'maxlength' => true ]) ?> - author->name.' '.$model->author->secondname?> +
+ id.'/'.$model->image)->cropResize(262, 390)->renderImage()?> +
+ author->name.' '.$model->author->secondname?> field($model, 'description') ->widget( @@ -84,13 +88,15 @@ window.open('" . Url::to( ] ); ?> - + field($model, 'price') + ->textInput() ?> field($model, 'on_main') ->checkbox( [ 'class' => 'switchery', ] ) ?> +
isNewRecord ? Yii::t('core', 'Create') : Yii::t('core', 'Update'), diff --git a/backend/views/book/update.php b/backend/views/book/update.php index 9abfd51..765aa4f 100644 --- a/backend/views/book/update.php +++ b/backend/views/book/update.php @@ -3,7 +3,7 @@ use yiister\gentelella\widgets\Panel; /* @var $this yii\web\View */ - /* @var $model artbox\core\models\Feedback */ + /* @var $model \common\models\Book */ $this->title = Yii::t( 'core', @@ -11,13 +11,13 @@ [ 'modelClass' => 'Book', ] - ) . $model->name; + ) . $model->title; $this->params[ 'breadcrumbs' ][] = [ 'label' => Yii::t('app', 'Books'), 'url' => [ 'index' ], ]; $this->params[ 'breadcrumbs' ][] = [ - 'label' => $model->name, + 'label' => $model->title, 'url' => [ 'view', 'id' => $model->id, diff --git a/backend/views/layouts/menu_items.php b/backend/views/layouts/menu_items.php index 439680a..4275f83 100755 --- a/backend/views/layouts/menu_items.php +++ b/backend/views/layouts/menu_items.php @@ -45,6 +45,16 @@ 'url' => [ '/page-category/index' ], ], + [ + 'label' => \Yii::t('app', 'Books'), + 'url' => [ '/book/index' ], + + ], + [ + 'label' => \Yii::t('app', 'Author'), + 'url' => [ '/author/index' ], + + ], ], ], -- libgit2 0.21.4