From c9abc07d60f784de85100e2ba2c7cd27d1f9fa76 Mon Sep 17 00:00:00 2001 From: Diatrex Date: Fri, 10 Jul 2020 14:21:44 +0300 Subject: [PATCH 1/2] #1756 Category seo --- .../advs-module/src/Http/Controller/advsController.php | 6 +++--- .../base-theme/resources/views/partials/metatags.twig | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/default/visiosoft/advs-module/src/Http/Controller/advsController.php b/addons/default/visiosoft/advs-module/src/Http/Controller/advsController.php index 2a992af33..25cc5db05 100644 --- a/addons/default/visiosoft/advs-module/src/Http/Controller/advsController.php +++ b/addons/default/visiosoft/advs-module/src/Http/Controller/advsController.php @@ -247,10 +247,11 @@ class AdvsController extends PublicController if ($categoryId) { $seo_keywords = $this->category_model->getMeta_keywords($categoryId->id); - $seo_description = $this->category_model->getMeta_description($categoryId->id); + $seo_description = $this->category_model->getMeta_description($categoryId->id) . ' ' . + implode(',', $seo_keywords); $seo_title = $this->category_model->getMeta_title($categoryId->id); - $this->template->set('meta_keywords', implode(',', $seo_keywords)); + $this->template->set('og_description', $seo_description); $this->template->set('meta_description', $seo_description); $this->template->set('meta_title', $seo_title); @@ -299,7 +300,6 @@ class AdvsController extends PublicController } $this->template->set('showTitle', false); $this->template->set('meta_title', $catText); - $this->template->set('meta_description', $catText); } $compact = compact('advs', 'countries', 'mainCats', 'subCats', 'checkboxes', 'request', 'param', diff --git a/addons/default/visiosoft/base-theme/resources/views/partials/metatags.twig b/addons/default/visiosoft/base-theme/resources/views/partials/metatags.twig index c9ac2c227..b7aa909a6 100644 --- a/addons/default/visiosoft/base-theme/resources/views/partials/metatags.twig +++ b/addons/default/visiosoft/base-theme/resources/views/partials/metatags.twig @@ -4,7 +4,7 @@ - + From 3f6b996eae1b3701ac078b3b138d115659a9e369 Mon Sep 17 00:00:00 2001 From: Diatrex <diahshalabi@hotmail.com> Date: Fri, 10 Jul 2020 16:02:44 +0300 Subject: [PATCH 2/2] #1749 [arabam-theme] Rest of pages --- .../advs-module/src/AdvsModulePlugin.php | 6 ++--- .../profile-module/resources/assets/js/ads.js | 6 ++++- .../resources/views/profile/ads.twig | 25 +++++++++---------- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/addons/default/visiosoft/advs-module/src/AdvsModulePlugin.php b/addons/default/visiosoft/advs-module/src/AdvsModulePlugin.php index fc2b76390..b21686d59 100644 --- a/addons/default/visiosoft/advs-module/src/AdvsModulePlugin.php +++ b/addons/default/visiosoft/advs-module/src/AdvsModulePlugin.php @@ -83,10 +83,8 @@ class AdvsModulePlugin extends Plugin } $advModel = new AdvModel(); - return $advModel->newQuery() - ->where('advs_advs.created_by_id', $user->id) - ->where('status', 'passive') - ->get(); + + return $advModel->pendingAdvsByUser()->get(); } ), new \Twig_SimpleFunction( diff --git a/addons/default/visiosoft/profile-module/resources/assets/js/ads.js b/addons/default/visiosoft/profile-module/resources/assets/js/ads.js index 7b876d1fa..bf7f6a1db 100644 --- a/addons/default/visiosoft/profile-module/resources/assets/js/ads.js +++ b/addons/default/visiosoft/profile-module/resources/assets/js/ads.js @@ -94,7 +94,11 @@ $('.profile-advs-tab a').on('click', function () { getMyAdvs($(this).attr('data-type')) }); -getMyAdvs('approved'); +const urlString = window.location.href; +const url = new URL(urlString); +let type = url.searchParams.get("type"); +type = type ? type : 'approved'; +getMyAdvs(type); function addAdsRow(id, href, image, name, price, city, country, cat1, cat2, status) { diff --git a/addons/default/visiosoft/profile-module/resources/views/profile/ads.twig b/addons/default/visiosoft/profile-module/resources/views/profile/ads.twig index ce59720df..3e5124d15 100644 --- a/addons/default/visiosoft/profile-module/resources/views/profile/ads.twig +++ b/addons/default/visiosoft/profile-module/resources/views/profile/ads.twig @@ -11,22 +11,21 @@ <div class="col-md-12 bg-light advs-section"> <nav class="profile-advs-tab"> <div class="nav nav-tabs nav-fill" id="nav-tab" role="tablist"> - <a class="nav-item nav-link active text-dark" data-type="approved" id="nav-approved-tab" - data-toggle="tab" - href="#nav-approved" + {% set type = app.request.get('type') ?: 'approved' %} + <a class="nav-item nav-link text-dark{{ type == 'approved' ? ' active' : '' }}" + data-type="approved" id="nav-approved-tab" data-toggle="tab" href="#nav-approved" role="tab" aria-controls="nav-detail" aria-selected="true"> {{ trans('visiosoft.module.advs::field.my_ads.name') }} </a> - <a class="nav-item nav-link text-dark" data-type="pending" id="nav-pending-tab" - data-toggle="tab" - href="#nav-pending" + <a class="nav-item nav-link text-dark{{ type == 'pending' ? ' active' : '' }}" + data-type="pending" id="nav-pending-tab" data-toggle="tab" href="#nav-pending" role="tab" aria-controls="nav-pending" aria-selected="true"> {{ trans('visiosoft.module.advs::field.pending_adv.name') }} </a> </div> </nav> <div class="bg-dark p-2 mt-2 rounded"> - <a href="/advs/create_adv" class="btn btn-success"> + <a href="{{ url_route('advs::create_adv') }}" class="btn btn-success"> <i class="fas fa-plus-circle"></i> {{ trans("visiosoft.theme.base::button.post_ad.name") }} </a> @@ -35,14 +34,14 @@ </a> </div> <div class="tab-content py-3 px-3 px-sm-0" id="nav-tabContent"> - <div class="tab-pane fade show active" id="nav-approved" role="tabpanel" - aria-labelledby="nav-approved-tab"> + <div class="tab-pane fade{{ type == 'approved' ? ' show active' : '' }}" id="nav-approved" + role="tabpanel" aria-labelledby="nav-approved-tab"> </div> - <div class="tab-pane fade show" id="nav-pending" role="tabpanel" - aria-labelledby="nav-pending-tab"> + <div class="tab-pane fade{{ type == 'pending' ? ' show active' : '' }}" id="nav-pending" + role="tabpanel" aria-labelledby="nav-pending-tab"> </div> - <div class="tab-pane fade show" id="nav-passive" role="tabpanel" - aria-labelledby="nav-passive-tab"> + <div class="tab-pane fade" id="nav-passive" + role="tabpanel" aria-labelledby="nav-passive-tab"> </div> <!-- Pagination links -->