Commit 45dc5d7077acf55e526e404b346917acb23259db
1 parent
482650b7
individual page
Showing
4 changed files
with
158 additions
and
26 deletions
Show diff stats
frontend/controllers/ObjectController.php
frontend/controllers/SiteController.php
@@ -110,7 +110,28 @@ | @@ -110,7 +110,28 @@ | ||
110 | 110 | ||
111 | public function actionIndividual() | 111 | public function actionIndividual() |
112 | { | 112 | { |
113 | - return $this->render('individual'); | 113 | + |
114 | + $objects = Objectkb::find() | ||
115 | + ->with('lang.alias') | ||
116 | + ->where( | ||
117 | + [ | ||
118 | + 'id' => [ | ||
119 | + 7, | ||
120 | + 37, | ||
121 | + 38, | ||
122 | + 39, | ||
123 | + ], | ||
124 | + ] | ||
125 | + ) | ||
126 | + ->orderBy('id') | ||
127 | + ->all(); | ||
128 | + | ||
129 | + return $this->render( | ||
130 | + 'individual', | ||
131 | + [ | ||
132 | + 'objects' => $objects, | ||
133 | + ] | ||
134 | + ); | ||
114 | } // частное лицо | 135 | } // частное лицо |
115 | 136 | ||
116 | public function actionLegal() | 137 | public function actionLegal() |
frontend/views/layouts/main.php
@@ -94,25 +94,27 @@ | @@ -94,25 +94,27 @@ | ||
94 | 94 | ||
95 | </script> | 95 | </script> |
96 | <div id="all"> | 96 | <div id="all"> |
97 | - <div id="top"> | 97 | + <div id="top" class="hidden-xs"> |
98 | <div class="container"> | 98 | <div class="container"> |
99 | - <div class="col-md-10 phones_head" style="height:100%;"> | ||
100 | - <div class="top_phones"><i class="fa fa-phone" aria-hidden="true"></i> <span><a href="tel:<?=$settings->phone?>"><?=$settings->phone?></a></span> | ||
101 | - <span><a href="tel:<?=$settings->phone2?>"><?=$settings->phone2?></a></span></div> | ||
102 | - <div class="top_mail"><i class="fa fa-envelope-o" aria-hidden="true"></i> <span><a href="tel:<?=$settings->email?>"><?=$settings->email?></a></span></div> | ||
103 | - </div> | ||
104 | - <div class="col-md-2 text-right" style="height:100%;"> | ||
105 | - <div class="header-lang"> | ||
106 | - <?php | ||
107 | - $langs = \Yii::$app->language; | ||
108 | - $langs_a = explode("-",$langs); | ||
109 | - $this_lang = $langs_a['0']; | 99 | + <div class="row"> |
100 | + <div class="col-md-10 col-sm-10 col-xs-8 phones_head" style="height:100%;"> | ||
101 | + <div class="top_phones"><i class="fa fa-phone" aria-hidden="true"></i> <span><a href="tel:<?=$settings->phone?>"><?=$settings->phone?></a></span> | ||
102 | + <span><a href="tel:<?=$settings->phone2?>"><?=$settings->phone2?></a></span></div> | ||
103 | + <div class="top_mail"><i class="fa fa-envelope-o" aria-hidden="true"></i> <span><a href="tel:<?=$settings->email?>"><?=$settings->email?></a></span></div> | ||
104 | + </div> | ||
105 | + <div class="col-md-2 col-sm-2 col-xs-4 text-right" style="height:100%;"> | ||
106 | + <div class="header-lang"> | ||
107 | + <?php | ||
108 | + $langs = \Yii::$app->language; | ||
109 | + $langs_a = explode("-",$langs); | ||
110 | + $this_lang = $langs_a['0']; | ||
110 | 111 | ||
111 | - $langs_head = artbox\core\widgets\LangLink::widget(); | ||
112 | - $langs_head = str_replace(" / ".$this_lang,"",$langs_head); | ||
113 | - $langs_head = str_replace($this_lang." / ","",$langs_head); | ||
114 | - echo "<span class='active_lang'>$this_lang</span>".$langs_head; | ||
115 | - ?> | 112 | + $langs_head = artbox\core\widgets\LangLink::widget(); |
113 | + $langs_head = str_replace(" / ".$this_lang,"",$langs_head); | ||
114 | + $langs_head = str_replace($this_lang." / ","",$langs_head); | ||
115 | + echo "<span class='active_lang'>$this_lang</span>".$langs_head; | ||
116 | + ?> | ||
117 | + </div> | ||
116 | </div> | 118 | </div> |
117 | </div> | 119 | </div> |
118 | </div> | 120 | </div> |
frontend/views/site/individual.php
@@ -4,17 +4,19 @@ | @@ -4,17 +4,19 @@ | ||
4 | * @var View $this | 4 | * @var View $this |
5 | * @var Feedback $contact | 5 | * @var Feedback $contact |
6 | * @var SeoComponent $seo | 6 | * @var SeoComponent $seo |
7 | + * @var Objectkb[] $objects | ||
7 | */ | 8 | */ |
8 | 9 | ||
9 | -use artbox\core\components\SeoComponent; | ||
10 | -use artbox\core\models\Feedback; | ||
11 | -use common\models\Settings; | ||
12 | -use yii\helpers\Html; | ||
13 | -use yii\bootstrap\ActiveForm; | ||
14 | -use yii\web\View; | 10 | + use artbox\core\components\SeoComponent; |
11 | + use artbox\core\models\Feedback; | ||
12 | + use common\models\Settings; | ||
13 | + use yii\helpers\Html; | ||
14 | + use yii\bootstrap\ActiveForm; | ||
15 | + use yii\web\View; | ||
16 | + use common\models\Objectkb; | ||
15 | 17 | ||
16 | $settings = Settings::getInstance(); | 18 | $settings = Settings::getInstance(); |
17 | - | 19 | + |
18 | $this->params['h1'] = \Yii::t('app', 'menu-individual'); | 20 | $this->params['h1'] = \Yii::t('app', 'menu-individual'); |
19 | $this->params[ 'breadcrumbs' ][] = $this->params['h1']; | 21 | $this->params[ 'breadcrumbs' ][] = $this->params['h1']; |
20 | ?> | 22 | ?> |
@@ -59,5 +61,112 @@ use yii\web\View; | @@ -59,5 +61,112 @@ use yii\web\View; | ||
59 | </div> | 61 | </div> |
60 | </section> | 62 | </section> |
61 | 63 | ||
64 | + | ||
65 | + <section class="bar background-kben no-mb"> | ||
66 | + <div class="container"> | ||
67 | + <div class="row showcase"> | ||
68 | + <div class="col-md-3 col-sm-6"> | ||
69 | + <div class="item"> | ||
70 | + <h4><span class="counter">58</span><br> | ||
71 | + | ||
72 | + <?= Yii::t('app', 'sect22_1') ?></h4> | ||
73 | + </div> | ||
74 | + </div> | ||
75 | + <div class="col-md-3 col-sm-6"> | ||
76 | + <div class="item"> | ||
77 | + <h4><span class="counter">117</span><br> | ||
78 | + | ||
79 | + <?= Yii::t('app', 'sect22_2') ?></h4> | ||
80 | + </div> | ||
81 | + </div> | ||
82 | + <div class="col-md-3 col-sm-6"> | ||
83 | + <div class="item"> | ||
84 | + <h4><span class="counter">193</span><br> | ||
85 | + | ||
86 | + <?= Yii::t('app', 'sect22_3') ?></h4> | ||
87 | + </div> | ||
88 | + </div> | ||
89 | + <div class="col-md-3 col-sm-6"> | ||
90 | + <div class="item"> | ||
91 | + <h4><span class="counter">303</span><br> | ||
92 | + | ||
93 | + <?= Yii::t('app', 'sect22_4') ?></h4> | ||
94 | + </div> | ||
95 | + </div> | ||
96 | + </div> | ||
97 | + <!-- /.row --> | ||
98 | + </div> | ||
99 | + <!-- /.container --> | ||
100 | + </section> | ||
101 | + <section class="bar background-white objects-main-wr"> | ||
102 | + <div class="container"> | ||
103 | + <div class="col-md-12"> | ||
104 | + <div class="heading text-center"> | ||
105 | + <h2><?=\Yii::t('app', 'index_objects')?></h2> | ||
106 | + </div> | ||
107 | + <div class="row portfolio"> | ||
108 | + <?php | ||
109 | + if (!empty($objects)) { | ||
110 | + foreach ($objects as $object) { | ||
111 | + ?> | ||
112 | + <div class="col-sm-6"> | ||
113 | + <div class="box-image"> | ||
114 | + <div class="image"> | ||
115 | + <div class="image_link_wr"> | ||
116 | + <a href="<?= \yii\helpers\Url::toRoute( | ||
117 | + [ | ||
118 | + 'object/view', | ||
119 | + 'alias' => $object->lang->alias, | ||
120 | + ] | ||
121 | + ) ?>" class="image_link"> | ||
122 | + <?= $object->image->getImg([]) ?> | ||
123 | + </a> | ||
124 | + </div> | ||
125 | + <div class="img-title"> | ||
126 | + <table> | ||
127 | + <tr> | ||
128 | + <td class="buts text-left"> | ||
129 | + <a href="<?= \yii\helpers\Url::toRoute( | ||
130 | + [ | ||
131 | + 'object/view', | ||
132 | + 'alias' => $object->lang->alias, | ||
133 | + ] | ||
134 | + ) ?>" class="sqre_btn blue_arrow" | ||
135 | + alt="<?= $object->lang->object_name ?>"></a> | ||
136 | + <a href="#" | ||
137 | + class="btn sqre_btn yellow_calc modaled init-button-сalculate" | ||
138 | + data-title="<?= \Yii::t('app', 'modal1') ?>" | ||
139 | + data-toggle="modal" data-target="#feedback-modal"></a> | ||
140 | + </td> | ||
141 | + <td class="i-title" valign="center"> | ||
142 | + <p class="pr_title2"> | ||
143 | + <a href="<?= \yii\helpers\Url::toRoute( | ||
144 | + [ | ||
145 | + 'object/view', | ||
146 | + 'alias' => $object->lang->alias, | ||
147 | + ] | ||
148 | + ) ?>"> | ||
149 | + <?= $object->lang->object_name ?> | ||
150 | + </a> | ||
151 | + </p> | ||
152 | + </td> | ||
153 | + </tr> | ||
154 | + </table> | ||
155 | + </div> | ||
156 | + </div> | ||
157 | + </div> | ||
158 | + </div> | ||
159 | + <?php | ||
160 | + } | ||
161 | + }?> | ||
162 | + </div> | ||
163 | + <div class="row"> | ||
164 | + <div class="col-md-12 col-xs-12" style="text-align:center;margin-top: 20px;margin-bottom: -35px;"> | ||
165 | + <a href='site/object/index' class="button1 more-projects"><?= Yii::t('app', 'sect2_6') ?></a> | ||
166 | + </div> | ||
167 | + </div> | ||
168 | + </div> | ||
169 | + </div> | ||
170 | + </section> | ||
62 | </div> | 171 | </div> |
63 | </div> | 172 | </div> |
64 | \ No newline at end of file | 173 | \ No newline at end of file |