mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
Merge pull request #723 from openclassify/dia
#2329 Duplicate pages without canonical
This commit is contained in:
commit
3ae34d54d4
@ -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;
|
||||
}
|
||||
|
||||
@ -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()
|
||||
}
|
||||
});
|
||||
@ -1,7 +1,7 @@
|
||||
<div class="slider-text">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 offered-field offered-row">
|
||||
{% set standardPrice = adv.standard_price.value %}
|
||||
{% if standardPrice %}
|
||||
{% if standardPrice and standardPrice > 0 %}
|
||||
<div class="d-flex flex-wrap align-items-center">
|
||||
<h3 class="ad-price-standard mr-3 text-truncate">
|
||||
<b>{{ adv.standard_price.currency(null,'currency') }}</b>
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -44,4 +44,6 @@ interface AdvRepositoryInterface extends EntryRepositoryInterface
|
||||
public function getByUsersIDs($usersIDs);
|
||||
|
||||
public function getPopular();
|
||||
|
||||
public function approveAds($adsIDs);
|
||||
}
|
||||
|
||||
@ -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', "<link rel='canonical' href='$canonUrl'/>");
|
||||
}
|
||||
|
||||
$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 */
|
||||
|
||||
@ -9,6 +9,9 @@
|
||||
{{ setting_value('visiosoft.module.advs::google_statistic_code')|raw }}
|
||||
<!-- Meta Tags -->
|
||||
|
||||
{% set additionalMeta = template.get('additional_meta') %}
|
||||
{{ additionalMeta ? additionalMeta|raw }}
|
||||
|
||||
<title>
|
||||
{% set title = trans(template.meta_title) %}
|
||||
{% set showTitle = template.showTitle is same as(false) ? false : true %}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user