diff --git a/addons/default/visiosoft/advs-module/resources/css/list.css b/addons/default/visiosoft/advs-module/resources/css/list.css index cc6bb4d82..cc9d284f0 100644 --- a/addons/default/visiosoft/advs-module/resources/css/list.css +++ b/addons/default/visiosoft/advs-module/resources/css/list.css @@ -200,6 +200,10 @@ a.sort-by-open-dropdown:hover { color: #8598AA; } +.list-view-type button { + background-color: unset; +} + .list-view-type button:focus { outline: none; } diff --git a/addons/default/visiosoft/advs-module/resources/js/settings.js b/addons/default/visiosoft/advs-module/resources/js/settings.js index 119d656dd..14817b7b4 100644 --- a/addons/default/visiosoft/advs-module/resources/js/settings.js +++ b/addons/default/visiosoft/advs-module/resources/js/settings.js @@ -1,13 +1,21 @@ // Hide watermark_image by default -$(".watermark_image").hide(); +const watermarkType = $("select[name='watermark_type']") +const watermarkText = $(".watermark_text") +const watermarkImage = $(".watermark_image") -$("select[name='watermark_type']").change((event) => { - let watermarkType = event.target.value; - if (watermarkType === 'text') { - $(".watermark_image").hide(); - $(".watermark_text").show() +if (watermarkType.val() === 'text') { + watermarkImage.hide(); +} else { + watermarkText.hide(); +} + +$(watermarkType).change((event) => { + const watermarkTypeValue = event.target.value; + if (watermarkTypeValue === 'text') { + watermarkImage.hide(); + watermarkText.show() } else if (event.target.value === 'image') { - $(".watermark_image").show(); - $(".watermark_text").hide() + watermarkImage.show(); + watermarkText.hide() } }); \ No newline at end of file diff --git a/addons/default/visiosoft/advs-module/resources/views/ad-detail/partials/detail.twig b/addons/default/visiosoft/advs-module/resources/views/ad-detail/partials/detail.twig index efd963ad9..80f58bf24 100644 --- a/addons/default/visiosoft/advs-module/resources/views/ad-detail/partials/detail.twig +++ b/addons/default/visiosoft/advs-module/resources/views/ad-detail/partials/detail.twig @@ -1,7 +1,7 @@
{% set standardPrice = adv.standard_price.value %} - {% if standardPrice %} + {% if standardPrice and standardPrice > 0 %}

{{ adv.standard_price.currency(null,'currency') }} diff --git a/addons/default/visiosoft/advs-module/src/Adv/AdvRepository.php b/addons/default/visiosoft/advs-module/src/Adv/AdvRepository.php index e39e5580a..a843841bd 100644 --- a/addons/default/visiosoft/advs-module/src/Adv/AdvRepository.php +++ b/addons/default/visiosoft/advs-module/src/Adv/AdvRepository.php @@ -447,4 +447,16 @@ class AdvRepository extends EntryRepository implements AdvRepositoryInterface ->orderBy('count_show_ad', 'desc') ->paginate(setting_value('visiosoft.module.advs::popular_ads_limit', setting_value('streams::per_page'))); } + + public function approveAds($adsIDs) + { + $defaultAdPublishTime = setting_value('visiosoft.module.advs::default_published_time'); + $ads = $this->newQuery()->where('advs_advs.id', $adsIDs)->update([ + 'status' => 'approved', + 'finish_at' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . ' + ' . $defaultAdPublishTime . ' day')), + 'publish_at' => date('Y-m-d H:i:s') + ]); + + return $ads; + } } diff --git a/addons/default/visiosoft/advs-module/src/Adv/Contract/AdvRepositoryInterface.php b/addons/default/visiosoft/advs-module/src/Adv/Contract/AdvRepositoryInterface.php index 4118d90a4..eb59f6eb2 100644 --- a/addons/default/visiosoft/advs-module/src/Adv/Contract/AdvRepositoryInterface.php +++ b/addons/default/visiosoft/advs-module/src/Adv/Contract/AdvRepositoryInterface.php @@ -44,4 +44,6 @@ interface AdvRepositoryInterface extends EntryRepositoryInterface public function getByUsersIDs($usersIDs); public function getPopular(); + + public function approveAds($adsIDs); } 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 bea56a763..969f80a16 100644 --- a/addons/default/visiosoft/advs-module/src/Http/Controller/advsController.php +++ b/addons/default/visiosoft/advs-module/src/Http/Controller/advsController.php @@ -398,6 +398,14 @@ class AdvsController extends PublicController $this->template->set('meta_title', $user->name() . ' ' . trans('visiosoft.module.advs::field.ads')); } + // Set rel="canonical" + if (array_key_exists('sort_by', $param) || array_key_exists('doping', $param)) { + $canonParam = $param; + unset($canonParam['sort_by'], $canonParam['doping']); + $canonUrl = fullLink($canonParam, \request()->url()); + $this->template->set('additional_meta', ""); + } + $compact = compact('advs', 'countries', 'mainCats', 'subCats', 'checkboxes', 'param', 'user', 'featured_advs', 'viewType', 'topfields', 'selectDropdown', 'selectRange', 'selectImage', 'ranges', 'seenList', 'radio', 'categoryId', 'cityId', 'allCats', 'catText', 'cFArray'); @@ -500,7 +508,14 @@ class AdvsController extends PublicController $coverPhoto = \Illuminate\Support\Facades\Request::root() . '/' . $adv->cover_photo; } } - $this->template->set('meta_image', $coverPhoto); + $coverPhotoInfo = pathinfo($coverPhoto); + if (substr($coverPhotoInfo['basename'], 0, 3) === "tn-") { + $ogImage = substr(basename($coverPhotoInfo['basename']), 3); + $ogImage = $coverPhotoInfo['dirname'] . "/$ogImage"; + } else { + $ogImage = $coverPhoto; + } + $this->template->set('meta_image', $ogImage); if ($adv->created_by_id == isset(auth()->user()->id) or $adv->status == "approved") { return $this->view->make('visiosoft.module.advs::ad-detail/detail', compact('adv', 'complaints', @@ -659,10 +674,15 @@ class AdvsController extends PublicController /* Update Adv */ $adv = AdvsAdvsEntryModel::find($request->update_id); + $allowPendingAdCreation = false; if ($advModel->is_enabled('packages') and $adv->slug == "") { $cat = app('Visiosoft\PackagesModule\Http\Controller\PackageFEController')->AdLimitForNewAd($request); if (!is_null($cat)) { - return redirect('/'); + if (is_array($cat) && array_key_exists('allowPendingAds', $cat)) { + $allowPendingAdCreation = $cat['allowPendingAds']; + } else { + return redirect('/'); + } } } @@ -717,7 +737,7 @@ class AdvsController extends PublicController } // Auto approve - if (setting_value('visiosoft.module.advs::auto_approve')) { + if (setting_value('visiosoft.module.advs::auto_approve') && !$allowPendingAdCreation) { $defaultAdPublishTime = setting_value('visiosoft.module.advs::default_published_time'); $adv->update([ 'status' => 'approved', @@ -762,7 +782,11 @@ class AdvsController extends PublicController return redirect('/advs/edit_advs/' . $request->update_id)->with('cats_d', $cats_d)->with('request', $request); } event(new CreatedAd($adv)); - return redirect(route('advs_preview', [$request->update_id])); + if ($allowPendingAdCreation) { + return redirect(route("visiosoft.module.packages::buy_package") . '?ad_id=' . $adv->id); + } else { + return redirect(route('advs_preview', [$request->update_id])); + } } /* New Create Adv */ 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 e7ab06471..017843463 100644 --- a/addons/default/visiosoft/base-theme/resources/views/partials/metatags.twig +++ b/addons/default/visiosoft/base-theme/resources/views/partials/metatags.twig @@ -9,6 +9,9 @@ {{ setting_value('visiosoft.module.advs::google_statistic_code')|raw }} +{% set additionalMeta = template.get('additional_meta') %} +{{ additionalMeta ? additionalMeta|raw }} + {% set title = trans(template.meta_title) %} {% set showTitle = template.showTitle is same as(false) ? false : true %}