Commit 35c62a48ef2f383cb804ee66f471e4f9ca572f23
Merge remote-tracking branch 'origin/master'
Showing
15 changed files
with
351 additions
and
249 deletions
Show diff stats
backend/views/settings/_contact_tab.php
| @@ -19,6 +19,7 @@ echo '<div class="wrapp-blocks-edit-page">'; | @@ -19,6 +19,7 @@ echo '<div class="wrapp-blocks-edit-page">'; | ||
| 19 | echo $form->field($model, 'phone2') | 19 | echo $form->field($model, 'phone2') |
| 20 | ->textInput() | 20 | ->textInput() |
| 21 | ->hint(\Yii::t('core', 'Contact phone for website')); | 21 | ->hint(\Yii::t('core', 'Contact phone for website')); |
| 22 | + echo "<p>Введите несколько телефонов, разделенных ;</p>"; | ||
| 22 | echo '</div>'; | 23 | echo '</div>'; |
| 23 | echo '<div class="wrapp-blocks-edit-page">'; | 24 | echo '<div class="wrapp-blocks-edit-page">'; |
| 24 | echo $form->field($model, 'email') | 25 | echo $form->field($model, 'email') |
frontend/components/UrlManager.php
| @@ -65,6 +65,22 @@ | @@ -65,6 +65,22 @@ | ||
| 65 | /** | 65 | /** |
| 66 | * @var Alias $alias | 66 | * @var Alias $alias |
| 67 | */ | 67 | */ |
| 68 | + if ($request->pathInfo === '') { | ||
| 69 | + // Do redirect if no active alias for homepage | ||
| 70 | + $seo = \Yii::$app->get('seo'); | ||
| 71 | + $alias = Alias::findRoute([ 'site/index' ], $this->languages->getCurrent()); | ||
| 72 | + if ($alias) { | ||
| 73 | + $seo->setAlias($alias); | ||
| 74 | + | ||
| 75 | + $params = Json::decode($alias->route); | ||
| 76 | + | ||
| 77 | + $route = array_shift($params); | ||
| 78 | + return [ | ||
| 79 | + $route, | ||
| 80 | + $params, | ||
| 81 | + ]; | ||
| 82 | + } | ||
| 83 | + } | ||
| 68 | $alias = Alias::find() | 84 | $alias = Alias::find() |
| 69 | ->where( | 85 | ->where( |
| 70 | [ | 86 | [ |
frontend/config/main.php
| 1 | <?php | 1 | <?php |
| 2 | - use artbox\core\components\SeoComponent; | ||
| 3 | use frontend\components\UrlManager; | 2 | use frontend\components\UrlManager; |
| 4 | 3 | ||
| 5 | $params = array_merge( | 4 | $params = array_merge( |
| @@ -66,20 +65,70 @@ | @@ -66,20 +65,70 @@ | ||
| 66 | 'scenario' => 'callback', | 65 | 'scenario' => 'callback', |
| 67 | 'successCallback' => 'function (data) { | 66 | 'successCallback' => 'function (data) { |
| 68 | document.getElementById("feedback-form").reset(); | 67 | document.getElementById("feedback-form").reset(); |
| 69 | - $(".close").click(); | 68 | + $("#modal_close").click(); |
| 70 | if (data.status == "success"){ | 69 | if (data.status == "success"){ |
| 71 | document.getElementById("feedback-form").reset(); | 70 | document.getElementById("feedback-form").reset(); |
| 72 | - $(".success_").animate({opacity: 1, top: \'40\'}, 200).addClass("done_"); | ||
| 73 | - setTimeout(function(){$(".success_").animate({opacity: 0, top: \'0\'}, 200,function(){ | ||
| 74 | - $(this).removeClass("done_"); | ||
| 75 | - })}, 4000); | 71 | + success(); |
| 76 | var data = $("#feedback-form").data(\'yiiActiveForm\'); | 72 | var data = $("#feedback-form").data(\'yiiActiveForm\'); |
| 77 | data.validated = false; | 73 | data.validated = false; |
| 78 | } | 74 | } |
| 79 | }', | 75 | }', |
| 80 | 76 | ||
| 81 | ], | 77 | ], |
| 78 | + 'contact' => [ | ||
| 79 | + 'class' => 'artbox\core\forms\Module', | ||
| 80 | + 'activeRecord' => "artbox\core\models\Feedback", | ||
| 81 | + 'attributes' => [ | ||
| 82 | + 'name', | ||
| 83 | + 'email', | ||
| 84 | + 'message', | ||
| 85 | + ], | ||
| 86 | + 'rules' => [ | ||
| 87 | + [ | ||
| 88 | + [ | ||
| 89 | + 'name', | ||
| 90 | + 'email', | ||
| 91 | + ], | ||
| 92 | + 'required', | ||
| 93 | + ] | ||
| 94 | + ], | ||
| 95 | + 'labels' => [ | ||
| 96 | + 'name' => 'Name', | ||
| 97 | + 'message' => 'You Question', | ||
| 98 | + 'phone' => 'Email' | ||
| 99 | + ], | ||
| 100 | + | ||
| 101 | + 'inputOptions' => [ | ||
| 102 | + 'name' => [ | ||
| 103 | + 'template' => '<div class="input-wr required">{input}</div>' | ||
| 104 | + ], | ||
| 105 | + 'email' => [ | ||
| 106 | + 'template' => '<div class="input-wr required">{input}</div>' | ||
| 107 | + ], | ||
| 108 | + 'message' => [ | ||
| 109 | + 'type' => 'textarea', | ||
| 110 | + 'options' => [], | ||
| 111 | + 'template' => '<div class="input-wr">{input}</div>' | ||
| 112 | + ], | ||
| 113 | + ], | ||
| 114 | + 'buttonTemplate' => '<div class="button-wr submit-close-wr-c-a">{button}</div>', | ||
| 115 | + 'buttonOptions' => [], | ||
| 116 | + 'buttonContent' => 'Send', | ||
| 117 | + 'sendEmail' => false, | ||
| 118 | + 'ajax' => true, | ||
| 119 | + 'formId' => 'contact-form', | ||
| 120 | + 'scenario' => 'feedback', | ||
| 121 | + 'successCallback' => 'function (data) { | ||
| 122 | + document.getElementById("contact-form").reset(); | ||
| 123 | + if (data.status == "success"){ | ||
| 124 | + document.getElementById("contact-form").reset(); | ||
| 125 | + success(); | ||
| 126 | + var data = $("#contact-form").data(\'yiiActiveForm\'); | ||
| 127 | + data.validated = false; | ||
| 128 | + } | ||
| 129 | + }', | ||
| 82 | 130 | ||
| 131 | + ], | ||
| 83 | 'comments' => [ | 132 | 'comments' => [ |
| 84 | 'class' => 'artbox\core\forms\Module', | 133 | 'class' => 'artbox\core\forms\Module', |
| 85 | 'activeRecord' => "common\models\Comment", | 134 | 'activeRecord' => "common\models\Comment", |
| @@ -305,9 +354,6 @@ | @@ -305,9 +354,6 @@ | ||
| 305 | ], | 354 | ], |
| 306 | ], | 355 | ], |
| 307 | ], | 356 | ], |
| 308 | - 'seo' => [ | ||
| 309 | - 'class' => SeoComponent::className(), | ||
| 310 | - ], | ||
| 311 | 'errorHandler' => [ | 357 | 'errorHandler' => [ |
| 312 | 'errorAction' => 'site/error', | 358 | 'errorAction' => 'site/error', |
| 313 | ], | 359 | ], |
frontend/controllers/BlogController.php
| @@ -30,7 +30,7 @@ | @@ -30,7 +30,7 @@ | ||
| 30 | ->where(['status' => true]) | 30 | ->where(['status' => true]) |
| 31 | ->orderBy([ 'sort' => SORT_ASC ]) | 31 | ->orderBy([ 'sort' => SORT_ASC ]) |
| 32 | ->all(); | 32 | ->all(); |
| 33 | - $data = ArrayHelper::map($categories, 'id', 'language.title'); | 33 | + $data = ArrayHelper::map($categories, 'language.alias.value', 'language.title'); |
| 34 | $dataProvider = new ActiveDataProvider( | 34 | $dataProvider = new ActiveDataProvider( |
| 35 | [ | 35 | [ |
| 36 | 'query' => Article::find() | 36 | 'query' => Article::find() |
| @@ -87,14 +87,16 @@ | @@ -87,14 +87,16 @@ | ||
| 87 | 87 | ||
| 88 | public function actionCategory($id) | 88 | public function actionCategory($id) |
| 89 | { | 89 | { |
| 90 | - $tags = Tag::find() | ||
| 91 | - ->with( | ||
| 92 | - [ | ||
| 93 | - 'language', | ||
| 94 | - ] | ||
| 95 | - ) | ||
| 96 | - ->orderBy([ 'sort' => SORT_ASC ]) | ||
| 97 | - ->all(); | 90 | + $categories = Category::find() |
| 91 | + ->with( | ||
| 92 | + [ | ||
| 93 | + 'language', | ||
| 94 | + ] | ||
| 95 | + ) | ||
| 96 | + ->where(['status' => true]) | ||
| 97 | + ->orderBy([ 'sort' => SORT_ASC ]) | ||
| 98 | + ->all(); | ||
| 99 | + $data = ArrayHelper::map($categories, 'language.alias.value', 'language.title'); | ||
| 98 | 100 | ||
| 99 | /** | 101 | /** |
| 100 | * @var Category $model | 102 | * @var Category $model |
| @@ -138,23 +140,25 @@ | @@ -138,23 +140,25 @@ | ||
| 138 | return $this->render( | 140 | return $this->render( |
| 139 | 'category', | 141 | 'category', |
| 140 | [ | 142 | [ |
| 141 | - 'tags' => $tags, | ||
| 142 | 'dataProvider' => $dataProvider, | 143 | 'dataProvider' => $dataProvider, |
| 143 | 'model' => $model, | 144 | 'model' => $model, |
| 145 | + 'categories' => $data | ||
| 144 | ] | 146 | ] |
| 145 | ); | 147 | ); |
| 146 | } | 148 | } |
| 147 | 149 | ||
| 148 | public function actionTag($id) | 150 | public function actionTag($id) |
| 149 | { | 151 | { |
| 150 | - $tags = Tag::find() | ||
| 151 | - ->with( | ||
| 152 | - [ | ||
| 153 | - 'language', | ||
| 154 | - ] | ||
| 155 | - ) | ||
| 156 | - ->orderBy([ 'sort' => SORT_ASC ]) | ||
| 157 | - ->all(); | 152 | + $categories = Category::find() |
| 153 | + ->with( | ||
| 154 | + [ | ||
| 155 | + 'language', | ||
| 156 | + ] | ||
| 157 | + ) | ||
| 158 | + ->where(['status' => true]) | ||
| 159 | + ->orderBy([ 'sort' => SORT_ASC ]) | ||
| 160 | + ->all(); | ||
| 161 | + $data = ArrayHelper::map($categories, 'language.alias.value', 'language.title'); | ||
| 158 | 162 | ||
| 159 | /** | 163 | /** |
| 160 | * @var Category $model | 164 | * @var Category $model |
| @@ -196,9 +200,9 @@ | @@ -196,9 +200,9 @@ | ||
| 196 | return $this->render( | 200 | return $this->render( |
| 197 | 'tag', | 201 | 'tag', |
| 198 | [ | 202 | [ |
| 199 | - 'tags' => $tags, | ||
| 200 | 'dataProvider' => $dataProvider, | 203 | 'dataProvider' => $dataProvider, |
| 201 | 'model' => $model, | 204 | 'model' => $model, |
| 205 | + 'categories' => $data | ||
| 202 | ] | 206 | ] |
| 203 | ); | 207 | ); |
| 204 | } | 208 | } |
frontend/controllers/PackageController.php
| @@ -23,11 +23,11 @@ | @@ -23,11 +23,11 @@ | ||
| 23 | } | 23 | } |
| 24 | 24 | ||
| 25 | public function actionIndex(){ | 25 | public function actionIndex(){ |
| 26 | - $dataProvider = new ActiveDataProvider([ | ||
| 27 | - 'query' => Package::find()->with(['language.alias'])->where(['status' => true])->orderBy('sort') | ||
| 28 | - ]); | 26 | + |
| 27 | + $packages = Package::find()->with(['language.alias'])->where(['status' => true])->orderBy('sort')->all(); | ||
| 28 | + | ||
| 29 | return $this->render('index', [ | 29 | return $this->render('index', [ |
| 30 | - 'dataProvider' => $dataProvider | 30 | + 'packages' => $packages |
| 31 | ]); | 31 | ]); |
| 32 | } | 32 | } |
| 33 | } | 33 | } |
| 34 | \ No newline at end of file | 34 | \ No newline at end of file |
frontend/controllers/SiteController.php
| @@ -94,10 +94,12 @@ | @@ -94,10 +94,12 @@ | ||
| 94 | public function actionContact() | 94 | public function actionContact() |
| 95 | { | 95 | { |
| 96 | $contact = new Feedback(); | 96 | $contact = new Feedback(); |
| 97 | + $settings = Settings::getInstance(); | ||
| 97 | return $this->render( | 98 | return $this->render( |
| 98 | 'contact', | 99 | 'contact', |
| 99 | [ | 100 | [ |
| 100 | 'contact' => $contact, | 101 | 'contact' => $contact, |
| 102 | + 'settings' => $settings | ||
| 101 | ] | 103 | ] |
| 102 | ); | 104 | ); |
| 103 | } | 105 | } |
frontend/views/blog/category.php
| 1 | <?php | 1 | <?php |
| 2 | 2 | ||
| 3 | use artbox\core\components\SeoComponent; | 3 | use artbox\core\components\SeoComponent; |
| 4 | - use frontend\widgets\BlogSearch; | ||
| 5 | - use yii\data\ActiveDataProvider; | ||
| 6 | use artbox\core\helpers\Url; | 4 | use artbox\core\helpers\Url; |
| 5 | + use yii\data\ActiveDataProvider; | ||
| 6 | + use yii\helpers\Html; | ||
| 7 | use yii\web\View; | 7 | use yii\web\View; |
| 8 | + use yii\widgets\ActiveForm; | ||
| 8 | use yii\widgets\ListView; | 9 | use yii\widgets\ListView; |
| 9 | 10 | ||
| 10 | /** | 11 | /** |
| @@ -12,103 +13,85 @@ | @@ -12,103 +13,85 @@ | ||
| 12 | * @var ActiveDataProvider $dataProvider | 13 | * @var ActiveDataProvider $dataProvider |
| 13 | * @var SeoComponent $seo | 14 | * @var SeoComponent $seo |
| 14 | * @var \common\models\blog\Tag[] $tags | 15 | * @var \common\models\blog\Tag[] $tags |
| 15 | - * @var \common\models\blog\Category $model | 16 | + * @var common\models\blog\Category[] $categories |
| 17 | + * @var \common\models\blog\Category $model; | ||
| 16 | */ | 18 | */ |
| 17 | $seo = \Yii::$app->get('seo'); | 19 | $seo = \Yii::$app->get('seo'); |
| 18 | 20 | ||
| 19 | $this->params[ 'breadcrumbs' ][] = [ | 21 | $this->params[ 'breadcrumbs' ][] = [ |
| 20 | - 'label' => \Yii::t('app', 'Блог'), | ||
| 21 | - 'url' => [ 'blog/index' ], | 22 | + 'label' => \Yii::t('app', 'Блог'), |
| 23 | + 'url' => Url::to(['blog/index']) | ||
| 22 | ]; | 24 | ]; |
| 23 | - | ||
| 24 | - $this->params[ 'breadcrumbs' ][] = $seo->title; | 25 | + $this->params['breadcrumbs'][] = $model->title; |
| 25 | 26 | ||
| 26 | ?> | 27 | ?> |
| 27 | 28 | ||
| 28 | -<div id="content"> | 29 | +<section class="blog-all-bg"> |
| 29 | <div class="container"> | 30 | <div class="container"> |
| 30 | <div class="row"> | 31 | <div class="row"> |
| 31 | - <!-- *** LEFT COLUMN *** | ||
| 32 | -_________________________________________________________ --> | ||
| 33 | - | ||
| 34 | - | ||
| 35 | - <!-- <ul class="pager">--> | ||
| 36 | - <!-- <li class="previous"><a href="#">← Назад</a>--> | ||
| 37 | - <!-- </li>--> | ||
| 38 | - <!-- <li class="next disabled"><a href="#">Вперед →</a>--> | ||
| 39 | - <!-- </li>--> | ||
| 40 | - <!-- </ul>--> | ||
| 41 | - | ||
| 42 | - <!-- /.col-md-9 --> | ||
| 43 | - | ||
| 44 | - | 32 | + <div class="col-xs-12 col-sm-12"> |
| 33 | + <div class="blog-title title-pages">Блог</div> | ||
| 34 | + </div> | ||
| 35 | + </div> | ||
| 36 | + <div class="row"> | ||
| 37 | + <div class="col-xs-12 col-sm-5 col-md-4 col-lg-3"> | ||
| 38 | + <div class="fb-subscribe"> | ||
| 39 | + Подписывайтесь на наши новости | ||
| 40 | + на канале FACEBOOK | ||
| 41 | + </div> | ||
| 42 | + </div> | ||
| 43 | + </div> | ||
| 44 | + <div class="row"> | ||
| 45 | + <div class="col-xs-12 col-sm-12"> | ||
| 46 | + <div class="style fb-subscribe-btn"> | ||
| 47 | + <a target="_blank" href="#" class="btn_">Подписаться</a> | ||
| 48 | + </div> | ||
| 49 | + </div> | ||
| 50 | + </div> | ||
| 51 | + </div> | ||
| 52 | +</section> | ||
| 53 | + | ||
| 54 | +<section class="blog-all-section"> | ||
| 55 | + <div class="container"> | ||
| 56 | + <div class="row"> | ||
| 57 | + <div class="col-xs-12 col-sm-12 select-blog-col"> | ||
| 58 | + <div class="select-blog"> | ||
| 59 | + <?php $form = ActiveForm::begin();?> | ||
| 60 | + <div class="input-wr"> | ||
| 61 | + <?=Html::dropDownList('categories', $model->language->alias->value, ['' => 'Все рубрики']+$categories, [ | ||
| 62 | + 'id' => 'blog-categories' | ||
| 63 | + ])?> | ||
| 64 | + </div> | ||
| 65 | + <?php ActiveForm::end()?> | ||
| 66 | + </div> | ||
| 67 | + </div> | ||
| 68 | + </div> | ||
| 69 | + <div class="row blog-list-row"> | ||
| 45 | <?= ListView::widget( | 70 | <?= ListView::widget( |
| 46 | [ | 71 | [ |
| 47 | 'dataProvider' => $dataProvider, | 72 | 'dataProvider' => $dataProvider, |
| 48 | 'itemView' => '_article', | 73 | 'itemView' => '_article', |
| 49 | 'options' => [ | 74 | 'options' => [ |
| 50 | - 'class' => 'col-md-9', | ||
| 51 | - 'id' => 'blog-listing-medium', | 75 | + 'class' => 'col-xs-12 col-sm-4 col-md-4 blog-list-col', |
| 52 | ], | 76 | ], |
| 53 | 'layout' => '{items}{pager}', | 77 | 'layout' => '{items}{pager}', |
| 54 | ] | 78 | ] |
| 55 | ); ?> | 79 | ); ?> |
| 56 | 80 | ||
| 57 | - | ||
| 58 | - <!-- *** LEFT COLUMN END *** --> | ||
| 59 | - | ||
| 60 | - <!-- *** RIGHT COLUMN *** | ||
| 61 | -_________________________________________________________ --> | ||
| 62 | - | ||
| 63 | - <div class="col-md-3"> | ||
| 64 | - | ||
| 65 | - <!-- *** MENUS AND WIDGETS *** | ||
| 66 | -_________________________________________________________ --> | ||
| 67 | - <div class="panel panel-default sidebar-menu"> | ||
| 68 | - | ||
| 69 | - <div class="panel-heading"> | ||
| 70 | - <h3 class="panel-title"><?=\Yii::t('app', 'Blog')?></h3> | ||
| 71 | - </div> | ||
| 72 | - | ||
| 73 | - <div class="panel-body text-widget"> | ||
| 74 | - <p> | ||
| 75 | - Мы собираем полезные материалы по тематике бытовой техники и электроники | ||
| 76 | - </p> | ||
| 77 | - | ||
| 78 | - </div> | 81 | + <div class="col-xs-12 col-sm-12"> |
| 82 | + <div class="style navi-c-a"> | ||
| 83 | + | ||
| 84 | + <?php echo \frontend\widgets\FrontendPager::widget( | ||
| 85 | + [ | ||
| 86 | + 'pagination' => $dataProvider->pagination, | ||
| 87 | + 'prevPageLabel' => 'previous', | ||
| 88 | + 'nextPageLabel' => 'next', | ||
| 89 | + 'maxButtonCount' => 5, | ||
| 90 | + 'lastPageLabel' => 'last_number', | ||
| 91 | + ] | ||
| 92 | + );?> | ||
| 79 | </div> | 93 | </div> |
| 80 | - | ||
| 81 | - <?= BlogSearch::widget(); ?> | ||
| 82 | - | ||
| 83 | - <div class="panel sidebar-menu"> | ||
| 84 | - <div class="panel-heading"> | ||
| 85 | - <h3 class="panel-title">Поиск по тегам</h3> | ||
| 86 | - </div> | ||
| 87 | - | ||
| 88 | - <div class="panel-body"> | ||
| 89 | - <ul class="tag-cloud"> | ||
| 90 | - <?php foreach ($tags as $tag) { ?> | ||
| 91 | - <li><a href="<?= Url::to( | ||
| 92 | - [ | ||
| 93 | - 'alias' => $tag->alias | ||
| 94 | - ] | ||
| 95 | - ) ?>"><i class="fa fa-tags"></i> <?= $tag->label; ?></a> | ||
| 96 | - </li> | ||
| 97 | - <?php } ?> | ||
| 98 | - </ul> | ||
| 99 | - </div> | ||
| 100 | - </div> | ||
| 101 | - | ||
| 102 | - <!-- *** MENUS AND FILTERS END *** --> | ||
| 103 | - | ||
| 104 | </div> | 94 | </div> |
| 105 | - <!-- /.col-md-3 --> | ||
| 106 | - | ||
| 107 | - <!-- *** RIGHT COLUMN END *** --> | ||
| 108 | - | ||
| 109 | </div> | 95 | </div> |
| 110 | - <!-- /.row --> | ||
| 111 | </div> | 96 | </div> |
| 112 | - <!-- /.container --> | ||
| 113 | -</div> | ||
| 114 | -<!-- /#content --> | ||
| 115 | \ No newline at end of file | 97 | \ No newline at end of file |
| 98 | +</section> | ||
| 116 | \ No newline at end of file | 99 | \ No newline at end of file |
frontend/views/blog/index.php
| @@ -52,7 +52,9 @@ | @@ -52,7 +52,9 @@ | ||
| 52 | <div class="select-blog"> | 52 | <div class="select-blog"> |
| 53 | <?php $form = ActiveForm::begin();?> | 53 | <?php $form = ActiveForm::begin();?> |
| 54 | <div class="input-wr"> | 54 | <div class="input-wr"> |
| 55 | - <?=Html::dropDownList('categories', null, ['' => 'Все рубрики']+$categories)?> | 55 | + <?=Html::dropDownList('categories', null, ['' => 'Все рубрики']+$categories, [ |
| 56 | + 'id' => 'blog-categories' | ||
| 57 | + ])?> | ||
| 56 | </div> | 58 | </div> |
| 57 | <?php ActiveForm::end()?> | 59 | <?php ActiveForm::end()?> |
| 58 | </div> | 60 | </div> |
frontend/views/blog/tag.php
| 1 | <?php | 1 | <?php |
| 2 | 2 | ||
| 3 | use artbox\core\components\SeoComponent; | 3 | use artbox\core\components\SeoComponent; |
| 4 | - use common\models\blog\Tag; | ||
| 5 | - use frontend\widgets\BlogSearch; | ||
| 6 | - use yii\data\ActiveDataProvider; | ||
| 7 | use artbox\core\helpers\Url; | 4 | use artbox\core\helpers\Url; |
| 5 | + use yii\data\ActiveDataProvider; | ||
| 6 | + use yii\helpers\Html; | ||
| 8 | use yii\web\View; | 7 | use yii\web\View; |
| 8 | + use yii\widgets\ActiveForm; | ||
| 9 | use yii\widgets\ListView; | 9 | use yii\widgets\ListView; |
| 10 | 10 | ||
| 11 | /** | 11 | /** |
| 12 | * @var View $this | 12 | * @var View $this |
| 13 | * @var ActiveDataProvider $dataProvider | 13 | * @var ActiveDataProvider $dataProvider |
| 14 | * @var SeoComponent $seo | 14 | * @var SeoComponent $seo |
| 15 | - * @var Tag[] $tags | ||
| 16 | - * @var Tag $model | 15 | + * @var \common\models\blog\Tag[] $tags |
| 16 | + * @var common\models\blog\Category[] $categories | ||
| 17 | + * @var \common\models\blog\Tag $model | ||
| 17 | */ | 18 | */ |
| 18 | $seo = \Yii::$app->get('seo'); | 19 | $seo = \Yii::$app->get('seo'); |
| 19 | 20 | ||
| 20 | $this->params[ 'breadcrumbs' ][] = [ | 21 | $this->params[ 'breadcrumbs' ][] = [ |
| 21 | 'label' => \Yii::t('app', 'Блог'), | 22 | 'label' => \Yii::t('app', 'Блог'), |
| 22 | - 'url' => [ 'blog/index' ], | 23 | + 'url' => Url::to(['blog/index']) |
| 23 | ]; | 24 | ]; |
| 24 | - | ||
| 25 | - $this->params[ 'breadcrumbs' ][] = $seo->title; | 25 | + $this->params['breadcrumbs'][] = $model->title; |
| 26 | 26 | ||
| 27 | ?> | 27 | ?> |
| 28 | 28 | ||
| 29 | -<div id="content"> | 29 | +<section class="blog-all-bg"> |
| 30 | <div class="container"> | 30 | <div class="container"> |
| 31 | <div class="row"> | 31 | <div class="row"> |
| 32 | - <!-- *** LEFT COLUMN *** | ||
| 33 | -_________________________________________________________ --> | ||
| 34 | - | ||
| 35 | - | ||
| 36 | - <!-- <ul class="pager">--> | ||
| 37 | - <!-- <li class="previous"><a href="#">← Назад</a>--> | ||
| 38 | - <!-- </li>--> | ||
| 39 | - <!-- <li class="next disabled"><a href="#">Вперед →</a>--> | ||
| 40 | - <!-- </li>--> | ||
| 41 | - <!-- </ul>--> | ||
| 42 | - | ||
| 43 | - <!-- /.col-md-9 --> | ||
| 44 | - | ||
| 45 | - | 32 | + <div class="col-xs-12 col-sm-12"> |
| 33 | + <div class="blog-title title-pages">Блог</div> | ||
| 34 | + </div> | ||
| 35 | + </div> | ||
| 36 | + <div class="row"> | ||
| 37 | + <div class="col-xs-12 col-sm-5 col-md-4 col-lg-3"> | ||
| 38 | + <div class="fb-subscribe"> | ||
| 39 | + Подписывайтесь на наши новости | ||
| 40 | + на канале FACEBOOK | ||
| 41 | + </div> | ||
| 42 | + </div> | ||
| 43 | + </div> | ||
| 44 | + <div class="row"> | ||
| 45 | + <div class="col-xs-12 col-sm-12"> | ||
| 46 | + <div class="style fb-subscribe-btn"> | ||
| 47 | + <a target="_blank" href="#" class="btn_">Подписаться</a> | ||
| 48 | + </div> | ||
| 49 | + </div> | ||
| 50 | + </div> | ||
| 51 | + </div> | ||
| 52 | +</section> | ||
| 53 | + | ||
| 54 | +<section class="blog-all-section"> | ||
| 55 | + <div class="container"> | ||
| 56 | + <div class="row"> | ||
| 57 | + <div class="col-xs-12 col-sm-12 select-blog-col"> | ||
| 58 | + <div class="select-blog"> | ||
| 59 | + <?php $form = ActiveForm::begin();?> | ||
| 60 | + <div class="input-wr"> | ||
| 61 | + <?=Html::dropDownList('categories', null, ['' => 'Все рубрики']+$categories, [ | ||
| 62 | + 'id' => 'blog-categories' | ||
| 63 | + ])?> | ||
| 64 | + </div> | ||
| 65 | + <?php ActiveForm::end()?> | ||
| 66 | + </div> | ||
| 67 | + </div> | ||
| 68 | + </div> | ||
| 69 | + <div class="row blog-list-row"> | ||
| 46 | <?= ListView::widget( | 70 | <?= ListView::widget( |
| 47 | [ | 71 | [ |
| 48 | 'dataProvider' => $dataProvider, | 72 | 'dataProvider' => $dataProvider, |
| 49 | 'itemView' => '_article', | 73 | 'itemView' => '_article', |
| 50 | 'options' => [ | 74 | 'options' => [ |
| 51 | - 'class' => 'col-md-9', | ||
| 52 | - 'id' => 'blog-listing-medium', | 75 | + 'class' => 'col-xs-12 col-sm-4 col-md-4 blog-list-col', |
| 53 | ], | 76 | ], |
| 54 | 'layout' => '{items}{pager}', | 77 | 'layout' => '{items}{pager}', |
| 55 | ] | 78 | ] |
| 56 | ); ?> | 79 | ); ?> |
| 57 | 80 | ||
| 58 | - | ||
| 59 | - <!-- *** LEFT COLUMN END *** --> | ||
| 60 | - | ||
| 61 | - <!-- *** RIGHT COLUMN *** | ||
| 62 | -_________________________________________________________ --> | ||
| 63 | - | ||
| 64 | - <div class="col-md-3"> | ||
| 65 | - | ||
| 66 | - <!-- *** MENUS AND WIDGETS *** | ||
| 67 | -_________________________________________________________ --> | ||
| 68 | - <div class="panel panel-default sidebar-menu"> | ||
| 69 | - | ||
| 70 | - <div class="panel-heading"> | ||
| 71 | - <h3 class="panel-title">Блог компании</h3> | ||
| 72 | - </div> | ||
| 73 | - | ||
| 74 | - <div class="panel-body text-widget"> | ||
| 75 | - <p> | ||
| 76 | - Мы собираем полезные материалы по тематике бытовой техники и электроники | ||
| 77 | - </p> | ||
| 78 | - | ||
| 79 | - </div> | 81 | + <div class="col-xs-12 col-sm-12"> |
| 82 | + <div class="style navi-c-a"> | ||
| 83 | + | ||
| 84 | + <?php echo \frontend\widgets\FrontendPager::widget( | ||
| 85 | + [ | ||
| 86 | + 'pagination' => $dataProvider->pagination, | ||
| 87 | + 'prevPageLabel' => 'previous', | ||
| 88 | + 'nextPageLabel' => 'next', | ||
| 89 | + 'maxButtonCount' => 5, | ||
| 90 | + 'lastPageLabel' => 'last_number', | ||
| 91 | + ] | ||
| 92 | + );?> | ||
| 80 | </div> | 93 | </div> |
| 81 | - | ||
| 82 | - <?= BlogSearch::widget(); ?> | ||
| 83 | - | ||
| 84 | - <div class="panel sidebar-menu"> | ||
| 85 | - <div class="panel-heading"> | ||
| 86 | - <h3 class="panel-title">Поиск по тегам</h3> | ||
| 87 | - </div> | ||
| 88 | - | ||
| 89 | - <div class="panel-body"> | ||
| 90 | - <ul class="tag-cloud"> | ||
| 91 | - <?php foreach ($tags as $tag) { ?> | ||
| 92 | - <li><a href="<?= Url::to( | ||
| 93 | - [ | ||
| 94 | - 'alias' => $tag->alias | ||
| 95 | - ] | ||
| 96 | - ) ?>"><i class="fa fa-tags"></i> <?= $tag->label; ?></a> | ||
| 97 | - </li> | ||
| 98 | - <?php } ?> | ||
| 99 | - </ul> | ||
| 100 | - </div> | ||
| 101 | - </div> | ||
| 102 | - | ||
| 103 | - <!-- *** MENUS AND FILTERS END *** --> | ||
| 104 | - | ||
| 105 | </div> | 94 | </div> |
| 106 | - <!-- /.col-md-3 --> | ||
| 107 | - | ||
| 108 | - <!-- *** RIGHT COLUMN END *** --> | ||
| 109 | - | ||
| 110 | </div> | 95 | </div> |
| 111 | - <!-- /.row --> | ||
| 112 | </div> | 96 | </div> |
| 113 | - <!-- /.container --> | ||
| 114 | -</div> | ||
| 115 | -<!-- /#content --> | ||
| 116 | \ No newline at end of file | 97 | \ No newline at end of file |
| 98 | +</section> | ||
| 117 | \ No newline at end of file | 99 | \ No newline at end of file |
frontend/views/layouts/main.php
| @@ -24,6 +24,7 @@ | @@ -24,6 +24,7 @@ | ||
| 24 | use frontend\widgets\LanguageWidget; | 24 | use frontend\widgets\LanguageWidget; |
| 25 | use frontend\widgets\Nav; | 25 | use frontend\widgets\Nav; |
| 26 | use yii\db\ActiveQuery; | 26 | use yii\db\ActiveQuery; |
| 27 | + use yii\helpers\Html; | ||
| 27 | use yii\web\View; | 28 | use yii\web\View; |
| 28 | 29 | ||
| 29 | AppAsset::register($this); | 30 | AppAsset::register($this); |
| @@ -58,31 +59,42 @@ | @@ -58,31 +59,42 @@ | ||
| 58 | 'content' => $seo->desc, | 59 | 'content' => $seo->desc, |
| 59 | ] | 60 | ] |
| 60 | ); | 61 | ); |
| 62 | + | ||
| 63 | + | ||
| 64 | + $this->registerMetaTag( | ||
| 65 | + [ | ||
| 66 | + 'name' => 'robots', | ||
| 67 | + 'content' => $seo->robots, | ||
| 68 | + // 'content' => 'noindex,nofollow', | ||
| 69 | + ] | ||
| 70 | + ); | ||
| 61 | $module = \Yii::$app->getModule('feedback'); | 71 | $module = \Yii::$app->getModule('feedback'); |
| 62 | ?> | 72 | ?> |
| 63 | 73 | ||
| 64 | <?php $this->beginPage() ?> | 74 | <?php $this->beginPage() ?> |
| 65 | - <!DOCTYPE html> | ||
| 66 | - <html xmlns="http://www.w3.org/1999/html" xmlns="http://www.w3.org/1999/html"> | 75 | + <!DOCTYPE html > |
| 76 | + <html xmlns="http://www.w3.org/1999/html" xmlns="http://www.w3.org/1999/html" lang="<?= \Yii::$app->language ?>"> | ||
| 67 | <head> | 77 | <head> |
| 68 | - <title><?=$seo->title?></title> | ||
| 69 | - <meta charset="utf-8"> | 78 | + |
| 79 | + <meta charset="<?= \Yii::$app->charset ?>"> | ||
| 70 | <meta name="viewport" content="width=device-width"> | 80 | <meta name="viewport" content="width=device-width"> |
| 71 | <link type="image/x-icon" href="favicon.ico" rel="icon"> | 81 | <link type="image/x-icon" href="favicon.ico" rel="icon"> |
| 82 | + <?= Html::csrfMetaTags() ?> | ||
| 83 | + <title><?=Html::encode($seo->title)?></title> | ||
| 72 | <?php $this->head() ?> | 84 | <?php $this->head() ?> |
| 73 | </head> | 85 | </head> |
| 74 | <body id="body"> | 86 | <body id="body"> |
| 75 | <?php $this->beginBody() ?> | 87 | <?php $this->beginBody() ?> |
| 76 | - <!-- <div class="transition-loader">--> | ||
| 77 | - <!-- <div class="transition-loader-inner">--> | ||
| 78 | - <!-- <label></label>--> | ||
| 79 | - <!-- <label></label>--> | ||
| 80 | - <!-- <label></label>--> | ||
| 81 | - <!-- <label></label>--> | ||
| 82 | - <!-- <label></label>--> | ||
| 83 | - <!-- <label></label>--> | ||
| 84 | - <!-- </div>--> | ||
| 85 | - <!-- </div>--> | 88 | + <div class="transition-loader"> |
| 89 | + <div class="transition-loader-inner"> | ||
| 90 | + <label></label> | ||
| 91 | + <label></label> | ||
| 92 | + <label></label> | ||
| 93 | + <label></label> | ||
| 94 | + <label></label> | ||
| 95 | + <label></label> | ||
| 96 | + </div> | ||
| 97 | + </div> | ||
| 86 | <header id="header_" class="section-box-header"> | 98 | <header id="header_" class="section-box-header"> |
| 87 | <div class="section-box-header-columns"> | 99 | <div class="section-box-header-columns"> |
| 88 | <div class="container"> | 100 | <div class="container"> |
| @@ -135,11 +147,11 @@ | @@ -135,11 +147,11 @@ | ||
| 135 | <li><a href="<?=Url::to(['site/questions'])?>">Вопрос-ответ</a></li> | 147 | <li><a href="<?=Url::to(['site/questions'])?>">Вопрос-ответ</a></li> |
| 136 | <li><a href="<?=Url::to(['site/comments'])?>">Отзывы</a></li> | 148 | <li><a href="<?=Url::to(['site/comments'])?>">Отзывы</a></li> |
| 137 | </ul> | 149 | </ul> |
| 138 | - | ||
| 139 | - <div class="lang-sep-wr hidden-xs hidden-sm"> | ||
| 140 | - | ||
| 141 | - <?= LanguageWidget::widget() ?> | ||
| 142 | - </div> | 150 | +<!-- --> |
| 151 | +<!-- <div class="lang-sep-wr hidden-xs hidden-sm">--> | ||
| 152 | +<!-- --> | ||
| 153 | +<!-- --><?php //echo LanguageWidget::widget() ?> | ||
| 154 | +<!-- </div>--> | ||
| 143 | 155 | ||
| 144 | <div class="hidden-sm hidden-md hidden-lg icon_phone-header-mob btn_call"></div> | 156 | <div class="hidden-sm hidden-md hidden-lg icon_phone-header-mob btn_call"></div> |
| 145 | 157 |
frontend/views/package/index.php
| 1 | <?php | 1 | <?php |
| 2 | /** | 2 | /** |
| 3 | - * @var \yii\data\ActiveDataProvider $dataProvider | 3 | + * @var \common\models\Package[] $packages |
| 4 | * @var \yii\web\View $this | 4 | * @var \yii\web\View $this |
| 5 | */ | 5 | */ |
| 6 | 6 | ||
| 7 | - $this->params['breadcrumbs'][] = \Yii::t('app', 'Пакетные предложения'); | ||
| 8 | - ?> | ||
| 9 | \ No newline at end of file | 7 | \ No newline at end of file |
| 8 | + use artbox\core\helpers\ImageHelper; | ||
| 9 | + use artbox\core\helpers\Url; | ||
| 10 | + | ||
| 11 | + $this->params[ 'breadcrumbs'][] = \Yii::t('app', 'Пакетные предложения'); | ||
| 12 | + ?> | ||
| 13 | + | ||
| 14 | +<section class="section-packages-page"> | ||
| 15 | + <div class="container"> | ||
| 16 | + <div class="row"> | ||
| 17 | + <div class="col-xs-12"> | ||
| 18 | + <h1 class="title-pages">Пакетные предолжения</h1> | ||
| 19 | + </div> | ||
| 20 | + </div> | ||
| 21 | + <div class="row"> | ||
| 22 | + <?php foreach ($packages as $package){ | ||
| 23 | +// print_r($package->language); die(); | ||
| 24 | + | ||
| 25 | + ?> | ||
| 26 | + <div class="col-xs-12 col-sm-6 packages-page-col"> | ||
| 27 | + <a class="packages-page-link" href="<?=Url::to(['alias' => $package->language->alias])?>"> | ||
| 28 | + <div class="img-packages-page"> | ||
| 29 | + <!--555x344--> | ||
| 30 | + <?=ImageHelper::set(($package->image) ? $package->image->getPath() : null) | ||
| 31 | + ->cropResize(555, 344) | ||
| 32 | + ->quality(84) | ||
| 33 | + ->renderImage()?> | ||
| 34 | + </div> | ||
| 35 | + <div class="table-packages-wr"> | ||
| 36 | + <table cellspacing="0" cellpadding="0" border="0"> | ||
| 37 | + <tr> | ||
| 38 | + <td><span class="title-packages"><?=$package->title?></span></td> | ||
| 39 | + </tr> | ||
| 40 | + <tr> | ||
| 41 | + <td> | ||
| 42 | + <span class="btn_ packages-btn">подробнее</span> | ||
| 43 | + </td> | ||
| 44 | + </tr> | ||
| 45 | + </table> | ||
| 46 | + </div> | ||
| 47 | + </a> | ||
| 48 | + </div> | ||
| 49 | + <?php }?> | ||
| 50 | + </div> | ||
| 51 | + </div> | ||
| 52 | +</section> |
frontend/views/service/view.php
| @@ -15,7 +15,7 @@ | @@ -15,7 +15,7 @@ | ||
| 15 | $this->params['entity_id'] = $model->id; | 15 | $this->params['entity_id'] = $model->id; |
| 16 | 16 | ||
| 17 | $moduleComment = \Yii::$app->getModule('comments'); | 17 | $moduleComment = \Yii::$app->getModule('comments'); |
| 18 | - $this->params[ 'breadcrumbs' ][] = (!empty($seo->h1)) ? $seo->h1 :$model->title; | 18 | + |
| 19 | 19 | ||
| 20 | $moduleComment->inputOptions = array_merge($moduleComment->inputOptions, ['entity_id' => [ | 20 | $moduleComment->inputOptions = array_merge($moduleComment->inputOptions, ['entity_id' => [ |
| 21 | 'type' => 'hiddenInput', | 21 | 'type' => 'hiddenInput', |
| @@ -31,6 +31,22 @@ | @@ -31,6 +31,22 @@ | ||
| 31 | 'type' => 'hiddenInput', | 31 | 'type' => 'hiddenInput', |
| 32 | 'options' => ['value' => $model->id], | 32 | 'options' => ['value' => $model->id], |
| 33 | ]]; | 33 | ]]; |
| 34 | + if ($model->parent !== null){ | ||
| 35 | + if ($model->parent->parent !== null){ | ||
| 36 | + $this->params['breadcrumbs'][] = [ | ||
| 37 | + 'label' => $model->parent->parent->title, | ||
| 38 | + 'url' => Url::to(['alias' => $model->parent->parent->language->alias]), | ||
| 39 | + ]; | ||
| 40 | + } | ||
| 41 | + $this->params['breadcrumbs'][] = [ | ||
| 42 | + 'label' => $model->parent->title, | ||
| 43 | + 'url' => Url::to(['alias' => $model->parent->language->alias]), | ||
| 44 | + ]; | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + | ||
| 48 | + | ||
| 49 | + $this->params[ 'breadcrumbs' ][] = (!empty($seo->h1)) ? $seo->h1 :$model->title; | ||
| 34 | ?> | 50 | ?> |
| 35 | <section class="section-service-page"> | 51 | <section class="section-service-page"> |
| 36 | <div class="container"> | 52 | <div class="container"> |
frontend/views/site/contact.php
| @@ -4,13 +4,11 @@ | @@ -4,13 +4,11 @@ | ||
| 4 | * @var View $this | 4 | * @var View $this |
| 5 | * @var Feedback $contact | 5 | * @var Feedback $contact |
| 6 | * @var \artbox\core\forms\Module $module; | 6 | * @var \artbox\core\forms\Module $module; |
| 7 | + * @var Settings $settings | ||
| 7 | */ | 8 | */ |
| 8 | 9 | ||
| 9 | use artbox\core\models\Feedback; | 10 | use artbox\core\models\Feedback; |
| 10 | use common\models\Settings; | 11 | use common\models\Settings; |
| 11 | - use frontend\assets\MapAsset; | ||
| 12 | - use yii\helpers\Html; | ||
| 13 | - use yii\bootstrap\ActiveForm; | ||
| 14 | use yii\web\View; | 12 | use yii\web\View; |
| 15 | 13 | ||
| 16 | 14 | ||
| @@ -20,8 +18,8 @@ | @@ -20,8 +18,8 @@ | ||
| 20 | 18 | ||
| 21 | 19 | ||
| 22 | 20 | ||
| 23 | -// | ||
| 24 | -// $module = \Yii::$app->getModule('contact'); | 21 | + |
| 22 | + $module = \Yii::$app->getModule('contact'); | ||
| 25 | ?> | 23 | ?> |
| 26 | 24 | ||
| 27 | <section class="section-contact-page"> | 25 | <section class="section-contact-page"> |
| @@ -35,18 +33,26 @@ | @@ -35,18 +33,26 @@ | ||
| 35 | <div class="col-xs-12 col-sm-5 col-md-4 col-lg-4"> | 33 | <div class="col-xs-12 col-sm-5 col-md-4 col-lg-4"> |
| 36 | <div class="style contacts-page-grey"> | 34 | <div class="style contacts-page-grey"> |
| 37 | <div class="map-info-wrapp"> | 35 | <div class="map-info-wrapp"> |
| 36 | + <?php if (!empty($settings->address)){?> | ||
| 38 | <div class="marker-img"><img src="/images/map/marker-1-grey.svg" width="12" height="18" alt=""></div> | 37 | <div class="marker-img"><img src="/images/map/marker-1-grey.svg" width="12" height="18" alt=""></div> |
| 39 | - <div class="map-adress">Украина, Киев, ул. Кудрявская, 31/33</div> | 38 | + <div class="map-adress"><?=$settings->address?></div> |
| 39 | + <?php } ?> | ||
| 40 | + <?php if (!empty($settings->phone) or !empty($settings->phone2)){ | ||
| 41 | + $phones = explode(';', $settings->phone2) + [$settings->phone]; | ||
| 42 | + ?> | ||
| 40 | <div class="ico-map"><img src="/images/map/phone-map-1-grey.svg" alt=""></div> | 43 | <div class="ico-map"><img src="/images/map/phone-map-1-grey.svg" alt=""></div> |
| 41 | <div class="map-phone"> | 44 | <div class="map-phone"> |
| 42 | - <p>093 810-90-90</p> | ||
| 43 | - <p>096 810-90-90</p> | ||
| 44 | - <p>095 810-90-90</p> | 45 | + <?php foreach ($phones as $phone){?> |
| 46 | + <p><?=$phone?></p> | ||
| 47 | + <?php }?> | ||
| 45 | </div> | 48 | </div> |
| 49 | + <?php }?> | ||
| 50 | + <?php if (!empty($settings->email)){?> | ||
| 46 | <div class="ico-map ico-map-mail"><img src="/images/map/mail-map-1-grey.svg" alt=""></div> | 51 | <div class="ico-map ico-map-mail"><img src="/images/map/mail-map-1-grey.svg" alt=""></div> |
| 47 | <div class="map-mail"> | 52 | <div class="map-mail"> |
| 48 | - <a href="mailto:abclinic@gmail.com">abclinic@gmail.com</a> | 53 | + <a href="mailto:<?=$settings->email?>"><?=$settings->email?></a> |
| 49 | </div> | 54 | </div> |
| 55 | + <?php } ?> | ||
| 50 | </div> | 56 | </div> |
| 51 | </div> | 57 | </div> |
| 52 | </div> | 58 | </div> |
| @@ -55,26 +61,7 @@ | @@ -55,26 +61,7 @@ | ||
| 55 | <div class="style blog-view-comments-form"> | 61 | <div class="style blog-view-comments-form"> |
| 56 | <div class="style hidden-form-c-a"> | 62 | <div class="style hidden-form-c-a"> |
| 57 | <div class="title-forms-c-a style">Обратный звонок</div> | 63 | <div class="title-forms-c-a style">Обратный звонок</div> |
| 58 | - <form action=""> | ||
| 59 | - <div class="input-wr required"> | ||
| 60 | - <label class="control-label" for="feedback-name">ФИО</label> | ||
| 61 | - <input type="text"> | ||
| 62 | - </div> | ||
| 63 | - | ||
| 64 | - <div class="input-wr required"> | ||
| 65 | - <label class="control-label" for="feedback-name">Email</label> | ||
| 66 | - <input type="text"> | ||
| 67 | - </div> | ||
| 68 | - | ||
| 69 | - <div class="input-wr"> | ||
| 70 | - <label class="control-label" for="feedback-name">Ваш вопрос</label> | ||
| 71 | - <textarea name="" id="" cols="30" rows="10"></textarea> | ||
| 72 | - </div> | ||
| 73 | - | ||
| 74 | - <div class="button-wr submit-close-wr-c-a"> | ||
| 75 | - <button type="submit">Отправить</button> | ||
| 76 | - </div> | ||
| 77 | - </form> | 64 | + <?=$module->renderForm($this)?> |
| 78 | </div> | 65 | </div> |
| 79 | </div> | 66 | </div> |
| 80 | </div> | 67 | </div> |
frontend/views/site/index.php
| @@ -7,13 +7,13 @@ | @@ -7,13 +7,13 @@ | ||
| 7 | * @var \common\models\Comment[] $comments | 7 | * @var \common\models\Comment[] $comments |
| 8 | * @var \common\models\Settings $settings | 8 | * @var \common\models\Settings $settings |
| 9 | * @var \common\models\Package[] $package; | 9 | * @var \common\models\Package[] $package; |
| 10 | + * @var \artbox\core\components\SeoComponent $seo; | ||
| 10 | */ | 11 | */ |
| 11 | 12 | ||
| 12 | use artbox\core\helpers\ImageHelper; | 13 | use artbox\core\helpers\ImageHelper; |
| 13 | use artbox\core\helpers\Url; | 14 | use artbox\core\helpers\Url; |
| 14 | use yii\web\View; | 15 | use yii\web\View; |
| 15 | - | ||
| 16 | - $this->title = 'My Yii Application'; | 16 | + $seo = Yii::$app->get('seo'); |
| 17 | \frontend\assets\ScrollAsset::register($this); | 17 | \frontend\assets\ScrollAsset::register($this); |
| 18 | $js = <<<JS | 18 | $js = <<<JS |
| 19 | //первый слайдер | 19 | //первый слайдер |
| @@ -174,11 +174,11 @@ JS; | @@ -174,11 +174,11 @@ JS; | ||
| 174 | <?php foreach ($package as $item){?> | 174 | <?php foreach ($package as $item){?> |
| 175 | <div class="col-xs-12 col-sm-4 package-offers-wr"> | 175 | <div class="col-xs-12 col-sm-4 package-offers-wr"> |
| 176 | <a href="<?=Url::to(['alias' => $item->alias])?>"> | 176 | <a href="<?=Url::to(['alias' => $item->alias])?>"> |
| 177 | - <div class="img"><?=ImageHelper::set($item->image->getPath()) | 177 | + <div class="img"><?=ImageHelper::set(($item->image) ? $item->image->getPath() : null) |
| 178 | ->cropResize(388, 240) | 178 | ->cropResize(388, 240) |
| 179 | ->quality(84) | 179 | ->quality(84) |
| 180 | ->renderImage()?></div> | 180 | ->renderImage()?></div> |
| 181 | - <div class="rotate"><?=ImageHelper::set($item->image->getPath()) | 181 | + <div class="rotate"><?=ImageHelper::set(($item->image) ? $item->image->getPath() : null) |
| 182 | ->cropResize(388, 240) | 182 | ->cropResize(388, 240) |
| 183 | ->quality(84) | 183 | ->quality(84) |
| 184 | ->renderImage()?></div> | 184 | ->renderImage()?></div> |
frontend/web/js/script.js
| @@ -459,7 +459,14 @@ $(document).ready(function() { | @@ -459,7 +459,14 @@ $(document).ready(function() { | ||
| 459 | }); | 459 | }); |
| 460 | }); | 460 | }); |
| 461 | 461 | ||
| 462 | - | 462 | + $(document).on('change', '#blog-categories', function(e) { |
| 463 | + var value = $(this).val(); | ||
| 464 | + if (value !== ''){ | ||
| 465 | + window.location.href = value; | ||
| 466 | + }else{ | ||
| 467 | + window.location.href = 'blog/index'; | ||
| 468 | + } | ||
| 469 | + }); | ||
| 463 | 470 | ||
| 464 | }); | 471 | }); |
| 465 | 472 | ||
| @@ -495,4 +502,5 @@ window.onload = function () { | @@ -495,4 +502,5 @@ window.onload = function () { | ||
| 495 | $(window).load(function() { | 502 | $(window).load(function() { |
| 496 | console.log('start load jquery'); | 503 | console.log('start load jquery'); |
| 497 | 504 | ||
| 498 | -}); | ||
| 499 | \ No newline at end of file | 505 | \ No newline at end of file |
| 506 | +}); | ||
| 507 | + |