Commit a6fd26194159a4b4a3058aaf1af0687ac39b342c
1 parent
bb7c6ffc
правки
Showing
4 changed files
with
21 additions
and
82 deletions
Show diff stats
frontend/controllers/SiteController.php
@@ -2,6 +2,7 @@ | @@ -2,6 +2,7 @@ | ||
2 | 2 | ||
3 | namespace frontend\controllers; | 3 | namespace frontend\controllers; |
4 | 4 | ||
5 | + use artbox\core\models\Page; | ||
5 | use common\models\Feedback; | 6 | use common\models\Feedback; |
6 | use common\models\Settings; | 7 | use common\models\Settings; |
7 | use common\models\Slider; | 8 | use common\models\Slider; |
@@ -10,6 +11,7 @@ | @@ -10,6 +11,7 @@ | ||
10 | use yii\swiftmailer\Mailer; | 11 | use yii\swiftmailer\Mailer; |
11 | use yii\web\BadRequestHttpException; | 12 | use yii\web\BadRequestHttpException; |
12 | use yii\web\Controller; | 13 | use yii\web\Controller; |
14 | + use yii\web\NotFoundHttpException; | ||
13 | use yii\web\Response; | 15 | use yii\web\Response; |
14 | use common\models\Objectkb; | 16 | use common\models\Objectkb; |
15 | 17 | ||
@@ -105,7 +107,18 @@ | @@ -105,7 +107,18 @@ | ||
105 | */ | 107 | */ |
106 | public function actionAbout() | 108 | public function actionAbout() |
107 | { | 109 | { |
108 | - return $this->render('about'); | 110 | + $page = Page::find()->with('lang') |
111 | + ->where(['id' => 3])->one(); | ||
112 | + | ||
113 | + if ($page) { | ||
114 | + return $this->render('about', [ | ||
115 | + 'page' => $page, | ||
116 | + ]); | ||
117 | + | ||
118 | + } else { | ||
119 | + throw new NotFoundHttpException(); | ||
120 | + } | ||
121 | + | ||
109 | } | 122 | } |
110 | 123 | ||
111 | public function actionIndividual() | 124 | public function actionIndividual() |
frontend/views/layouts/main.php
@@ -152,10 +152,10 @@ | @@ -152,10 +152,10 @@ | ||
152 | <div class="navbar-collapse collapse" id="navigation"> | 152 | <div class="navbar-collapse collapse" id="navigation"> |
153 | <?php | 153 | <?php |
154 | $items = []; | 154 | $items = []; |
155 | -// $items[] = [ | ||
156 | -// 'label' => \Yii::t('app', 'Home'), | ||
157 | -// 'url' => [ Url::home() ], | ||
158 | -// ]; | 155 | + $items[] = [ |
156 | + 'label' => \Yii::t('app', 'menu-about'), | ||
157 | + 'url' => [ 'site/about' ], | ||
158 | + ]; | ||
159 | $items[] = [ | 159 | $items[] = [ |
160 | 'label' => \Yii::t('app', 'menu-individual'), | 160 | 'label' => \Yii::t('app', 'menu-individual'), |
161 | 'url' => [ 'site/individual' ], | 161 | 'url' => [ 'site/individual' ], |
frontend/views/object/index.php
@@ -32,13 +32,7 @@ | @@ -32,13 +32,7 @@ | ||
32 | <!--<div class="heading"> | 32 | <!--<div class="heading"> |
33 | <h2>наши объекты</h2> | 33 | <h2>наши объекты</h2> |
34 | </div>--> | 34 | </div>--> |
35 | - <p class="lead"><?= \Yii::t('app', 'object_text1') ?><br /><br /> | ||
36 | - • <?= \Yii::t('app', 'object_list1') ?><br /> | ||
37 | - • <?= \Yii::t('app', 'object_list2') ?><br /> | ||
38 | - • <?= \Yii::t('app', 'object_list3') ?><br /> | ||
39 | - • <?= \Yii::t('app', 'object_list4') ?><br /> | ||
40 | - • <?= \Yii::t('app', 'object_list5') ?><br /><br /> | ||
41 | - <?= \Yii::t('app', 'object_text1_2') ?></p> | 35 | + <p class="lead"><?= \Yii::t('app', 'object_text1') ?></p> |
42 | </div> | 36 | </div> |
43 | </div> | 37 | </div> |
44 | 38 |
frontend/views/site/about.php
@@ -4,8 +4,7 @@ | @@ -4,8 +4,7 @@ | ||
4 | 4 | ||
5 | /** | 5 | /** |
6 | * @var View $this | 6 | * @var View $this |
7 | - */ | ||
8 | - /** | 7 | + * @var \artbox\core\models\Page $page |
9 | * @var SeoComponent $seo | 8 | * @var SeoComponent $seo |
10 | */ | 9 | */ |
11 | $seo = \Yii::$app->get('seo'); | 10 | $seo = \Yii::$app->get('seo'); |
@@ -15,74 +14,7 @@ | @@ -15,74 +14,7 @@ | ||
15 | <section> | 14 | <section> |
16 | <div class="row"> | 15 | <div class="row"> |
17 | <div class="col-md-12"> | 16 | <div class="col-md-12"> |
18 | - | ||
19 | - <div class="heading"> | ||
20 | - <h2><?= \Yii::t('app', 'About Artbox') ?></h2> | ||
21 | - </div> | ||
22 | - | ||
23 | - <p class="lead"><?= \Yii::t('app', 'lorem') ?></p> | ||
24 | - | ||
25 | - </div> | ||
26 | - </div> | ||
27 | - | ||
28 | - <div class="row"> | ||
29 | - <div class="col-md-8"> | ||
30 | - <section> | ||
31 | - <div class="row"> | ||
32 | - <div class="col-md-12"> | ||
33 | - <div class="tabs"> | ||
34 | - <ul class="nav nav-tabs nav-justified"> | ||
35 | - <li class="active"> | ||
36 | - <a href="#tab1" data-toggle="tab" aria-expanded="true"><?= \Yii::t('app', 'First tab') ?></a> | ||
37 | - </li> | ||
38 | - <li class=""><a href="#tab2" data-toggle="tab" aria-expanded="false"><?= \Yii::t('app', 'Second tab') ?></a> | ||
39 | - </li> | ||
40 | - <li class=""><a href="#tab3" data-toggle="tab" aria-expanded="false"><?= \Yii::t('app', 'Third tab') ?></a> | ||
41 | - </li> | ||
42 | - </ul> | ||
43 | - <div class="tab-content"> | ||
44 | - <div class="tab-pane active" id="tab1"> | ||
45 | - <div class="row"> | ||
46 | - <div class="col-md-4"> | ||
47 | - <img src="/img/template-easy-customize.png" alt="" class="img-responsive"> | ||
48 | - </div> | ||
49 | - <div class="col-md-8"> | ||
50 | - <p><?= \Yii::t('app', 'lorem2') ?></p> | ||
51 | - <p><?= \Yii::t('app', 'lorem3') ?></p> | ||
52 | - </div> | ||
53 | - </div> | ||
54 | - </div> | ||
55 | - <div class="tab-pane" id="tab2"> | ||
56 | - <div class="row"> | ||
57 | - <div class="col-md-4"> | ||
58 | - <img src="/img/template-easy-code.png" alt="" class="img-responsive"> | ||
59 | - </div> | ||
60 | - <div class="col-md-8"> | ||
61 | - <p><?= \Yii::t('app', 'lorem2') ?></p> | ||
62 | - <p><?= \Yii::t('app', 'lorem3') ?></p> | ||
63 | - </div> | ||
64 | - </div> | ||
65 | - </div> | ||
66 | - <div class="tab-pane" id="tab3"> | ||
67 | - <p><?= \Yii::t('app', 'lorem2') ?></p> | ||
68 | - <p><?= \Yii::t('app', 'lorem3') ?></p> | ||
69 | - <p><?= \Yii::t('app', 'lorem3') ?></p> | ||
70 | - </div> | ||
71 | - </div> | ||
72 | - <!-- /.tab-content --> | ||
73 | - </div> | ||
74 | - </div> | ||
75 | - </div> | ||
76 | - </section> | ||
77 | - </div> | ||
78 | - | ||
79 | - <div class="col-md-4"> | ||
80 | - <div class="video"> | ||
81 | - <div class="embed-responsive embed-responsive-4by3"> | ||
82 | - <iframe class="embed-responsive-item" src="//www.youtube.com/embed/i9AHJkHqkpw?autoplay=0&showinfo=0&controls=0"></iframe> | ||
83 | - </div> | ||
84 | - | ||
85 | - </div> | 17 | + <?=$page->lang->body?> |
86 | </div> | 18 | </div> |
87 | </div> | 19 | </div> |
88 | </section> | 20 | </section> |