diff --git a/addons/default/visiosoft/advs-module/resources/css/post-category.css b/addons/default/visiosoft/advs-module/resources/css/post-category.css index 46b168d06..45e145bd1 100644 --- a/addons/default/visiosoft/advs-module/resources/css/post-category.css +++ b/addons/default/visiosoft/advs-module/resources/css/post-category.css @@ -1,4 +1,22 @@ +#ad-cat-section .step-icon { + height: 1rem; + vertical-align: baseline; +} + +.category-tab { + overflow-x: auto; +} + +.cat-item:not(.focus-select) div, .cat-item:not(.focus-select) select { + background-color: #f8f9fa; +} + +.focus-select .cat-option { + box-shadow: 0 .125rem .25rem rgba(0,0,0,.075); +} + .cat-select { + height: 0; width: 100%; border: none; overflow-y: auto @@ -8,12 +26,16 @@ outline: none; } +.cat-item { + flex: none; + width: 13rem; +} + .cat-select option { - border-top: 1px solid #f2f2f2; - padding: 15px 0 20px; + cursor: pointer; + border-radius: 2px; position: relative; - padding-left: 10px; - font-size: 16px; + font-size: 13px; color: #505050; } @@ -21,14 +43,32 @@ display: none; } -.cat-item-3 { +.cat-item:last-child { display: none; } +.next-stap img { + width: 60px; +} + +.next-stap p { + font-size: 13px; + font-weight: 500; +} + .btn-1 { background-color: #00a651; - padding: 5px 50px 7px; + padding: 5px 30px 7px; color: #fff; border: 1px solid #dadada; margin-right: 5px; +} + +.cat-select::-webkit-scrollbar { + width: 4px; +} + +.cat-select::-webkit-scrollbar-thumb { + border-radius: 4px; + background-color: rgba(0,0,0,0.5); } \ No newline at end of file diff --git a/addons/default/visiosoft/advs-module/resources/images/ascend.svg b/addons/default/visiosoft/advs-module/resources/images/ascend.svg new file mode 100644 index 000000000..40404a167 --- /dev/null +++ b/addons/default/visiosoft/advs-module/resources/images/ascend.svg @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/addons/default/visiosoft/advs-module/resources/images/check.svg b/addons/default/visiosoft/advs-module/resources/images/check.svg new file mode 100644 index 000000000..14ca17bff --- /dev/null +++ b/addons/default/visiosoft/advs-module/resources/images/check.svg @@ -0,0 +1,2 @@ + + diff --git a/addons/default/visiosoft/advs-module/resources/js/cats.js b/addons/default/visiosoft/advs-module/resources/js/cats.js index c489f8cf7..8a0660f1f 100644 --- a/addons/default/visiosoft/advs-module/resources/js/cats.js +++ b/addons/default/visiosoft/advs-module/resources/js/cats.js @@ -22,26 +22,25 @@ $(document).ready(function () { success: function (response) { hideLoader(); if(response['title'] != undefined){ - var btn = '' - if(response['link'] != "") { - btn = ""+response['nextBtn']+""; - } - $('.cat-item-3').html( - '
' + - '
'+response['title']+'
' + - '

'+response['msg']+'

' + - '
' + - btn + - ''+response['cancelBtn']+'
' + var btn = ''; + $('.cat-item-3 .next-content').html( + '

'+response['title']+'

' + + '
' + btn + '
' ); - $('.cat-item-3').show(); + $('.cat-item-3').parent().css('display', 'flex'); stop(); - } - else { + } else { response.forEach(function(options){ - $(catId).append("").closest('.cat-item-2').show(); + $(catId).append(""); }); + $('.focus-select').removeClass('focus-select'); + $(catId).animate({height: '14rem'}, 200); + $(catId).closest('.cat-item-2').show().addClass('focus-select') } + // Auto scroll right + let categoryTab = $('.category-tab'); + let pos = categoryTab.scrollLeft() + categoryTab.width(); + categoryTab.animate( {scrollLeft: pos}, 1000); }, beforeSend: function () { showLoader() @@ -54,8 +53,10 @@ $(document).ready(function () { var endNo = 9; while (startNo <= endNo) { - $('#cat'+ startNo).html("").closest('.cat-item-2').hide(); - $('.cat-item-3').hide(); + $('#cat'+ startNo).animate({height: 0}, 200, 'linear', function () { + $(this).html("").closest('.cat-item-2').hide(); + }); + $('.cat-item-3').parent().hide(); startNo++; } }; @@ -63,13 +64,16 @@ $(document).ready(function () { for (var i = 1; i <= 10; i++) { (function(){ var ii = i; - $('#cat'+i).on('change', function (i,e) { - divId = $(this).find('option:selected').val(); + $('#cat' + i).on('change', function (i, e) { + $(this).find('option.selected').removeClass('selected'); + let selectedOption = $(this).find('option:selected'); + selectedOption.addClass('selected'); + let divId = selectedOption.val(); if (divId == 0) { - filter.hideCats(ii+1); + filter.hideCats(ii + 1); } - filter.hideCats(ii+1); - filter.getCats("#cat"+(ii+1), divId); + filter.hideCats(ii + 1); + filter.getCats("#cat" + (ii + 1), divId); }); })(); } diff --git a/addons/default/visiosoft/advs-module/resources/lang/en/message.php b/addons/default/visiosoft/advs-module/resources/lang/en/message.php index 8b0759ce3..378a3616f 100644 --- a/addons/default/visiosoft/advs-module/resources/lang/en/message.php +++ b/addons/default/visiosoft/advs-module/resources/lang/en/message.php @@ -10,16 +10,11 @@ return [ 'updated_category_msg' => 'Category successfully edited.', 'max_ad_limit' => [ 'title' => "Your Free Ad Limit is Out.", - 'msg' => "You have reached your free ad limit.", - 'nextBtn' => "Show Ads", - 'cancelBtn' => "or Cancel", + 'continueBtn' => "Show Ads", ], 'create_ad_with_post_cat' => [ - 'title' => "Post an Ad in just 30 seconds", - 'msg' => "Please DO NOT post multiple ads for the same items or service. All duplicate, spam and wrongly categorized ads will be deleted.", - 'nextBtn' => "Next", - 'cancelBtn' => "or Cancel", - 'link' => "", + 'title' => "Category selection has been completed.", + 'continueBtn' => "Continue", ], 'update_category_info' => 'Please update category.', 'filter_by_search_msg' => 'Filter By Search.', diff --git a/addons/default/visiosoft/advs-module/resources/views/new-ad/partials/breadcrumb.twig b/addons/default/visiosoft/advs-module/resources/views/new-ad/partials/breadcrumb.twig index b0944973b..b68a63be0 100644 --- a/addons/default/visiosoft/advs-module/resources/views/new-ad/partials/breadcrumb.twig +++ b/addons/default/visiosoft/advs-module/resources/views/new-ad/partials/breadcrumb.twig @@ -3,5 +3,4 @@ -

{{ trans('visiosoft.module.advs::field.post_free_ad') }}

\ No newline at end of file diff --git a/addons/default/visiosoft/advs-module/resources/views/new-ad/post-cat.twig b/addons/default/visiosoft/advs-module/resources/views/new-ad/post-cat.twig index 2dd1f60ec..04d822a6f 100644 --- a/addons/default/visiosoft/advs-module/resources/views/new-ad/post-cat.twig +++ b/addons/default/visiosoft/advs-module/resources/views/new-ad/post-cat.twig @@ -1,121 +1,95 @@ {% extends layout('post-cat') %} +{% block styles %} + {{ asset_style("visiosoft.module.advs::css/post-category.css") }} +{% endblock %} + {% block content %} -
-
- {% include "visiosoft.module.advs::new-ad/partials/breadcrumb" %} -
-
-
- -
-
-
{{ trans('visiosoft.module.advs::field.select_a_category') }}
- -
+
+ {% include "visiosoft.module.advs::new-ad/partials/breadcrumb" %} +
+
+ + Select Category Step by Step +
+ +
+
+
+
+
-
-
-
{{ trans('visiosoft.module.advs::field.select_a_sub_category') }}
- -
+
+
+
-
-
-
{{ trans('visiosoft.module.advs::field.select_a_sub_category') }}
- -
+
+
+
+
-
-
-
{{ trans('visiosoft.module.advs::field.select_a_sub_category') }}
- -
+
+
+
+
-
-
-
{{ trans('visiosoft.module.advs::field.select_a_sub_category') }}
- -
+
+
+
+
-
-
-
{{ trans('visiosoft.module.advs::field.select_a_sub_category') }}
- - -
+
-
-
-
{{ trans('visiosoft.module.advs::field.select_a_sub_category') }}
- -
+
+
+
+
-
-
-
{{ trans('visiosoft.module.advs::field.select_a_sub_category') }}
- -
+
+
+
+
-
-
-
{{ trans('visiosoft.module.advs::field.select_a_sub_category') }}
- -
+
+
+
+
-
-
-
{{ trans('visiosoft.module.advs::field.select_a_sub_category') }}
- -
+
+
+
+
+
-
-
- +
+
+
+ check icon +
-
-
- {{ blocks('center-add-ad-banner-area') }} -
+
+
+
+ {{ blocks('center-add-ad-banner-area') }}
- -
+
+
- {{ asset_add("scripts.js", "visiosoft.module.advs::js/cats.js") }} - {{ asset_add("styles.css", "visiosoft.module.advs::css/post-category.css") }} - - {% endblock %} diff --git a/addons/default/visiosoft/base-theme/resources/views/layouts/default.twig b/addons/default/visiosoft/base-theme/resources/views/layouts/default.twig index b38c512b8..667e38454 100644 --- a/addons/default/visiosoft/base-theme/resources/views/layouts/default.twig +++ b/addons/default/visiosoft/base-theme/resources/views/layouts/default.twig @@ -13,6 +13,7 @@ {% include "theme::partials/metadata" %} + {% block styles %}{% endblock %} diff --git a/addons/default/visiosoft/cats-module/src/Category/CategoryModel.php b/addons/default/visiosoft/cats-module/src/Category/CategoryModel.php index b5b4ee545..028a7d051 100644 --- a/addons/default/visiosoft/cats-module/src/Category/CategoryModel.php +++ b/addons/default/visiosoft/cats-module/src/Category/CategoryModel.php @@ -58,6 +58,21 @@ class CategoryModel extends CatsCategoryEntryModel implements CategoryInterface return count($this->getParentCats($id)) + 1; } + public function getParentsCount($id) + { + $parentCats = array(); + $currentId = $id; + do { + $cat = $this->getCat($currentId); + $catParent = $cat->parent_category_id; + if ($catParent) { + $currentId = $catParent; + $parentCats[] = $catParent; + } + } while ($catParent); + return count($parentCats); + } + public function getSubCategories($id, $get = null) { $sub_categories = $this->where('parent_category_id', $id)->get(); diff --git a/addons/default/visiosoft/cats-module/src/Category/CategoryRepository.php b/addons/default/visiosoft/cats-module/src/Category/CategoryRepository.php index be73e968b..8f60bd3a1 100644 --- a/addons/default/visiosoft/cats-module/src/Category/CategoryRepository.php +++ b/addons/default/visiosoft/cats-module/src/Category/CategoryRepository.php @@ -50,7 +50,15 @@ class CategoryRepository extends EntryRepository implements CategoryRepositoryIn public function getSubCatById($id) { - return $this->model->where('parent_category_id', $id)->where('deleted_at', null)->orderBy('sort_order')->get(); + $orderBy = $this->model->getParentsCount($id) >= 1 ? 'name' : 'sort_order'; + return $this->model->newQuery() + ->join('cats_category_translations', 'cats_category.id', '=', 'cats_category_translations.entry_id') + ->where('cats_category_translations.locale', config('app.locale')) + ->where('parent_category_id', $id) + ->where('deleted_at', null) + ->select('cats_category.*') + ->orderBy($orderBy) + ->get(); } public function getSingleCat($id)