From c93ce8710823fcad1b370e68ac523b62170da50d Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Mon, 29 Aug 2016 11:29:37 +0300 Subject: [PATCH] big commti --- common/modules/product/widgets/views/product_smart.php | 140 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------- frontend/assets/AppAsset.php | 1 + frontend/controllers/CabinetController.php | 100 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ frontend/controllers/SiteController.php | 10 ++++++++++ frontend/views/cabinet/bookmarks.php | 24 ++++++++++++++++++++++++ frontend/views/cabinet/index.php | 18 ++++++++++++++++++ frontend/views/cabinet/my-orders.php | 24 ++++++++++++++++++++++++ frontend/views/cabinet/update.php | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ frontend/views/catalog/products.php | 246 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ frontend/views/layouts/cabinet.php | 28 ++++++++++++++++++++++++++++ frontend/views/site/index.php | 525 ++++----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- frontend/web/css/css_header.css | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ frontend/web/js/js_head.js | 18 ++++++++++++++++++ 13 files changed, 418 insertions(+), 823 deletions(-) create mode 100755 frontend/controllers/CabinetController.php create mode 100755 frontend/views/cabinet/bookmarks.php create mode 100755 frontend/views/cabinet/index.php create mode 100755 frontend/views/cabinet/my-orders.php create mode 100755 frontend/views/cabinet/update.php create mode 100644 frontend/views/layouts/cabinet.php diff --git a/common/modules/product/widgets/views/product_smart.php b/common/modules/product/widgets/views/product_smart.php index b47be81..52016b7 100755 --- a/common/modules/product/widgets/views/product_smart.php +++ b/common/modules/product/widgets/views/product_smart.php @@ -1,64 +1,92 @@ -
-
- - is_top) || !empty($product->is_new) || !empty($product->akciya)) :?> -
    - is_top)) :?> -
  • top
  • - - is_new)) :?> -
  • new
  • - - akciya)) :?> -
  • promo
  • - -
- - name ?> - +
+
+
+ +
+ name, Url::to(['catalog/product', 'product' => $product->alias]), ['class'=>'btn-product-details'] )?> +
+ +
+
+ Цена: + + variant->price ?> + грн + +
+
+
+
Особенности
+
+
+
    -
    -

    - enabledVariants[0]->price_old != 0 && $product->enabledVariants[0]->price_old != $product->enabledVariants[0]->price) :?> - enabledVariants[0]->price_old ?> грн.  - - enabledVariants[0]->price?> грн.

    -
    -
+
  • Бренд: brand->name ?>
  • - Купить + getActiveProperties($product->category->category_id) as $group): ?> +
  • name ?> _options as $option) : ?> ValueRenderHTML ?>
  • + - +
    +
    + +
    +
    +
    +
    \ No newline at end of file diff --git a/frontend/assets/AppAsset.php b/frontend/assets/AppAsset.php index 9e19e95..39bf07e 100755 --- a/frontend/assets/AppAsset.php +++ b/frontend/assets/AppAsset.php @@ -30,6 +30,7 @@ class AppAsset extends AssetBundle ]; public $depends = [ 'yii\web\JqueryAsset', + 'sersid\owlcarousel\Asset', ]; diff --git a/frontend/controllers/CabinetController.php b/frontend/controllers/CabinetController.php new file mode 100755 index 0000000..e60d215 --- /dev/null +++ b/frontend/controllers/CabinetController.php @@ -0,0 +1,100 @@ + [ + 'class' => AccessControl::className(), + 'rules' => [ + [ + 'actions' => ['login', 'error'], + 'allow' => true, + ], + [ + 'actions' => ['logout', 'index', 'create', 'update', 'view', 'delete','my-orders','bookmarks'], + 'allow' => true, + 'roles' => ['@'], + ], + ], + ], + 'verbs' => [ + 'class' => VerbFilter::className(), + 'actions' => [ + 'logout' => ['post'], + ], + ], + ]; + } + + public function actionIndex(){ + return $this->render('index'); + } + + public function actionUpdate(){ + + + + $model = Yii::$app->user->identity; + + + if(Yii::$app->request->post()){ + + $model->load(Yii::$app->request->post()); + $model->validate(); + + if($model->validate()){ + $model->save(); + + } + + } + + + return $this->render('update',[ + 'model' =>$model + ]); + } + + + public function actionBookmarks(){ + return $this->render('bookmarks',[ + + ]); + } + + public function actionMyOrders(){ + return $this->render('my-orders',[ + + ]); + } + +} \ No newline at end of file diff --git a/frontend/controllers/SiteController.php b/frontend/controllers/SiteController.php index bd3fb80..779033e 100755 --- a/frontend/controllers/SiteController.php +++ b/frontend/controllers/SiteController.php @@ -30,7 +30,17 @@ class SiteController extends Controller ]); } + /** + * Logs out the current user. + * + * @return mixed + */ + public function actionLogout() + { + Yii::$app->user->logout(); + return $this->goHome(); + } /** * Logs in a user. * diff --git a/frontend/views/cabinet/bookmarks.php b/frontend/views/cabinet/bookmarks.php new file mode 100755 index 0000000..804d20d --- /dev/null +++ b/frontend/views/cabinet/bookmarks.php @@ -0,0 +1,24 @@ +title = 'Закладки'; +$this->params['breadcrumbs'][] = $this->title; +use yii\helpers\Html; +use yii\helpers\Url; +use yii\widgets\ActiveForm; +?> + +'' +]); ?> + + + + + + + \ No newline at end of file diff --git a/frontend/views/cabinet/index.php b/frontend/views/cabinet/index.php new file mode 100755 index 0000000..0cd910e --- /dev/null +++ b/frontend/views/cabinet/index.php @@ -0,0 +1,18 @@ +title = 'Moй кабинет'; +$this->params['breadcrumbs'][] = $this->title; + +?> + +
    +
    Имя
    +
    e-mail
    +
    Телефон
    +
    + +
    + +
    user->identity->name ?>
    +
    user->identity->email ?>
    +
    user->identity->phone ?>
    +
    \ No newline at end of file diff --git a/frontend/views/cabinet/my-orders.php b/frontend/views/cabinet/my-orders.php new file mode 100755 index 0000000..72f32c9 --- /dev/null +++ b/frontend/views/cabinet/my-orders.php @@ -0,0 +1,24 @@ +title = 'Мои заказы'; +$this->params['breadcrumbs'][] = $this->title; +use yii\helpers\Html; +use yii\helpers\Url; +use yii\widgets\ActiveForm; +?> + +'' +]); ?> + + + + + + + \ No newline at end of file diff --git a/frontend/views/cabinet/update.php b/frontend/views/cabinet/update.php new file mode 100755 index 0000000..dbb8439 --- /dev/null +++ b/frontend/views/cabinet/update.php @@ -0,0 +1,56 @@ +title = 'Редактировать личные данные'; + $this->params['breadcrumbs'][] = $this->title; + use yii\helpers\Html; + use yii\helpers\Url; + use yii\widgets\ActiveForm; +?> + +'' +]); ?> + + + + + + + \ No newline at end of file diff --git a/frontend/views/catalog/products.php b/frontend/views/catalog/products.php index 035bb88..70586e5 100755 --- a/frontend/views/catalog/products.php +++ b/frontend/views/catalog/products.php @@ -38,252 +38,6 @@ use yii\helpers\Url;
    -
    - - - - - -
    - diff --git a/frontend/views/layouts/cabinet.php b/frontend/views/layouts/cabinet.php new file mode 100644 index 0000000..50c091a --- /dev/null +++ b/frontend/views/layouts/cabinet.php @@ -0,0 +1,28 @@ +beginContent('@app/views/layouts/main.php'); +?> +

    + +
    +
    +
    +
    +
    +
    +
    + +
    +
    + + +
    +
    +endContent() ?> \ No newline at end of file diff --git a/frontend/views/site/index.php b/frontend/views/site/index.php index fcbbfaa..072c28d 100755 --- a/frontend/views/site/index.php +++ b/frontend/views/site/index.php @@ -148,534 +148,17 @@
    -
    -
    -
    - -Интернет-магазин светильников “Линия света” -
    - - -
    -
    -
    -

    Рекомендуем специально для вас

    -
    - - - - - - +
    +
    - -
    -
    Лучшие светодиодные светильники в Киеве
    -
    -
    - -

    Светильники

    -
    Как лучше осветить свой дом? Какие светильник, люстра, бра эстетично впишутся в Ваш интерьер? Где купить светильники? Эти и многие подобные вопросы рано или поздно возникают у каждого. Где найти ответы на них? Мы с радостью поможем Вам в решении задачи "светильники Киев купить".
    - - - -
    -
    -
    -
    - - - - - - - -
    - -
    - - - - - -
    \ No newline at end of file diff --git a/frontend/web/css/css_header.css b/frontend/web/css/css_header.css index 637df5c..7f240d1 100755 --- a/frontend/web/css/css_header.css +++ b/frontend/web/css/css_header.css @@ -16,6 +16,11 @@ } +.owl-item .catalog_item{ + float: none !important; + width: auto !important; +} + /*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */ html { @@ -6489,6 +6494,52 @@ button.close { filter: progid: DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1) } +.owl-pagination {display: none;} +.owl-controls .owl-buttons div { + width: 34px !important; + height: 50px !important; + background: #596065 !important; + top:50% !important; + margin: -25px 0 0 0 !important; + opacity: 1 !important; + border-radius: 0 !important; + padding: 0!important; + position: absolute; +} +.owl-controls .owl-buttons div:hover { + background: #acafb2 !important; + transition: 0.2s!important; +} +.owl-controls .owl-buttons .owl-prev { + border-top-right-radius: 4px !important; + border-bottom-right-radius: 4px !important; + left: -20px; + +} +.owl-controls .owl-buttons .owl-next { + border-top-left-radius: 4px !important; + border-bottom-left-radius: 4px !important; + right: -20px; + +} +.owl-controls .owl-buttons div:before { + position: absolute; + content: ''; + width: 8px; + height: 22px; + background: url(../images/arrows_blocks.png) no-repeat; + top:50%; + margin-top: -11px; + left: 50%; + margin-left: -4px; +} +.owl-controls .owl-buttons .owl-prev:before { + background-position: 0 0; +} +.owl-controls .owl-buttons .owl-next:before { + background-position: -8px 0; +} + .carousel-control:hover, .carousel-control:focus { outline: 0; diff --git a/frontend/web/js/js_head.js b/frontend/web/js/js_head.js index 632fe8b..a9f3e65 100644 --- a/frontend/web/js/js_head.js +++ b/frontend/web/js/js_head.js @@ -2877,6 +2877,24 @@ $(document).ready(function() { $(this).find('.img-nav.img-prev').attr('src', prev_img_url); $(this).find('.img-nav.img-next').attr('src', next_img_url); }); + + + prev_img_url = $('#catSlider #topCarousel').find('.item.active .cat-slide-part img').attr('src'); + next_img_url = $('#catSlider #topCarousel').find('.item.active .cat-slide-part img').attr('src'); + $('#catSlider #topCarousel').find('.img-nav.img-prev').attr('src', prev_img_url); + $('#catSlider #topCarousel').find('.img-nav.img-next').attr('src', next_img_url); + $('#topCarousel').carousel({ + interval: 10000 + }); + $('#catSlider #topCarousel').bind('slide.bs.carousel', function(e) { + prev_img_url = $(this).find('.item.active .cat-slide-part img').attr('src'); + next_img_url = $(this).find('.item.active .cat-slide-part img').attr('src'); + $(this).find('.img-nav.img-prev').attr('src', prev_img_url); + $(this).find('.img-nav.img-next').attr('src', next_img_url); + }); + + + $('ul.view_type .view_mini_table').on('click', function() { $('.catalog_product_list').removeClass('view_list'); $('.catalog_product_list').addClass('view_mini_table'); -- libgit2 0.21.4