diff --git a/common/translation/ru/app.php b/common/translation/ru/app.php index ed53a55..d1752f6 100755 --- a/common/translation/ru/app.php +++ b/common/translation/ru/app.php @@ -183,4 +183,5 @@ return [ 'Результаты поиска для' => 'Результаты поиска для', 'certs' => 'Сертификаты', 'All-list ' => 'Весь ', + 'Return back' => 'Вернуться назад', ]; \ No newline at end of file diff --git a/common/translation/ua/app.php b/common/translation/ua/app.php index ad5a831..141081f 100755 --- a/common/translation/ua/app.php +++ b/common/translation/ua/app.php @@ -183,4 +183,5 @@ return [ 'Результаты поиска для' => 'Результати пошуку для', 'certs' => 'Сертифікати', 'All-list ' => 'Весь ', + 'Return back' => 'Повернутись назад', ]; \ No newline at end of file diff --git a/frontend/controllers/CollectionController.php b/frontend/controllers/CollectionController.php index a704631..7ce7ce5 100755 --- a/frontend/controllers/CollectionController.php +++ b/frontend/controllers/CollectionController.php @@ -17,6 +17,7 @@ /** * Displays article list. + * * @return string */ public function actionIndex($id) @@ -46,11 +47,13 @@ ->with('image') ->where([ 'product_to_project.product_variant_id' => $variant->product_variant_id ]) ->all(); + $referer = $this->checkReferer() ? \Yii::$app->request->referrer : NULL; return $this->render('view', [ 'collection' => $collection, 'variants' => $variants, 'variant' => $variant, 'projects' => $projects, + 'referer' => $referer, ]); } @@ -75,4 +78,23 @@ } return $model; } + + /** + * @param string|NULL $referer + * + * @return bool + */ + private function checkReferer(string $referer = NULL) + { + if($referer === NULL) { + $referer = \Yii::$app->request->referrer; + } + if(!empty( $referer )) { + $host = \Yii::$app->request->hostInfo; + if(strpos($referer, $host) === 0) { + return true; + } + } + return false; + } } diff --git a/frontend/views/collection/view.php b/frontend/views/collection/view.php index 5c2ec05..29ba4d7 100755 --- a/frontend/views/collection/view.php +++ b/frontend/views/collection/view.php @@ -5,6 +5,7 @@ * @var ProductVariant[] $variants * @var ProductVariant $variant * @var Project[] $projects + * @var string|null $referer */ use common\components\artboximage\ArtboxImageHelper; use common\models\Project; @@ -16,16 +17,22 @@ use yii\widgets\Pjax; $this->title = $collection->brand->lang->name . ' ' . $collection->lang->name; + if(!empty( $referer )) { + $this->params[ 'breadcrumbs' ][] = [ + 'url' => $referer, + 'label' => \Yii::t('app', 'Return back'), + ]; + } $this->params[ 'breadcrumbs' ][] = $this->title; $groups = $variant->getProperties(); ?>
'collection-pjax', - 'timeout' => 5000, - ]); + Pjax::begin([ + 'id' => 'collection-pjax', + 'timeout' => 5000, + ]); ?>
@@ -45,7 +52,7 @@
- +
:: sku; @@ -78,7 +85,7 @@
'to_order', + 'class' => 'to_order', 'data-id' => $variant->product_variant_id, ]); ?> @@ -89,7 +96,7 @@
    lang)) { + if(empty( $variant_item->lang )) { continue; } echo Html::tag('li', Html::a(Html::tag('div', ArtboxImageHelper::getImage($variant_item->getImageUrl(), 'brand_collection_variant')) . Html::tag('p', $variant_item->lang->name), [ @@ -105,7 +112,7 @@
@@ -134,10 +141,10 @@ echo $collection->productSpec->lang->tech_spec_text; } if(!empty( $collection->productSpec->getTechSpecUrl() )) { - echo Html::tag('p', \Yii::t('app', 'Документ технической документации').':' . Html::a(\Yii::t('app', 'скачать'), $collection->productSpec->getTechSpecUrl(), [ 'download' => true ])); + echo Html::tag('p', \Yii::t('app', 'Документ технической документации') . ':' . Html::a(\Yii::t('app', 'скачать'), $collection->productSpec->getTechSpecUrl(), [ 'download' => true ])); } if(!empty( $collection->productSpec->getTechCharUrl() )) { - echo Html::tag('p', \Yii::t('app', 'Вы также можете скачать таблицу с ' ). Html::a(\Yii::t('app', 'техническими характеристиками'), $collection->productSpec->getTechCharUrl(), [ 'download' => true ])); + echo Html::tag('p', \Yii::t('app', 'Вы также можете скачать таблицу с ') . Html::a(\Yii::t('app', 'техническими характеристиками'), $collection->productSpec->getTechCharUrl(), [ 'download' => true ])); } ?>
@@ -149,10 +156,10 @@ productCertificates as $productCertificate) { echo Html::tag('div', Html::tag('iframe', '', [ - 'class' => 'certificate', + 'class' => 'certificate', 'frameborder' => 0, - 'src' => 'http://docs.google.com/gview?url='.Url::to('/storage/certificates/'.$collection->product_id.'/'.$productCertificate->link, true).'&embedded=true', - ]), ['class' => 'col-xs-12 col-sm-6 col-md-4 col-lg-4']); + 'src' => 'http://docs.google.com/gview?url=' . Url::to('/storage/certificates/' . $collection->product_id . '/' . $productCertificate->link, true) . '&embedded=true', + ]), [ 'class' => 'col-xs-12 col-sm-6 col-md-4 col-lg-4' ]); } ?>
diff --git a/frontend/views/filter/brand.php b/frontend/views/filter/brand.php index 2346b84..5fd1b3f 100755 --- a/frontend/views/filter/brand.php +++ b/frontend/views/filter/brand.php @@ -14,6 +14,7 @@ use common\modules\rubrication\models\TaxOption; use yii\data\ActiveDataProvider; use yii\helpers\Html; + use yii\helpers\Url; use yii\web\View; use yii\widgets\ListView; @@ -40,9 +41,10 @@ 'purpose_id' => $purpose->tax_option_id, ], ]; - $this->params[ 'breadcrumbs' ][] = $this->title; + $this->params[ 'breadcrumbs' ][] = $brand->lang->name; ?> -
title ?>
+
lang->name ?>
+
lang->name . ' ' . mb_strtolower($purpose->lang->value) ?>
diff --git a/frontend/views/filter/category-brand.php b/frontend/views/filter/category-brand.php index 7b1d203..cd2fba8 100644 --- a/frontend/views/filter/category-brand.php +++ b/frontend/views/filter/category-brand.php @@ -2,7 +2,6 @@ /** * @var View $this * @var Category $category - * @var TaxOption $purpose * @var Brand $brand * @var ProductSearch $searchModel * @var ActiveDataProvider $dataProvider @@ -11,12 +10,11 @@ use common\modules\product\models\Brand; use common\modules\product\models\Category; use common\modules\product\models\ProductSearch; - use common\modules\rubrication\models\TaxOption; use yii\data\ActiveDataProvider; use yii\web\View; use yii\widgets\ListView; - $this->title = $category->lang->name . ' ' . $brand->lang->name . ' ' . mb_strtolower($purpose->lang->value); + $this->title = $category->lang->name . ' ' . $brand->lang->name; $this->params[ 'breadcrumbs' ][] = [ 'label' => $category->lang->name, 'url' => [ @@ -25,18 +23,10 @@ ], ]; $this->params[ 'breadcrumbs' ][] = [ - 'label' => $purpose->lang->value, + 'label' => \Yii::t('product', 'Brands').' '.$category->lang->name, 'url' => [ - 'filter/purpose', - 'id' => $purpose->tax_option_id, - ], - ]; - $this->params[ 'breadcrumbs' ][] = [ - 'label' => $category->lang->name . ' ' . mb_strtolower($purpose->lang->value), - 'url' => [ - 'filter/index', + 'filter/category-brands', 'category_id' => $category->category_id, - 'purpose_id' => $purpose->tax_option_id, ], ]; $this->params[ 'breadcrumbs' ][] = $this->title; diff --git a/frontend/views/filter/index.php b/frontend/views/filter/index.php index e160717..2205a01 100755 --- a/frontend/views/filter/index.php +++ b/frontend/views/filter/index.php @@ -28,7 +28,8 @@ ]; $this->params[ 'breadcrumbs' ][] = $this->title; ?> -
title; ?>
+
lang->name; ?>
+
lang->value; ?>
diff --git a/frontend/web/css/style.min.css b/frontend/web/css/style.min.css index 26081ed..47fc872 100755 --- a/frontend/web/css/style.min.css +++ b/frontend/web/css/style.min.css @@ -420,7 +420,8 @@ ul.main-menu li:hover ul { ul.main-menu li:hover ul li { width: 100%; - height: 44px; + overflow: hidden; + height: auto; background: #fff; border-top: 1px solid #dedfe0 } @@ -438,6 +439,12 @@ ul.main-menu li:first-child ul li a:before { display: none } +ul.main-menu li ul li a { + line-height: 19px; + padding: 15px 5px 14px 24px !important; + white-space: normal; +} + .lang-wr { position: absolute; height: 43px; @@ -1763,6 +1770,7 @@ ul.main-menu li:first-child ul li a:before { float: left; margin-top: 15px; } + ul.breadcrumb { width: 100%; float: left; @@ -1837,7 +1845,7 @@ ul.breadcrumb li a { } .link-cat:before { - height:75px; + height: 75px; background: #000; opacity: 0.5; } @@ -3082,6 +3090,7 @@ ul.breadcrumb li a { height: 100%; } } + @media (max-width: 850px) { .link-cat { height: 136px -- libgit2 0.21.4