From a75f3071bd4d0995573a4775bea3e65d6ea9e3e4 Mon Sep 17 00:00:00 2001 From: "shubhammehrotra.symfony@webkul.com" Date: Thu, 2 Jan 2020 21:20:44 +0530 Subject: [PATCH] minor bugs --- .../publishable/assets/css/velocity.css | 96 ++++++++-- .../publishable/assets/js/velocity.js | 28 ++- .../Webkul/Velocity/src/Config/system.php | 2 +- ...12_30_155256_create_velocity_meta_data.php | 4 +- .../Webkul/Velocity/src/Helpers/Helper.php | 6 +- .../Admin/ConfigurationController.php | 33 ++++ .../js/UI/components/content-header.vue | 2 +- .../assets/js/UI/components/sidebar.vue | 24 ++- .../Velocity/src/Resources/assets/js/app.js | 16 +- .../src/Resources/assets/sass/_variables.scss | 2 + .../src/Resources/assets/sass/app.scss | 42 ++++- .../Resources/assets/sass/components/app.scss | 39 ++++- .../assets/sass/components/home.scss | 10 -- .../assets/sass/components/shared.scss | 13 +- .../Velocity/src/Resources/lang/en/app.php | 4 + .../views/admin/meta-info/meta-data.blade.php | 165 +++++++++++------- .../src/Resources/views/cms/page.blade.php | 25 +++ .../customers/account/address/edit.blade.php | 144 +++++++-------- .../views/customers/account/index.blade.php | 2 +- .../account/partials/sidemenu.blade.php | 2 +- .../advertisement-one.blade.php | 77 ++++++-- .../advertisement-three.blade.php | 45 ++++- .../advertisement-two.blade.php | 61 +++++-- .../views/home/featured-products.blade.php | 2 +- .../src/Resources/views/home/index.blade.php | 8 +- .../views/home/new-products.blade.php | 2 +- .../views/home/popular-products.blade.php | 2 +- .../home/recently-viewed-products.blade.php | 2 +- .../src/Resources/views/home/slider.blade.php | 3 +- .../views/layouts/header/index.blade.php | 26 +-- .../Resources/views/layouts/master.blade.php | 9 +- .../views/layouts/top-nav/index.blade.php | 1 + .../layouts/top-nav/locale-currency.blade.php | 15 +- .../layouts/top-nav/login-section.blade.php | 2 +- 34 files changed, 665 insertions(+), 249 deletions(-) create mode 100644 packages/Webkul/Velocity/src/Resources/views/cms/page.blade.php diff --git a/packages/Webkul/Velocity/publishable/assets/css/velocity.css b/packages/Webkul/Velocity/publishable/assets/css/velocity.css index 083b2109a..eae0b55c3 100644 --- a/packages/Webkul/Velocity/publishable/assets/css/velocity.css +++ b/packages/Webkul/Velocity/publishable/assets/css/velocity.css @@ -981,7 +981,6 @@ #product-card-new { border: none; - height: 95%; margin: 0 5px 10px 10px; padding-bottom: 10px; } @@ -1771,12 +1770,12 @@ .method-sticker { font-size: 13px; - color: #919192; padding: 4px 8px; text-align: center; border-radius: 1px; display: inline-block; - background-color: rgba(0, 0, 0, 0.53); + color: #cfcfd0; + background-color: #141516; } #sidebar .category-content { @@ -1789,6 +1788,10 @@ position: relative; } +#sidebar li:hover { + color: #4D7EA8; +} + .grouped-product-container .grouped-product-list { padding: 15px 0; border-top: solid 1px rgba(162, 162, 162, 0.2); @@ -2060,6 +2063,32 @@ background-color: #26A37C !important; } +.full-content-wrapper > .container-fluid { + margin-bottom: 60px; + padding: 0 !important; +} + +.full-content-wrapper > .container-fluid > .row { + padding: 0 15px !important; +} + +.slides-container .VueCarousel-pagination { + bottom: 10px; + position: absolute; +} + +.slides-container .VueCarousel-pagination button { + width: 15px !important; + height: 15px !important; +} + +.slides-container .VueCarousel-pagination button:focus, +.slides-container .VueCarousel-pagination button:active { + outline: none; + -webkit-box-shadow: none; + box-shadow: none; +} + /* @author Shubham Mehrotra */ body { overflow-x: hidden; @@ -2252,10 +2281,6 @@ header #search-form > *:focus { font-size: 14px; } -.container > .container-fluid { - margin-bottom: 60px; -} - /* advertisement-one */ .advertisement-one .offers-lt-panel { height: 400px; @@ -2964,7 +2989,7 @@ body::after { padding-left: 40px !important; } -.pr0, .container > .container-fluid > .row { +.pr0 { padding-right: 0px !important; } @@ -3143,7 +3168,6 @@ body::after { .theme-btn, .cart-details .continue-shopping-btn, .account-content .account-layout .bottom-toolbar .pagination .page-item { border: none; cursor: pointer; - border-radius: 2px; padding: 10px 20px; vertical-align: top; color: #FFFFFF !important; @@ -3542,6 +3566,21 @@ button[disabled] { margin: 0 auto !important; } +.styled-select { + appearance: none; + -moz-appearance: none; + /* Firefox */ + -webkit-appearance: none; + /* Safari and Chrome */ +} + +.select-icon { + top: 1px; + left: -7px; + font-size: 16px; + position: relative; +} + .product-view { padding: 20px; } @@ -12029,16 +12068,46 @@ header #search-form { background: #FFFFFF; } -header #search-form select { +header #search-form .selectdiv { width: 30%; + font-family: 'Webkul Rango' !important; + speak: none; + font-style: normal; + font-weight: normal; + font-variant: normal; + text-transform: none; + line-height: 1; + -webkit-font-smoothing: antialiased; +} + +header #search-form .selectdiv:before { + top: 13px; + left: 160px; + z-index: 10; + font-size: 16px; + content: "\E906"; + position: absolute; +} + +header #search-form select { + border-radius: 0px; + width: 100%; height: 100%; cursor: pointer; - border: 1px solid #269c77; border-right: none; - border-radius: 0px; + border: 1px solid #26A37C; + font-family: "Source Sans Pro", sans-serif; + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; +} + +header #search-form select::-ms-expand { + display: none; } header #search-form input { + border-radius: 0px; width: 70%; height: 100%; font-size: 14px; @@ -12047,8 +12116,7 @@ header #search-form input { border-left: none; line-height: 20px; letter-spacing: 0; - border: 1px solid #269c77; - border-radius: 0px; + border: 1px solid #26A37C; } header #search-form .btn, header #search-form .quantity button, .quantity header #search-form button, diff --git a/packages/Webkul/Velocity/publishable/assets/js/velocity.js b/packages/Webkul/Velocity/publishable/assets/js/velocity.js index b010843ba..53a471532 100644 --- a/packages/Webkul/Velocity/publishable/assets/js/velocity.js +++ b/packages/Webkul/Velocity/publishable/assets/js/velocity.js @@ -1192,6 +1192,20 @@ $(document).ready(function () { }); }, + mounted: function mounted() { + var sliderContainer = $('.slides-container'); + if (sliderContainer && sliderContainer.length) { + sliderContainer = sliderContainer[0]; + + console.log(sliderContainer); + + // setInterval(() => { + // debugger + // sliderContainer.scrollTo(500, 0); + // }, 1000); + } + }, + methods: { onSubmit: function onSubmit(event) { var _this2 = this; @@ -35479,13 +35493,14 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); // /* harmony default export */ __webpack_exports__["default"] = ({ - props: ['categories', 'url', 'addClass', 'mainSidebar'], + props: ['url', 'addClass', 'categories', 'mainSidebar', 'categoryCount'], data: function data() { var slicedCategories = this.categories; + var categoryCount = this.categoryCount ? this.categoryCount : 9; - if (slicedCategories && slicedCategories.length > 9) { - slicedCategories = this.categories.slice(0, 9); + if (slicedCategories && slicedCategories.length > categoryCount) { + slicedCategories = this.categories.slice(0, categoryCount); } return { @@ -35494,7 +35509,10 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); }, mounted: function mounted() { - if (window.location.href !== this.url + '/' && this.mainSidebar || this.categories && this.categories.length == 0) { + var checkLocale = window.location.href.slice(0, (this.url + '/?locale=').length); + var checkCurrency = window.location.href.slice(0, (this.url + '/?currency=').length); + + if (checkLocale == this.url + '/?locale=' || checkCurrency == this.url + '/?currency=') {} else if (window.location.href !== this.url + '/' && this.mainSidebar || this.categories && this.categories.length == 0) { this.toggleSidebar(); } }, @@ -36746,7 +36764,7 @@ var render = function() { var _h = _vm.$createElement var _c = _vm._self._c || _h return _c("div", { staticClass: "row col-12 remove-padding-margin" }, [ - _c("div", { staticClass: "main-category fs20 pt10 col-2" }, [ + _c("div", { staticClass: "main-category fs20 pt10 col-2 unselectable" }, [ _c("i", { class: "rango-view-list " + diff --git a/packages/Webkul/Velocity/src/Config/system.php b/packages/Webkul/Velocity/src/Config/system.php index a1fb25c4c..8ff1e6a5f 100644 --- a/packages/Webkul/Velocity/src/Config/system.php +++ b/packages/Webkul/Velocity/src/Config/system.php @@ -29,7 +29,7 @@ return [ ] ], [ 'name' => 'featured_product', - 'title' => 'velocity::app.admin.system.general.featured-product', + 'title' => 'shop::app.home.featured-products', 'type' => 'text', ] ] diff --git a/packages/Webkul/Velocity/src/Database/Migrations/2019_12_30_155256_create_velocity_meta_data.php b/packages/Webkul/Velocity/src/Database/Migrations/2019_12_30_155256_create_velocity_meta_data.php index 5e4d84023..a0f4338e7 100644 --- a/packages/Webkul/Velocity/src/Database/Migrations/2019_12_30_155256_create_velocity_meta_data.php +++ b/packages/Webkul/Velocity/src/Database/Migrations/2019_12_30_155256_create_velocity_meta_data.php @@ -15,13 +15,13 @@ class CreateVelocityMetaData extends Migration { Schema::create('velocity_meta_data', function (Blueprint $table) { $table->increments('id'); - $table->text('home_page_content'); $table->text('footer_left_content'); $table->text('footer_middle_content'); $table->boolean('slider')->default(0); + $table->json('advertisement')->nullable(); + $table->integer('sidebar_category_count')->default(9); $table->text('subscription_bar_content')->nullable(); - $table->timestamps(); }); } diff --git a/packages/Webkul/Velocity/src/Helpers/Helper.php b/packages/Webkul/Velocity/src/Helpers/Helper.php index 60e5a1aa4..3186233f7 100644 --- a/packages/Webkul/Velocity/src/Helpers/Helper.php +++ b/packages/Webkul/Velocity/src/Helpers/Helper.php @@ -104,8 +104,10 @@ class Helper extends Review foreach ($totalData['categories'] as $categories) { foreach($categories['translations'] as $catName) { - $brandData[$brand->admin_name][] = $catName['name']; - $categoryName[] = $catName['name']; + if (isset($brand->admin_name)) { + $brandData[$brand->admin_name][] = $catName['name']; + $categoryName[] = $catName['name']; + } } } } diff --git a/packages/Webkul/Velocity/src/Http/Controllers/Admin/ConfigurationController.php b/packages/Webkul/Velocity/src/Http/Controllers/Admin/ConfigurationController.php index 0e39e1492..1298f0cdc 100644 --- a/packages/Webkul/Velocity/src/Http/Controllers/Admin/ConfigurationController.php +++ b/packages/Webkul/Velocity/src/Http/Controllers/Admin/ConfigurationController.php @@ -3,6 +3,7 @@ namespace Webkul\Velocity\Http\Controllers\Admin; use DB; +use Illuminate\Support\Facades\Storage; use Webkul\Velocity\Repositories\MetadataRepository; use Webkul\Velocity\Repositories\VelocityMetadataRepository; @@ -48,6 +49,7 @@ class ConfigurationController extends Controller public function storeMetaData($id) { + // check if radio button value if (request()->get('slides') == "on") { $params = request()->all() + [ 'slider' => 1 @@ -58,12 +60,43 @@ class ConfigurationController extends Controller ]; } + $params['advertisement'] = []; + + foreach ($params['images'] as $index => $advertisement) { + if ($advertisement['image_1'] !== "") { + $params['advertisement'][$index] = $this->uploadImages($advertisement, $index); + } + } + + $params['advertisement'] = json_encode($params['advertisement']); + + unset($params['images']); unset($params['slides']); + // update row $product = $this->velocityMetaDataRepository->update($params, $id); session()->flash('success', trans('admin::app.response.update-success', ['name' => 'Velocity Theme'])); return redirect()->route($this->_config['redirect']); } + + public function uploadImages($data, $index) + { + $type = 'images'; + $request = request(); + + foreach ($data as $imageId => $image) { + $file = $type . '.' . $index . '.' . $imageId; + $dir = "velocity/$type"; + + if ($request->hasFile($file)) { + Storage::delete($dir . $file); + + $advertisement[$imageId] = $request->file($file)->store($dir); + } + } + + return $advertisement; + } } \ No newline at end of file diff --git a/packages/Webkul/Velocity/src/Resources/assets/js/UI/components/content-header.vue b/packages/Webkul/Velocity/src/Resources/assets/js/UI/components/content-header.vue index f991399a8..8ca87ab0f 100644 --- a/packages/Webkul/Velocity/src/Resources/assets/js/UI/components/content-header.vue +++ b/packages/Webkul/Velocity/src/Resources/assets/js/UI/components/content-header.vue @@ -1,6 +1,6 @@