From a4e3f716d94df45deca87125ba0e37bc7493b80a Mon Sep 17 00:00:00 2001 From: vedatakd Date: Mon, 6 Jan 2020 14:22:19 +0300 Subject: [PATCH] add catalog mode && fixed country filter problem --- .../resources/views/ad-detail/detail.twig | 29 ++++---- .../src/Http/Controller/advsController.php | 15 +--- .../resources/config/settings/sections.php | 16 +++++ .../resources/config/settings/settings.php | 53 ++++++++++++++ .../base-theme/resources/lang/en/field.php | 9 +++ .../base-theme/resources/lang/en/section.php | 7 ++ .../base-theme/resources/lang/en/setting.php | 31 ++++++++ .../base-theme/resources/lang/tr/section.php | 7 ++ .../resources/views/index/default.twig | 51 +++++++------ .../resources/views/partials/navigation.twig | 71 +++++++++++-------- 10 files changed, 208 insertions(+), 81 deletions(-) create mode 100644 addons/default/visiosoft/base-theme/resources/config/settings/sections.php create mode 100644 addons/default/visiosoft/base-theme/resources/config/settings/settings.php create mode 100644 addons/default/visiosoft/base-theme/resources/lang/en/section.php create mode 100644 addons/default/visiosoft/base-theme/resources/lang/en/setting.php create mode 100644 addons/default/visiosoft/base-theme/resources/lang/tr/section.php diff --git a/addons/default/visiosoft/advs-module/resources/views/ad-detail/detail.twig b/addons/default/visiosoft/advs-module/resources/views/ad-detail/detail.twig index b3e8195a8..386c2731a 100644 --- a/addons/default/visiosoft/advs-module/resources/views/ad-detail/detail.twig +++ b/addons/default/visiosoft/advs-module/resources/views/ad-detail/detail.twig @@ -18,10 +18,11 @@ {% include "visiosoft.module.advs::ad-detail/partials/author-button" %} - - {% include "visiosoft.module.advs::ad-detail/partials/breadcrumb" %} - - + {% if setting_value('visiosoft.theme.base::breadcrumbs') %} + + {% include "visiosoft.module.advs::ad-detail/partials/breadcrumb" %} + + {% endif %}

{{ adv.title }} {{ addBlock('ad-detail/title/action',{'adv_id':adv.id})|raw }} @@ -32,23 +33,25 @@
{% include "visiosoft.module.advs::ad-detail/partials/slider" %} -
- {% include "visiosoft.module.advs::ad-detail/partials/detail" %} + {% if setting_value('visiosoft.theme.base::ad_details') %} + {% include "visiosoft.module.advs::ad-detail/partials/detail" %} + {% endif %}
+ {% if setting_value('visiosoft.theme.base::ad_details_tab') %} - {% if blocks('ad-item-content-block-area') is null %} - {% include "visiosoft.module.advs::ad-detail/partials/content" %} - {% else %} - {{ blocks('ad-item-content-block-area') }} + {% if blocks('ad-item-content-block-area') is null %} + {% include "visiosoft.module.advs::ad-detail/partials/content" %} + {% else %} + {{ blocks('ad-item-content-block-area') }} + {% endif %} + + {{ addBlock('ad-detail/widget', {'price': adv.price, 'id': adv.id})|raw }} {% endif %} - - {{ addBlock('ad-detail/widget', {'price': adv.price, 'id': adv.id})|raw }} - 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 d515ed4d6..5aedb1d6f 100644 --- a/addons/default/visiosoft/advs-module/src/Http/Controller/advsController.php +++ b/addons/default/visiosoft/advs-module/src/Http/Controller/advsController.php @@ -146,27 +146,14 @@ class AdvsController extends PublicController $subCats = array(); $param = $this->requestHttp->toArray(); - if (!isset($param['country'])) { - if (is_null(Cookie::get('country'))) { - $param['country'] = setting_value('visiosoft.module.advs::default_country'); - } else { - $param['country'] = Cookie::get('country'); - } - } else { - if ($param['country'] != setting_value('visiosoft.module.advs::default_country')) { - Cookie::queue(Cookie::make('country', $param['country'], 84000)); - } - } - $searchedCountry = $param['country']; + $countries = $this->country_repository->viewAll(); $isActiveDopings = $this->adv_model->is_enabled('dopings'); $isActiveCustomFields = $this->adv_model->is_enabled('customfields'); - $advs = $this->adv_repository->searchAdvs('list', $param, $customParameters); - $advs = $this->adv_repository->addAttributes($advs); diff --git a/addons/default/visiosoft/base-theme/resources/config/settings/sections.php b/addons/default/visiosoft/base-theme/resources/config/settings/sections.php new file mode 100644 index 000000000..3b5b4426e --- /dev/null +++ b/addons/default/visiosoft/base-theme/resources/config/settings/sections.php @@ -0,0 +1,16 @@ + [ + 'stacked' => false, + 'tabs' => [ + 'catalog_mode' => [ + 'title' => 'visiosoft.theme.base::section.catalog_mode.name', + 'fields' => [ + 'navigation_title', 'navigation_action', 'date_fields', 'price_fields', + 'breadcrumbs', 'ad_details', 'ad_details_tab','latest_and_view_all_btn' + ], + ], + ], + ], +]; diff --git a/addons/default/visiosoft/base-theme/resources/config/settings/settings.php b/addons/default/visiosoft/base-theme/resources/config/settings/settings.php new file mode 100644 index 000000000..bd25805ef --- /dev/null +++ b/addons/default/visiosoft/base-theme/resources/config/settings/settings.php @@ -0,0 +1,53 @@ + [ + 'type' => 'anomaly.field_type.boolean', + "config" => [ + "default_value" => 1, + ] + ], + 'navigation_action' => [ + 'type' => 'anomaly.field_type.boolean', + "config" => [ + "default_value" => 1, + ] + ], + 'date_fields' => [ + 'type' => 'anomaly.field_type.boolean', + "config" => [ + "default_value" => 1, + ] + ], + 'price_fields' => [ + 'type' => 'anomaly.field_type.boolean', + "config" => [ + "default_value" => 1, + ] + ], + 'breadcrumbs' => [ + 'type' => 'anomaly.field_type.boolean', + "config" => [ + "default_value" => 1, + ] + ], + 'ad_details' => [ + 'type' => 'anomaly.field_type.boolean', + "config" => [ + "default_value" => 1, + ] + ], + 'ad_details_tab' => [ + 'type' => 'anomaly.field_type.boolean', + "config" => [ + "default_value" => 1, + ] + ], + 'latest_and_view_all_btn' => [ + 'type' => 'anomaly.field_type.boolean', + "config" => [ + "default_value" => 1, + ] + ], + +]; \ No newline at end of file diff --git a/addons/default/visiosoft/base-theme/resources/lang/en/field.php b/addons/default/visiosoft/base-theme/resources/lang/en/field.php index 5a0c813f2..35a74c2d8 100644 --- a/addons/default/visiosoft/base-theme/resources/lang/en/field.php +++ b/addons/default/visiosoft/base-theme/resources/lang/en/field.php @@ -7,4 +7,13 @@ return [ 'show_all' => [ 'name' => 'Show All', ], + 'login' => [ + 'name' => 'Login', + ], + 'logout' => [ + 'name' => 'Logout', + ], + 'profile' => [ + 'name' => 'Profile', + ], ]; \ No newline at end of file diff --git a/addons/default/visiosoft/base-theme/resources/lang/en/section.php b/addons/default/visiosoft/base-theme/resources/lang/en/section.php new file mode 100644 index 000000000..3809465b4 --- /dev/null +++ b/addons/default/visiosoft/base-theme/resources/lang/en/section.php @@ -0,0 +1,7 @@ + [ + 'name' => 'Catalog Mode', + ], +]; \ No newline at end of file diff --git a/addons/default/visiosoft/base-theme/resources/lang/en/setting.php b/addons/default/visiosoft/base-theme/resources/lang/en/setting.php new file mode 100644 index 000000000..076539921 --- /dev/null +++ b/addons/default/visiosoft/base-theme/resources/lang/en/setting.php @@ -0,0 +1,31 @@ + [ + 'name' => 'Navigation Title', + ], + 'navigation_action' => [ + 'name' => 'Navigation Action', + ], + 'country_fields' => [ + 'name' => 'Country Fields', + ], + 'date_fields' => [ + 'name' => 'Date Fields', + ], + 'price_fields' => [ + 'name' => 'Price Fields', + ], + 'breadcrumbs' => [ + 'name' => 'Breadcrumb', + ], + 'ad_details' => [ + 'name' => 'Ad Details', + ], + 'ad_details_tab' => [ + 'name' => 'Ad Details Tab', + ], + 'latest_and_view_all_btn' => [ + 'name' => 'Latest and View All Btn', + ], +]; \ No newline at end of file diff --git a/addons/default/visiosoft/base-theme/resources/lang/tr/section.php b/addons/default/visiosoft/base-theme/resources/lang/tr/section.php new file mode 100644 index 000000000..11d971818 --- /dev/null +++ b/addons/default/visiosoft/base-theme/resources/lang/tr/section.php @@ -0,0 +1,7 @@ + [ + 'name' => 'Katalog Modu', + ], +]; \ No newline at end of file diff --git a/addons/default/visiosoft/base-theme/resources/views/index/default.twig b/addons/default/visiosoft/base-theme/resources/views/index/default.twig index 316e5601a..a54dda9fc 100644 --- a/addons/default/visiosoft/base-theme/resources/views/index/default.twig +++ b/addons/default/visiosoft/base-theme/resources/views/index/default.twig @@ -1,13 +1,14 @@
-
-

{{ trans('theme::field.latest_ads.name') }}

-
- - + {% if setting_value('visiosoft.theme.base::latest_and_view_all_btn') %} +
+

{{ trans('theme::field.latest_ads.name') }}

+
+ + {% endif %}
@@ -25,28 +26,32 @@
-
- {{ latestAd.price }} {{ latestAd.currency }} -
+ {% if setting_value('visiosoft.theme.base::price_fields') %} +
+ {{ latestAd.price }} {{ latestAd.currency }} +
+ {% endif %} {% if setting_value('visiosoft.module.location::home_page_location') %} -
- - - {{ latestAd.city_name }}, {{ latestAd.country_name }} - -
+
+ + + {{ latestAd.city_name }}, {{ latestAd.country_name }} + +
+ {% endif %} + {% if setting_value('visiosoft.theme.base::date_fields') %} +
+ + + {{ latestAd.created_at|date('d/m/Y') }} + +
{% endif %} -
- - - {{ latestAd.created_at|date('d/m/Y') }} - -
diff --git a/addons/default/visiosoft/base-theme/resources/views/partials/navigation.twig b/addons/default/visiosoft/base-theme/resources/views/partials/navigation.twig index 5830c8edd..3a00492ec 100644 --- a/addons/default/visiosoft/base-theme/resources/views/partials/navigation.twig +++ b/addons/default/visiosoft/base-theme/resources/views/partials/navigation.twig @@ -1,6 +1,9 @@ \ No newline at end of file