Commit 926c92c1546d982f2f640ba09f1461ee75eb7ed9
Merge remote-tracking branch 'origin/master'
# Conflicts: # frontend/web/css/style.css
Showing
8 changed files
with
170 additions
and
47 deletions
Show diff stats
backend/config/main.php
backend/controllers/SiteController.php
@@ -28,18 +28,6 @@ class SiteController extends Controller | @@ -28,18 +28,6 @@ class SiteController extends Controller | ||
28 | public function behaviors() | 28 | public function behaviors() |
29 | { | 29 | { |
30 | return [ | 30 | return [ |
31 | - 'access'=>[ | ||
32 | - 'class' => AccessBehavior::className(), | ||
33 | - 'rules' => | ||
34 | - ['site' => | ||
35 | - [ | ||
36 | - [ | ||
37 | - 'actions' => ['login', 'error'], | ||
38 | - 'allow' => true, | ||
39 | - ] | ||
40 | - ] | ||
41 | - ] | ||
42 | - ], | ||
43 | 'verbs' => [ | 31 | 'verbs' => [ |
44 | 'class' => VerbFilter::className(), | 32 | 'class' => VerbFilter::className(), |
45 | 'actions' => [ | 33 | 'actions' => [ |
backend/views/layouts/main-sidebar.php
@@ -7,59 +7,157 @@ use yii\widgets\Menu; | @@ -7,59 +7,157 @@ use yii\widgets\Menu; | ||
7 | <?php | 7 | <?php |
8 | 8 | ||
9 | $items = [ | 9 | $items = [ |
10 | - ['label' => 'Заказы', 'url' => ['/orders/index'], 'template'=>'<a href="{url}"> <i class="glyphicon glyphicon-shopping-cart"></i> <span>{label}</span></a>'], | 10 | + [ |
11 | + 'label' => 'Заказы', | ||
12 | + 'url' => ['/orders/index'], | ||
13 | + 'template'=>'<a href="{url}"> <i class="glyphicon glyphicon-shopping-cart"></i> <span>{label}</span></a>', | ||
14 | + 'options' => ['class'=>\Yii::$app->user->can('orders') ? '' :'hide'], | ||
15 | + ], | ||
11 | [ | 16 | [ |
12 | 'label' => 'eCommerce', | 17 | 'label' => 'eCommerce', |
13 | 'template'=>'<a href="{url}"> <i class="glyphicon glyphicon-barcode"></i> <span>{label}</span></a>', | 18 | 'template'=>'<a href="{url}"> <i class="glyphicon glyphicon-barcode"></i> <span>{label}</span></a>', |
14 | 'url' => ['/product/manage'], | 19 | 'url' => ['/product/manage'], |
20 | + 'options' => ['class'=>\Yii::$app->user->can('product') || \Yii::$app->user->can('category') || \Yii::$app->user->can('brand') || \Yii::$app->user->can('rubrication') ? '' :'hide'], | ||
15 | 'items' => [ | 21 | 'items' => [ |
16 | - ['label' => 'Товары', 'url' => ['/product/manage']], | ||
17 | - ['label' => 'Категории', 'url' => ['/category']], | ||
18 | - ['label' => 'Бренды', 'url' => ['/brand']], | ||
19 | - ['label' => 'Характеристики', 'url' => ['/rubrication/tax-group']], | ||
20 | - ['label' => 'Единицы измерения', 'url' => ['/product/product-unit']], | ||
21 | - ['label' => 'Статистика импорта', 'url' => ['/product/manage/import-stat']], | 22 | + [ |
23 | + 'label' => 'Товары', | ||
24 | + 'url' => ['/product/manage'], | ||
25 | + 'options' => ['class'=>\Yii::$app->user->can('product') ? '' :'hide'] | ||
26 | + ], | ||
27 | + [ | ||
28 | + 'label' => 'Категории', | ||
29 | + 'url' => ['/category'], | ||
30 | + 'options' => ['class'=>\Yii::$app->user->can('category') ? '' :'hide'] | ||
31 | + ], | ||
32 | + [ | ||
33 | + 'label' => 'Бренды', | ||
34 | + 'url' => ['/brand'], | ||
35 | + 'options' => ['class'=>\Yii::$app->user->can('brand') ? '' :'hide'], | ||
36 | + ], | ||
37 | + [ | ||
38 | + 'label' => 'Характеристики', | ||
39 | + 'url' => ['/rubrication/tax-group'], | ||
40 | + 'options' => ['class'=>\Yii::$app->user->can('rubrication') ? '' :'hide'], | ||
41 | + ], | ||
42 | + [ | ||
43 | + 'label' => 'Единицы измерения', | ||
44 | + 'url' => ['/product/product-unit'], | ||
45 | + 'options' => ['class'=>\Yii::$app->user->can('product') ? '' :'hide'], | ||
46 | + ], | ||
47 | + [ | ||
48 | + 'label' => 'Статистика импорта', | ||
49 | + 'url' => ['/product/manage/import-stat'], | ||
50 | + 'options' => ['class'=>\Yii::$app->user->can('product') ? '' :'hide'], | ||
51 | + ], | ||
22 | ] | 52 | ] |
23 | ], | 53 | ], |
24 | [ | 54 | [ |
25 | 'label' => 'Слайдер/Банеры', | 55 | 'label' => 'Слайдер/Банеры', |
26 | 'template'=>'<a href="{url}"> <i class="glyphicon glyphicon-barcode"></i> <span>{label}</span></a>', | 56 | 'template'=>'<a href="{url}"> <i class="glyphicon glyphicon-barcode"></i> <span>{label}</span></a>', |
57 | + 'options' => ['class'=>\Yii::$app->user->can('banner') || \Yii::$app->user->can('slider') ? '' :'hide'], | ||
27 | 'items' => [ | 58 | 'items' => [ |
28 | - ['label' => 'Слайдер', 'url' => ['/slider/index']], | ||
29 | - ['label' => 'Банер', 'url' => ['/banner/index']], | 59 | + [ |
60 | + 'label' => 'Слайдер', | ||
61 | + 'url' => ['/slider/index'], | ||
62 | + 'options' => ['class'=>\Yii::$app->user->can('slider') ? '' :'hide'], | ||
63 | + ], | ||
64 | + [ | ||
65 | + 'label' => 'Банер', | ||
66 | + 'url' => ['/banner/index'], | ||
67 | + 'options' => ['class'=>\Yii::$app->user->can('banner') ? '' :'hide'], | ||
68 | + ], | ||
30 | ] | 69 | ] |
31 | ], | 70 | ], |
32 | [ | 71 | [ |
33 | 'label' => 'Характеристики', | 72 | 'label' => 'Характеристики', |
34 | 'template'=>'<a href="{url}"> <i class="glyphicon glyphicon-search"></i> <span>{label}</span></a>', | 73 | 'template'=>'<a href="{url}"> <i class="glyphicon glyphicon-search"></i> <span>{label}</span></a>', |
35 | 'url' => ['/rubrication/tax-group'], | 74 | 'url' => ['/rubrication/tax-group'], |
75 | + 'options' => ['class'=>\Yii::$app->user->can('rubrication') || \Yii::$app->user->can('relation') ? '' :'hide'], | ||
36 | 'items' => [ | 76 | 'items' => [ |
37 | - ['label' => 'Характеристики', 'url' => ['/rubrication/tax-group']], | ||
38 | - ['label' => 'Зависимости', 'url' => ['/relation/manage']] | 77 | + [ |
78 | + 'label' => 'Характеристики', | ||
79 | + 'url' => ['/rubrication/tax-group'], | ||
80 | + 'options' => ['class'=>\Yii::$app->user->can('rubrication') ? '' :'hide'], | ||
81 | + ], | ||
82 | + [ | ||
83 | + 'label' => 'Зависимости', | ||
84 | + 'url' => ['/relation/manage'], | ||
85 | + 'options' => ['class'=>\Yii::$app->user->can('relation') ? '' :'hide'], | ||
86 | + ] | ||
39 | ] | 87 | ] |
40 | ], | 88 | ], |
41 | - ['label' => 'Текстовые страницы', 'url' => ['/page/index']], | ||
42 | - ['label' => 'Статьи', 'url' => ['/articles/index']], | ||
43 | - ['label' => 'Акции', 'url' => ['/event/index']], | 89 | + [ |
90 | + 'label' => 'Текстовые страницы', | ||
91 | + 'url' => ['/page/index'], | ||
92 | + 'options' => ['class'=>\Yii::$app->user->can('event') ? '' :'hide'], | ||
93 | + ], | ||
94 | + [ | ||
95 | + 'label' => 'Статьи', | ||
96 | + 'url' => ['/articles/index'], | ||
97 | + 'options' => ['class'=>\Yii::$app->user->can('articles') ? '' :'hide'], | ||
98 | + ], | ||
99 | + [ | ||
100 | + 'label' => 'Акции', | ||
101 | + 'url' => ['/event/index'], | ||
102 | + 'options' => ['class'=>\Yii::$app->user->can('event') ? '' :'hide'], | ||
103 | + ], | ||
44 | [ | 104 | [ |
45 | 'label' => 'SEO', | 105 | 'label' => 'SEO', |
46 | 'template'=>'<a href="{url}"> <i class="glyphicon glyphicon-search"></i> <span>{label}</span></a>', | 106 | 'template'=>'<a href="{url}"> <i class="glyphicon glyphicon-search"></i> <span>{label}</span></a>', |
107 | + 'options' => ['class'=>\Yii::$app->user->can('seo') || \Yii::$app->user->can('seo-category') ? '' :'hide'], | ||
47 | 'items' => [ | 108 | 'items' => [ |
48 | - ['label' => 'URL', 'url' => ['/seo/index']], | ||
49 | - ['label' => 'Шаблоны', 'url' => ['/seo-category/index']] | 109 | + [ |
110 | + 'label' => 'URL', | ||
111 | + 'url' => ['/seo/index'], | ||
112 | + 'options' => ['class'=>\Yii::$app->user->can('seo') ? '' :'hide'], | ||
113 | + ], | ||
114 | + [ | ||
115 | + 'label' => 'Шаблоны', | ||
116 | + 'url' => ['/seo-category/index'], | ||
117 | + 'options' => ['class'=>\Yii::$app->user->can('seo-category') ? '' :'hide'], | ||
118 | + ] | ||
50 | ] | 119 | ] |
51 | ], | 120 | ], |
52 | - ['label' => 'Фон', 'url' => ['/bg/index']], | ||
53 | - ['label' => 'Подписка', 'url' => ['/subscribe/index']], | ||
54 | - ['label' => 'Пользователи', 'url' => ['/customer/index']], | ||
55 | - ['label' => 'Группы пользователей', 'url' => ['/group/index']], | 121 | + [ |
122 | + 'label' => 'Фон', | ||
123 | + 'url' => ['/bg/index'], | ||
124 | + 'options' => ['class'=>\Yii::$app->user->can('bg')? '' :'hide'] | ||
125 | + ], | ||
126 | + [ | ||
127 | + 'label' => 'Подписка', | ||
128 | + 'url' => ['/subscribe/index'], | ||
129 | + 'options' => ['class'=>\Yii::$app->user->can('subscribe') ? '' :'hide'], | ||
130 | + ], | ||
131 | + [ | ||
132 | + 'label' => 'Пользователи', | ||
133 | + 'url' => ['/customer/index'], | ||
134 | + 'options' => ['class'=>\Yii::$app->user->can('customer') ? '' :'hide'], | ||
135 | + ], | ||
136 | + [ | ||
137 | + 'label' => 'Группы пользователей', | ||
138 | + 'url' => ['/group/index'], | ||
139 | + 'options' => ['class'=>\Yii::$app->user->can('group')? '' :'hide'] | ||
140 | + ], | ||
56 | [ | 141 | [ |
57 | 'label' => 'Настройка ролей', | 142 | 'label' => 'Настройка ролей', |
58 | 'template'=>'<a href="{url}"> <i class="glyphicon glyphicon-search"></i> <span>{label}</span></a>', | 143 | 'template'=>'<a href="{url}"> <i class="glyphicon glyphicon-search"></i> <span>{label}</span></a>', |
144 | + 'options' => ['class'=>\Yii::$app->user->can('user') || \Yii::$app->user->can('user') || \Yii::$app->user->can('permit') ? '' :'hide'], | ||
59 | 'items' => [ | 145 | 'items' => [ |
60 | - ['label' => 'Администраторы', 'url' => ['/user/index']], | ||
61 | - ['label' => 'управление ролями', 'url' => ['/permit/access/role']], | ||
62 | - ['label' => 'управление правами доступа', 'url' => ['/permit/access/permission']] | 146 | + [ |
147 | + 'label' => 'Администраторы', | ||
148 | + 'url' => ['/user/index'], | ||
149 | + 'options' => ['class'=>\Yii::$app->user->can('user') ? '' :'hide'], | ||
150 | + ], | ||
151 | + [ | ||
152 | + 'label' => 'управление ролями', | ||
153 | + 'url' => ['/permit/access/role'], | ||
154 | + 'options' => ['class'=>\Yii::$app->user->can('permit') ? '' :'hide'], | ||
155 | + ], | ||
156 | + [ | ||
157 | + 'label' => 'управление правами доступа', | ||
158 | + 'url' => ['/permit/access/permission'], | ||
159 | + 'options' => ['class'=>\Yii::$app->user->can('permit') ? '' :'hide'], | ||
160 | + ] | ||
63 | ] | 161 | ] |
64 | ], | 162 | ], |
65 | 163 |
common/modules/product/widgets/views/products_block.php
@@ -15,13 +15,6 @@ | @@ -15,13 +15,6 @@ | ||
15 | </div> | 15 | </div> |
16 | </div> | 16 | </div> |
17 | 17 | ||
18 | -<?php $js = '$(".owl-carousel").owlCarousel({ | ||
19 | - // Navigation | ||
20 | - navigation : true, | ||
21 | - navigationText : ["prev","next"], | ||
22 | - rewindNav : true, | ||
23 | - scrollPerPage : false, | ||
24 | - pagination : false | ||
25 | - })'; | 18 | +<?php $js = '$(".owl-carousel").owlCarousel()'; |
26 | $this->registerJs($js, View::POS_READY); | 19 | $this->registerJs($js, View::POS_READY); |
27 | ?> | 20 | ?> |
28 | \ No newline at end of file | 21 | \ No newline at end of file |
frontend/assets/AppAsset.php
@@ -25,7 +25,7 @@ class AppAsset extends AssetBundle | @@ -25,7 +25,7 @@ class AppAsset extends AssetBundle | ||
25 | ]; | 25 | ]; |
26 | public $depends = [ | 26 | public $depends = [ |
27 | 'yii\web\JqueryAsset', | 27 | 'yii\web\JqueryAsset', |
28 | -// 'sersid\owlcarousel\Asset' | 28 | + 'sersid\owlcarousel\Asset' |
29 | //'yii\web\YiiAsset', | 29 | //'yii\web\YiiAsset', |
30 | //'yii\bootstrap\BootstrapAsset', | 30 | //'yii\bootstrap\BootstrapAsset', |
31 | ]; | 31 | ]; |
frontend/views/layouts/main.php
@@ -29,7 +29,7 @@ | @@ -29,7 +29,7 @@ | ||
29 | $('#call').call({token:'" . Yii::$app->request->getCsrfToken () . "'}); | 29 | $('#call').call({token:'" . Yii::$app->request->getCsrfToken () . "'}); |
30 | ", View::POS_READY, 'call'); | 30 | ", View::POS_READY, 'call'); |
31 | 31 | ||
32 | -$this->registerJsFile (Yii::$app->request->baseUrl . '/js/fix_height.js', ['position' => View::POS_HEAD]); | 32 | +$this->registerJsFile (Yii::$app->request->baseUrl . '/js/fix_height.js', ['position' => View::POS_HEAD, 'depends' => ['yii\web\JqueryAsset']]); |
33 | $this->registerJs (" | 33 | $this->registerJs (" |
34 | var activeTab = $('.social li:first a').attr('id'); | 34 | var activeTab = $('.social li:first a').attr('id'); |
35 | $('.'+activeTab+'_box').show(); | 35 | $('.'+activeTab+'_box').show(); |
frontend/web/css/style.css
@@ -216,7 +216,7 @@ a.more_map{color:#99a5ad;border-bottom:1px dotted #99a5ad;text-decoration:none;f | @@ -216,7 +216,7 @@ a.more_map{color:#99a5ad;border-bottom:1px dotted #99a5ad;text-decoration:none;f | ||
216 | .rightbar{float:right;width:380px;margin-left:40px;} | 216 | .rightbar{float:right;width:380px;margin-left:40px;} |
217 | .rightbar.basket_rightbar{margin-right: 20px;} | 217 | .rightbar.basket_rightbar{margin-right: 20px;} |
218 | .rightbar2{float:right;width:320px;} | 218 | .rightbar2{float:right;width:320px;} |
219 | -.content {overflow:hidden;min-height:500px;} | 219 | +.content {overflow:hidden;} |
220 | * html .content{height:1%;} | 220 | * html .content{height:1%;} |
221 | .content2 {overflow:hidden;} | 221 | .content2 {overflow:hidden;} |
222 | * html .content2{height:1%;} | 222 | * html .content2{height:1%;} |
@@ -1500,6 +1500,14 @@ input.custom-radio + label:hover { | @@ -1500,6 +1500,14 @@ input.custom-radio + label:hover { | ||
1500 | margin: 50px auto 0 auto; | 1500 | margin: 50px auto 0 auto; |
1501 | } | 1501 | } |
1502 | .wrapper_all {} | 1502 | .wrapper_all {} |
1503 | +#bg { | ||
1504 | + top: 0 !important; | ||
1505 | + z-index: 1 !important; | ||
1506 | +} | ||
1507 | +.top, .wrap, .bottom, .fotter { | ||
1508 | + position: relative; | ||
1509 | + z-index: 2; | ||
1510 | +} | ||
1503 | .product-thumb-video iframe { | 1511 | .product-thumb-video iframe { |
1504 | width: 260px; | 1512 | width: 260px; |
1505 | height: auto; | 1513 | height: auto; |
frontend/web/js/fix_height.js
1 | +window.onload = function() { | ||
2 | + autoHeight(); | ||
3 | + function autoHeight() { | ||
4 | + | ||
5 | + footerBottom(); | ||
6 | + resizeFooterBottom(); | ||
7 | + | ||
8 | + function footerBottom(){ | ||
9 | + var heightHeader1 = $('nav.top').outerHeight() | ||
10 | + var heightHeader2 = $('.header').outerHeight() | ||
11 | + var heightHeader3 = $('.menu').outerHeight() | ||
12 | + var heightHeader = (heightHeader1+heightHeader2+heightHeader3) | ||
13 | + var heightFooter1 = $('.bottom').outerHeight() | ||
14 | + var heightFooter2 = $('.fotter').outerHeight() | ||
15 | + var heightFooter = (heightFooter1+heightFooter2) | ||
16 | + var windowHeight = $(window).height() | ||
17 | + $('.wrapper_all').css({minHeight:(windowHeight-heightHeader-heightFooter)-60}) | ||
18 | + if(($('.wrapper_all .site-error').length)>=1) { | ||
19 | + $('.wrapper_all').css({minHeight:(windowHeight-heightHeader-heightFooter)-70}) | ||
20 | + } | ||
21 | + $('#bg').css({minHeight:windowHeight}) | ||
22 | + } | ||
23 | + | ||
24 | + function resizeFooterBottom(){ | ||
25 | + $(window).resize(function(){ | ||
26 | + footerBottom(); | ||
27 | + }) | ||
28 | + } | ||
29 | + } | ||
30 | +} | ||
31 | + | ||
32 | + | ||
33 | + | ||
34 | + | ||
35 | + | ||
36 | + |