diff --git a/backend/config/main.php b/backend/config/main.php index 1995c18..0fa8aa9 100755 --- a/backend/config/main.php +++ b/backend/config/main.php @@ -35,7 +35,7 @@ ], 'components' => [ 'assetManager' => [ - 'bundles' => [ + 'bundles' => [ 'yiister\gentelella\assets\ThemeAsset' => [ 'basePath' => '@webroot', 'baseUrl' => '@web', @@ -47,6 +47,7 @@ ], ], ], + 'appendTimestamp' => true, ], 'imagemanager' => [ 'class' => 'noam148\imagemanager\components\ImageManagerGetPath', diff --git a/backend/controllers/SettingsController.php b/backend/controllers/SettingsController.php index b0a0f9c..02f710d 100755 --- a/backend/controllers/SettingsController.php +++ b/backend/controllers/SettingsController.php @@ -31,10 +31,6 @@ 'allow' => true, ], [ - 'actions' => [ - 'logout', - 'index', - ], 'allow' => true, 'roles' => [ '@' ], ], @@ -53,7 +49,7 @@ $model = $this->findSettings(); if ($model->load(Yii::$app->request->post()) && $model->save()) { - Yii::$app->session->setFlash('success', 'Settings saved'); + Yii::$app->session->setFlash('success', \Yii::t('core', 'Settings saved')); return $this->goHome(); } @@ -65,6 +61,23 @@ ] ); } + + public function actionRobots() + { + $model = $this->findSettings(); + $model->scenario = Settings::SCENARIO_ROBOTS; + + if ($model->load(\Yii::$app->request->post()) && $model->save()) { + \Yii::$app->session->setFlash('success', \Yii::t('core', 'Robots saved')); + } + + return $this->render( + 'robots', + [ + 'model' => $model, + ] + ); + } /** * Find site settings diff --git a/backend/views/layouts/main.php b/backend/views/layouts/main.php index 264925e..007a51d 100755 --- a/backend/views/layouts/main.php +++ b/backend/views/layouts/main.php @@ -135,6 +135,14 @@ $homeLink, [ [ + 'label' => \Yii::t('core', 'Main'), + 'url' => [ '/site/index' ], + 'icon' => ( \Yii::$app->controller->id === 'site' ) ? 'check' : 'undo', + 'active' => function () { + return \Yii::$app->controller->id === 'site'; + }, + ], + [ 'label' => \Yii::t('core', 'Static pages'), 'url' => [ 'page/index' ], 'icon' => 'file-text', @@ -143,12 +151,21 @@ }, ], [ - 'label' => \Yii::t('core', 'SEO'), - 'url' => [ 'seo/index' ], - 'icon' => 'bolt', - 'active' => function () { - return \Yii::$app->controller->id === 'seo'; - }, + 'label' => \Yii::t('core', 'SEO'), + 'url' => '#', + 'icon' => 'bolt', + 'items' => [ + [ + 'label' => \Yii::t('core', 'Seo pages'), + 'url' => [ 'seo/index' ], + 'icon' => 'file-text', + ], + [ + 'label' => \Yii::t('core', 'Robots'), + 'url' => [ 'settings/robots' ], + 'icon' => 'android', + ], + ], ], ] ); diff --git a/backend/views/settings/robots.php b/backend/views/settings/robots.php new file mode 100755 index 0000000..003c839 --- /dev/null +++ b/backend/views/settings/robots.php @@ -0,0 +1,45 @@ +title = $model->getAttributeLabel('robots'); + + $this->params[ 'breadcrumbs' ][] = $this->title; +?> + + $this->title, + 'toolbar' => false, + ] +); ?> + +