This commit is contained in:
Diatrex 2020-08-20 16:13:56 +03:00
commit 687dd4cd75
19 changed files with 454 additions and 264 deletions

View File

@ -43,6 +43,12 @@ return [
'register_email_field', 'register_email_field',
], ],
], ],
'filter' => [
'title' => 'visiosoft.module.advs::section.filter',
'fields' => [
'hide_price_filter','hide_date_filter','hide_photo_filter','hide_map_filter'
],
],
], ],
], ],
]; ];

View File

@ -201,4 +201,31 @@ return [
'default_value' => true, 'default_value' => true,
], ],
], ],
'hide_price_filter' => [
'type' => 'anomaly.field_type.boolean',
'config' => [
'default_value' => false,
]
],
'hide_date_filter' => [
'type' => 'anomaly.field_type.boolean',
'config' => [
'default_value' => false,
]
],
'hide_photo_filter' => [
'type' => 'anomaly.field_type.boolean',
'config' => [
'default_value' => false,
]
],
'hide_map_filter' => [
'type' => 'anomaly.field_type.boolean',
'config' => [
'default_value' => false,
]
],
]; ];

View File

@ -40,13 +40,6 @@ $('.sort-by-item').on('click', function () {
window.location.replace(goURL); window.location.replace(goURL);
}); });
$('.ad-info-right-bar-video').on('click', function () {
$(".video-ad-tooltip-" + $(this).attr('data-id'))[0].play();
$(".video-ad-tooltip-" + $(this).attr('data-id'))[0].controls = false;
});
$(document).ready(function () { $(document).ready(function () {
let searchParams = new URLSearchParams(window.location.search); let searchParams = new URLSearchParams(window.location.search);
@ -167,12 +160,6 @@ $(document).ready(function () {
}); });
}); });
$('.ad-info-right-bar-video').tooltip({
animated: 'fade',
placement: 'bottom',
html: true
});
$("#listFilterForm").submit(function(e) { $("#listFilterForm").submit(function(e) {
const inputs = $('#listFilterForm :input'); const inputs = $('#listFilterForm :input');
[...inputs].forEach((input) => { [...inputs].forEach((input) => {

View File

@ -40,6 +40,7 @@ return [
'general' => 'General', 'general' => 'General',
'ads' => 'Ads', 'ads' => 'Ads',
'user' => 'User', 'user' => 'User',
'filter' => 'Filter',
'options' => [ 'options' => [
'title' => 'Options', 'title' => 'Options',
], ],

View File

@ -133,4 +133,17 @@ return [
'market_place' => [ 'market_place' => [
'name' => 'Market Place', 'name' => 'Market Place',
], ],
'hide_price_filter' => [
'name' => 'Hide Price Filter',
],
'hide_date_filter' => [
'name' => 'Hide Date Filter',
],
'hide_photo_filter' => [
'name' => 'Hide Photo Filter',
],
'hide_map_filter' => [
'name' => 'Hide Map Filter',
],
]; ];

View File

@ -1,191 +1,202 @@
{% set formHtml %} {% set formHtml %}
<form action="{{ url_route('visiosoft.module.advs::list') }}" method="get" id="listFilterForm"> <form action="{{ url_route('visiosoft.module.advs::list') }}" method="get" id="listFilterForm">
{% endset %}
{% set catSlug = null %}
{% set citySlug = null %}
{% set pathInfo = app.request.pathinfo|split('/') %}
{% if pathInfo[1] == 'c' %}
{% set catSlug = pathInfo[2] %}
{% endif %}
{% if pathInfo|length is same as(4) %}
{% set citySlug = pathInfo[3] %}
{% endif %}
{% if catSlug %}
{% set formHtml %}
<form action="{{ url_route('adv_list_seo', [catSlug, citySlug]) }}" method="get" id="listFilterForm">
{% endset %} {% endset %}
{% endif %} {% set catSlug = null %}
{{ formHtml }} {% set citySlug = null %}
<div class="row"> {% set pathInfo = app.request.pathinfo|split('/') %}
<input type="hidden" name="cat" value="{{ app.request.get('cat') }}"> {% if pathInfo[1] == 'c' %}
<input type="hidden" name="user" value="{{ app.request.get('user') }}"> {% set catSlug = pathInfo[2] %}
<div class="col-md-12 px-4"> {% endif %}
<div class="row"> {% if pathInfo|length is same as(4) %}
<div id="filter" class="w-100 mb-3"> {% set citySlug = pathInfo[3] %}
{% endif %}
{% if catSlug %}
{% set formHtml %}
<form action="{{ url_route('adv_list_seo', [catSlug, citySlug]) }}" method="get" id="listFilterForm">
{% endset %}
{% endif %}
{{ formHtml }}
<div class="row">
<input type="hidden" name="cat" value="{{ app.request.get('cat') }}">
<input type="hidden" name="user" value="{{ app.request.get('user') }}">
<div class="col-md-12 px-4">
<div class="row">
<div id="filter" class="w-100 mb-3">
{{ addBlock('ads-list/partials/list-filter',{ {{ addBlock('ads-list/partials/list-filter',{
'mainCats':mainCats, 'mainCats':mainCats,
'subCats':subCats, 'subCats':subCats,
'ranges':ranges, 'ranges':ranges,
'checkboxes':checkboxes, 'checkboxes':checkboxes,
'topfields' : topfields, 'topfields' : topfields,
'selectDropdown' : selectDropdown, 'selectDropdown' : selectDropdown,
'selectRange' : selectRange, 'selectRange' : selectRange,
'selectImage' : selectImage, 'selectImage' : selectImage,
'radio':radio, 'radio':radio,
'countries':countries, 'countries':countries,
'cities':cities, 'cities':cities,
'districts':districts, 'districts':districts,
'neighborhoods':neighborhoods, 'neighborhoods':neighborhoods,
'villages':villages, 'villages':villages,
'param':param, 'param':param,
'categoryId':categoryId, 'categoryId':categoryId,
'cityId':cityId, 'cityId':cityId,
'_ORDER_':['visiosoft.module.cats', 'visiosoft.module.location'] '_ORDER_':['visiosoft.module.cats', 'visiosoft.module.location']
})|raw }} })|raw }}
<!-- Price Filter Start --> <!-- Price Filter Start -->
{% include 'visiosoft.module.advs::list/partials/price-filter' %} {% include 'visiosoft.module.advs::list/partials/price-filter' %}
<!-- Price Filter End --> <!-- Price Filter End -->
<!-- Date Filter Start --> {% if setting_value('visiosoft.module.advs::hide_date_filter') == false %}
<div class="card mb-3"> <!-- Date Filter Start -->
<div class="card-header breadcrumb mb-0" id="dateHeading"> <div class="card mb-3">
<h5 class="mb-0"> <div class="card-header breadcrumb mb-0" id="dateHeading">
<button class="btn btn-link text-dark d-flex align-items-center" data-toggle="collapse" data-target="#date" <h5 class="mb-0">
aria-expanded="true" aria-controls="date"> <button class="btn btn-link text-dark d-flex align-items-center"
<img src="{{ img('visiosoft.module.advs::images/date-icon.svg').url }}" class="mr-2" data-toggle="collapse" data-target="#dateContainer"
alt="date icon"> aria-expanded="true" aria-controls="dateContainer">
<span>{{ trans("visiosoft.module.advs::field.date.name") }}</span> <img src="{{ img('visiosoft.module.advs::images/date-icon.svg').url }}"
</button> class="mr-2"
</h5> alt="date icon">
</div> <span>{{ trans("visiosoft.module.advs::field.date.name") }}</span>
<div id="dateContainer" class="collapse show overflow-auto" aria-labelledby="dateHeading" </button>
style="max-height: 300px;"> </h5>
<div class="d-flex flex-column p-3 m-0">
<div class="form-check py-1">
<input class="form-check-input"
{% if app.request.get('date') == 'day' %}
checked
{% endif %}
type="radio" name="date" id="dateDay"
value="day">
<label class="form-check-label" for="dateDay">
{{ trans("visiosoft.module.advs::field.in_the_last_24_hours.name") }}
</label>
</div> </div>
<div class="form-check py-1"> <div id="dateContainer" class="collapse show overflow-auto"
<input class="form-check-input" aria-labelledby="dateHeading"
{% if app.request.get('date') == 'week' %} style="max-height: 300px;">
checked <div class="d-flex flex-column p-3 m-0">
{% endif %} <div class="form-check py-1">
type="radio" name="date" id="dateWeek" <input class="form-check-input"
value="week"> {% if app.request.get('date') == 'day' %}
<label class="form-check-label" for="dateWeek"> checked
{{ trans("visiosoft.module.advs::field.in_the_last_week.name") }} {% endif %}
</label> type="radio" name="date" id="dateDay"
</div> value="day">
<div class="form-check py-1"> <label class="form-check-label" for="dateDay">
<input class="form-check-input" {{ trans("visiosoft.module.advs::field.in_the_last_24_hours.name") }}
{% if app.request.get('date') == 'month' %} </label>
checked </div>
{% endif %} <div class="form-check py-1">
type="radio" name="date" id="dateMonth" <input class="form-check-input"
value="month"> {% if app.request.get('date') == 'week' %}
<label class="form-check-label" for="dateMonth"> checked
{{ trans("visiosoft.module.advs::field.in_the_last_month.name") }} {% endif %}
</label> type="radio" name="date" id="dateWeek"
value="week">
<label class="form-check-label" for="dateWeek">
{{ trans("visiosoft.module.advs::field.in_the_last_week.name") }}
</label>
</div>
<div class="form-check py-1">
<input class="form-check-input"
{% if app.request.get('date') == 'month' %}
checked
{% endif %}
type="radio" name="date" id="dateMonth"
value="month">
<label class="form-check-label" for="dateMonth">
{{ trans("visiosoft.module.advs::field.in_the_last_month.name") }}
</label>
</div>
</div>
</div> </div>
</div> </div>
</div> <!-- Date Filter End -->
</div> {% endif %}
<!-- Date Filter End -->
<!-- Media Filter Start --> {% if setting_value('visiosoft.module.advs::hide_photo_filter') == false %}
<div class="card mb-3"> <!-- Media Filter Start -->
<div class="card-header breadcrumb mb-0" id="mediaHeading"> <div class="card mb-3">
<h5 class="mb-0"> <div class="card-header breadcrumb mb-0" id="mediaHeading">
<button class="btn btn-link text-dark" data-toggle="collapse" data-target="#media" <h5 class="mb-0">
aria-expanded="true" aria-controls="media"> <button class="btn btn-link text-dark" data-toggle="collapse"
<i class="fa fa-camera"></i> data-target="#mediaContainer"
{{ trans("visiosoft.module.advs::field.photo.name") }} aria-expanded="true" aria-controls="mediaContainer">
, {{ trans("visiosoft.module.advs::field.video.name") }} <i class="fa fa-camera"></i>
</button> {{ trans("visiosoft.module.advs::field.photo.name") }}
</h5> , {{ trans("visiosoft.module.advs::field.video.name") }}
</div> </button>
<div id="mediaContainer" class="collapse show overflow-auto" aria-labelledby="mediaHeading" </h5>
style="max-height: 300px;">
<div class="d-flex p-3 m-0 flex-column">
<div class="form-check py-1">
<input class="form-check-input" type="checkbox"
{% if app.request.get('photo') == true %}
checked
{% endif %}
value="true" name="photo"
id="photo">
<label class="form-check-label" for="photo">
{{ trans("visiosoft.module.advs::field.ads_with_photo.name") }}
</label>
</div> </div>
<div class="form-check py-1"> <div id="mediaContainer" class="collapse show overflow-auto"
<input class="form-check-input" type="checkbox" aria-labelledby="mediaHeading"
{% if app.request.get('video') == true %} style="max-height: 300px;">
checked <div class="d-flex p-3 m-0 flex-column">
{% endif %} <div class="form-check py-1">
value="true" name="video" <input class="form-check-input" type="checkbox"
id="video"> {% if app.request.get('photo') == true %}
<label class="form-check-label" for="video"> checked
{{ trans("visiosoft.module.advs::field.ads_with_video.name") }} {% endif %}
</label> value="true" name="photo"
id="photo">
<label class="form-check-label" for="photo">
{{ trans("visiosoft.module.advs::field.ads_with_photo.name") }}
</label>
</div>
<div class="form-check py-1">
<input class="form-check-input" type="checkbox"
{% if app.request.get('video') == true %}
checked
{% endif %}
value="true" name="video"
id="video">
<label class="form-check-label" for="video">
{{ trans("visiosoft.module.advs::field.ads_with_video.name") }}
</label>
</div>
</div>
</div> </div>
</div> </div>
</div> <!-- Media Filter End -->
</div> {% endif %}
<!-- Media Filter End -->
<!-- Map Filter Start --> {% if setting_value('visiosoft.module.advs::hide_map_filter') == false %}
<div class="card mb-3"> <!-- Map Filter Start -->
<div class="card-header breadcrumb mb-0" id="mapHeading"> <div class="card mb-3">
<h5 class="mb-0"> <div class="card-header breadcrumb mb-0" id="mapHeading">
<button class="btn btn-link text-dark" data-toggle="collapse" <h5 class="mb-0">
data-target="#mapFilter" <button class="btn btn-link text-dark" data-toggle="collapse"
aria-expanded="true" aria-controls="mapFilter"> data-target="#mapContainer"
<i class="fa fa-map"></i> aria-expanded="true" aria-controls="mapContainer">
{{ trans("visiosoft.module.advs::field.map.name") }} <i class="fa fa-map"></i>
</button> {{ trans("visiosoft.module.advs::field.map.name") }}
</h5> </button>
</div> </h5>
<div id="mapContainer" class="collapse show overflow-auto" aria-labelledby="mapHeading" </div>
style="max-height: 300px;"> <div id="mapContainer" class="collapse show overflow-auto" aria-labelledby="mapHeading"
<div class="row p-3 m-0"> style="max-height: 300px;">
<div class="form-check py-1"> <div class="row p-3 m-0">
<input class="form-check-input" type="checkbox" <div class="form-check py-1">
{% if app.request.get('map') == true %} <input class="form-check-input" type="checkbox"
checked {% if app.request.get('map') == true %}
{% endif %} checked
value="true" name="map" {% endif %}
id="mapFilter"> value="true" name="map"
<label class="form-check-label" for="mapFilter"> id="mapFilter">
{{ trans("visiosoft.module.advs::field.yes.name") }} <label class="form-check-label" for="mapFilter">
</label> {{ trans("visiosoft.module.advs::field.yes.name") }}
</label>
</div>
</div>
</div> </div>
</div> </div>
</div> <!-- Map Filter End -->
</div> {% endif %}
<!-- Map Filter End -->
<div class="card"> <div class="card">
<div class="card-header bg-primary text-center" id="submitHeading"> <div class="card-header bg-primary text-center" id="submitHeading">
<h5 class="mb-0"> <h5 class="mb-0">
<button class="btn btn-link text-white w-100"> <button class="btn btn-link text-white w-100">
<i class="fas fa-search"></i> <i class="fas fa-search"></i>
{{ trans("visiosoft.module.advs::field.search") }} {{ trans("visiosoft.module.advs::field.search") }}
</button> </button>
</h5> </h5>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </form>
</form>

View File

@ -1,41 +1,44 @@
<div class="card mb-3"> {% if setting_value('visiosoft.module.advs::hide_price_filter') == false %}
<div class="card-header breadcrumb mb-0" id="priceHeading"> <div class="card mb-3">
<h5 class="mb-0"> <div class="card-header breadcrumb mb-0" id="priceHeading">
<button class="btn btn-link text-dark d-flex align-items-center" data-toggle="collapse" data-target="#price" <h5 class="mb-0">
aria-expanded="true" aria-controls="price"> <button class="btn btn-link text-dark d-flex align-items-center" data-toggle="collapse"
<img src="{{ img('visiosoft.module.advs::images/price-icon.svg').url }}" alt="price icon" class="mr-2"> data-target="#price"
<span>{{ trans("visiosoft.module.advs::field.price.name") }}</span> aria-expanded="true" aria-controls="price">
</button> <img src="{{ img('visiosoft.module.advs::images/price-icon.svg').url }}" alt="price icon"
</h5> class="mr-2">
</div> <span>{{ trans("visiosoft.module.advs::field.price.name") }}</span>
<div id="price" class="collapse show overflow-auto" aria-labelledby="priceHeading" </button>
data-parent="#filter" </h5>
style="max-height: 300px;"> </div>
<div class="row p-0 m-0"> <div id="price" class="collapse show overflow-auto" aria-labelledby="priceHeading"
{% set active_currencies = setting_value('visiosoft.module.advs::enabled_currencies') %} style="max-height: 300px;">
<div class="col-md-4 p-1 m-0"> <div class="row p-0 m-0">
<input type="number" class="price-input form-control w-100" {% set active_currencies = setting_value('visiosoft.module.advs::enabled_currencies') %}
value="{{ app.request.get('min_price') }}" <div class="col-md-4 p-1 m-0">
name="min_price" min="0" <input type="number" class="price-input form-control w-100"
placeholder="{{ trans('visiosoft.module.advs::field.min.name') }}"> value="{{ app.request.get('min_price') }}"
</div> name="min_price" min="0"
<div class="col-md-4 p-1 pr-0 m-0"> placeholder="{{ trans('visiosoft.module.advs::field.min.name') }}">
<input class="price-input form-control w-100" type="number" </div>
value="{{ app.request.get('max_price') }}" <div class="col-md-4 p-1 pr-0 m-0">
name="max_price" <input class="price-input form-control w-100" type="number"
placeholder="{{ trans('visiosoft.module.advs::field.max.name') }}"> value="{{ app.request.get('max_price') }}"
name="max_price"
placeholder="{{ trans('visiosoft.module.advs::field.max.name') }}">
</div>
<div class="col-md-4 py-1 px-0">
<select name="currency" id="currency" class="form-control">
{% for currency in active_currencies %}
<option {{ app.request.get('currency') == currency ? 'selected' }} value="{{ currency }}">
{{ currency_symbol(currency) }}
</option>
{% endfor %}
</select>
</div>
</div> </div>
<div class="col-md-4 py-1 px-0">
<select name="currency" id="currency" class="form-control">
{% for currency in active_currencies %}
<option {{ app.request.get('currency') == currency ? 'selected' }} value="{{ currency }}">
{{ currency_symbol(currency) }}
</option>
{% endfor %}
</select>
</div>
</div> </div>
</div> </div>
</div> {% endif %}

View File

@ -11,16 +11,18 @@ class appendRequestURL
protected $request; protected $request;
protected $url; protected $url;
protected $new_parameters; protected $new_parameters;
protected $remove_parameters;
/** /**
* appendRequestURL constructor. * appendRequestURL constructor.
* @param $request * @param $request
*/ */
public function __construct($request, $url, $new_parameters = []) public function __construct($request, $url, $new_parameters = [], $remove_parameters = [])
{ {
$this->url = $url; $this->url = $url;
$this->request = $request; $this->request = $request;
$this->new_parameters = $new_parameters; $this->new_parameters = $new_parameters;
$this->remove_parameters = $remove_parameters;
} }
/** /**
@ -28,23 +30,23 @@ class appendRequestURL
*/ */
public function handle() public function handle()
{ {
if (count($this->new_parameters) === 0 && count($this->request) === 0) {
return $this->url; $request = $this->removeParameters($this->request);
} elseif (count($this->new_parameters) > 0 && count($this->request) > 0) { $count_newParameters = count($this->new_parameters);
return $this->url $count_request = count($this->request);
. (Str::contains($this->url, '?') ? '&' : '?')
. Arr::query($this->appends(array_merge($this->request, $this->new_parameters))); if ($count_newParameters > 0) {
} elseif (count($this->new_parameters) > 0 && count($this->request) === 0) { return ($count_request > 0) ? $this->createURL(array_merge($request, $this->new_parameters)) : $this->createURL($this->new_parameters);
return $this->url } else {
. (Str::contains($this->url, '?') ? '&' : '?') return ($count_request > 0) ? $this->createURL($request) : $this->url;
. Arr::query($this->appends($this->new_parameters));
} elseif (count($this->new_parameters) === 0 && count($this->request) > 0) {
return $this->url
. (Str::contains($this->url, '?') ? '&' : '?')
. Arr::query($this->appends($this->request));
} }
} }
public function createURL($append)
{
return $this->url . (Str::contains($this->url, '?') ? '&' : '?') . Arr::query($this->appends($append));
}
/** /**
* @param $key * @param $key
* @param null $value * @param null $value
@ -87,4 +89,13 @@ class appendRequestURL
return $this; return $this;
} }
public function removeParameters(array $array)
{
foreach ($this->remove_parameters as $parameter) {
unset($array[$parameter]);
}
return $array;
}
} }

View File

@ -57,9 +57,9 @@ class AdvsModulePlugin extends Plugin
), ),
new \Twig_SimpleFunction( new \Twig_SimpleFunction(
'appendRequestURL', 'appendRequestURL',
function ($request, $url, $new_parameters) { function ($request, $url, $new_parameters, $removeParams = []) {
return $this->dispatch(new appendRequestURL($request, $url, $new_parameters)); return $this->dispatch(new appendRequestURL($request, $url, $new_parameters, $removeParams));
} }
), ),
new \Twig_SimpleFunction( new \Twig_SimpleFunction(

View File

@ -10,6 +10,7 @@ use Visiosoft\AdvsModule\Adv\AdvRepository;
use Anomaly\Streams\Platform\Model\Advs\AdvsAdvsEntryModel; use Anomaly\Streams\Platform\Model\Advs\AdvsAdvsEntryModel;
use Visiosoft\AdvsModule\Adv\AdvModel; use Visiosoft\AdvsModule\Adv\AdvModel;
use Visiosoft\AdvsModule\Adv\Form\AdvFormBuilder; use Visiosoft\AdvsModule\Adv\Form\AdvFormBuilder;
use Visiosoft\AdvsModule\Http\Middleware\redirectDiffrentLang;
use Visiosoft\AdvsModule\Http\Middleware\SetLang; use Visiosoft\AdvsModule\Http\Middleware\SetLang;
use Visiosoft\AdvsModule\Listener\AddAdvsSettingsScript; use Visiosoft\AdvsModule\Listener\AddAdvsSettingsScript;
use Visiosoft\AdvsModule\Option\Contract\OptionRepositoryInterface; use Visiosoft\AdvsModule\Option\Contract\OptionRepositoryInterface;
@ -237,6 +238,7 @@ class AdvsModuleServiceProvider extends AddonServiceProvider
*/ */
protected $middleware = [ protected $middleware = [
SetLang::class, SetLang::class,
redirectDiffrentLang::class,
]; ];
/** /**

View File

@ -0,0 +1,56 @@
<?php namespace Visiosoft\AdvsModule\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Routing\Redirector;
/**
* Class SetLang
*/
class redirectDiffrentLang
{
/**
* The redirect utility.
*
* @var Redirector
*/
protected $redirect;
/**
* Create a new SetLocale instance.
*
* @param Redirector $redirect
*/
public function __construct(
Redirector $redirect
)
{
$this->redirect = $redirect;
}
public function handle(Request $request, Closure $next)
{
$original_url = $request->server->get('ORIGINAL_REQUEST_URI');
$setting_language = setting_value('streams::default_locale');
$current_language = $request->session()->get('_locale', $setting_language);
$request_url = ltrim($request->getRequestUri(), '/');
// If the segment(1) is admin and language parameters is not null, no forwarding will be made.
if ($request->segment(1) == "admin" and in_array($current_language, explode('/', $original_url))) {
return $this->redirect->to($request->fullUrl());
}
if ($current_language != $setting_language) {
// If the method is get, no forwarding will be made.
// If the segment(1) is admin, no forwarding will be made.
if ($request->method() == "GET" and $request->segment(1) != "admin" and $request_url != "" and $original_url != '/' . $current_language . '/' . $request_url) {
return $this->redirect->to('/' . $current_language . '/' . $request_url);
}
}
return $next($request);
}
}

View File

@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="{{ config('app.locale') }}">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
{% block styles %}{% endblock %}
</head>
<body>
<div class="container" style="max-width: 800px;">
{% include "theme::partials/messages" %}
{% block content %}
{% endblock %}
</div>
</body>
</html>

View File

@ -0,0 +1,37 @@
<!doctype html>
<!--[if lt IE 7]>
<html class="nojs ms lt_ie7" lang="en"><![endif]-->
<!--[if IE 7]>
<html class="nojs ms ie7" lang="en"><![endif]-->
<!--[if IE 8]>
<html class="nojs ms ie8" lang="en"><![endif]-->
<!--[if gt IE 8]>
<html class="nojs ms" lang="en"><![endif]-->
<html>
<head>
{% include "visiosoft.theme.base::partials/metadata" %}
{% block styles %}{% endblock %}
</head>
<body>
{% include "visiosoft.theme.base::partials/header" %}
<main id="main">
<div class="container">
{% include "visiosoft.theme.base::partials/messages" %}
{% block content %}{% endblock %}
</div>
</main>
{% include "visiosoft.theme.base::partials/footer" %}
{% include "visiosoft.theme.base::partials/settings" %}
</body>
</html>

View File

@ -8,8 +8,7 @@
</button> </button>
</h5> </h5>
</div> </div>
<div id="category" class="collapse show overflow-auto" aria-labelledby="categoryHeading" <div id="category" class="collapse show overflow-auto" aria-labelledby="categoryHeading" style="max-height: 300px;">
data-parent="#filter" style="max-height: 300px;">
<div class="list-group"> <div class="list-group">
{% for maincat in params.mainCats %} {% for maincat in params.mainCats %}
{% set name = maincat['val'] %} {% set name = maincat['val'] %}
@ -29,9 +28,9 @@
{% set citySlug = pathInfo[3] %} {% set citySlug = pathInfo[3] %}
{% endif %} {% endif %}
<a href="{% if(viewType != "map") %} <a href="{% if(viewType != "map") %}
{{ appendRequestURL(request_query(),url_route('adv_list_seo', [catId.slug, citySlug]),{}) }} {{ appendRequestURL(request_query(),url_route('adv_list_seo', [catId.slug, citySlug]),{},['page']) }}
{% else %} {% else %}
{{ appendRequestURL(request_query(),url_route('advs_map_list'),{'cat':id}) }} {{ appendRequestURL(request_query(),url_route('advs_map_list'),{'cat':id},['page']) }}
{% endif %}" class="list-group-item list-group-item-action text-truncate"> {% endif %}" class="list-group-item list-group-item-action text-truncate">
<i class="fas fa-dot-circle"></i> <i class="fas fa-dot-circle"></i>
{{ name }} {{ name }}
@ -41,9 +40,9 @@
{% if subcat.parent_category_id == maincat['id'] %} {% if subcat.parent_category_id == maincat['id'] %}
{% set subCatId = entries('cats', 'category').find(subcat.id) %} {% set subCatId = entries('cats', 'category').find(subcat.id) %}
<a href="{% if(viewType != "map") %} <a href="{% if(viewType != "map") %}
{{ appendRequestURL(request_query(),url_route('adv_list_seo', [subCatId.slug, citySlug]),{}) }} {{ appendRequestURL(request_query(),url_route('adv_list_seo', [subCatId.slug, citySlug]),{},['page']) }}
{% else %} {% else %}
{{ appendRequestURL(request_query(),url_route('advs_map_list'),{'cat':subcat.id}) }} {{ appendRequestURL(request_query(),url_route('advs_map_list'),{'cat':subcat.id},['page']) }}
{% endif %}" class="list-group-item list-group-item-action text-truncate"> {% endif %}" class="list-group-item list-group-item-action text-truncate">
{{ subcat.name }} {{ subcat.name }}
</a> </a>

View File

@ -22,6 +22,12 @@ return [
'google_map_key', 'map_coordinates_long', 'map_coordinates_lat' 'google_map_key', 'map_coordinates_long', 'map_coordinates_lat'
], ],
], ],
'filter' => [
'title' => 'visiosoft.module.location::section.filter',
'fields' => [
'hide_location_filter'
],
],
'html' => [ 'html' => [
'html' => '{% include "visiosoft.module.location::settings/field" %}', 'html' => '{% include "visiosoft.module.location::settings/field" %}',
], ],

View File

@ -68,4 +68,11 @@ return [
'default_value' => '40.97817786299617', 'default_value' => '40.97817786299617',
], ],
], ],
'hide_location_filter' => [
'type' => 'anomaly.field_type.boolean',
'config' => [
'default_value' => false,
],
],
]; ];

View File

@ -19,4 +19,5 @@ return [
'general' => 'General', 'general' => 'General',
'map' => 'Map', 'map' => 'Map',
'setting' => 'Setting', 'setting' => 'Setting',
'filter' => 'Filter',
]; ];

View File

@ -40,4 +40,8 @@ return [
'map_coordinates_lat' => [ 'map_coordinates_lat' => [
'name' => 'Default Lat', 'name' => 'Default Lat',
], ],
'hide_location_filter' => [
'name' => 'Hide Location Filter',
],
]; ];

View File

@ -1,23 +1,24 @@
{% if setting_value('visiosoft.module.location::list_page_location') %} {% if setting_value('visiosoft.module.location::hide_location_filter') == false %}
<div class="card mb-3"> {% if setting_value('visiosoft.module.location::list_page_location') %}
<div class="card-header breadcrumb mb-0" id="locationHeading"> <div class="card mb-3">
<h5 class="mb-0"> <div class="card-header breadcrumb mb-0" id="locationHeading">
<button class="btn btn-link text-dark d-flex align-items-center" data-toggle="collapse" <h5 class="mb-0">
data-target="#location" aria-expanded="true" aria-controls="location"> <button class="btn btn-link text-dark d-flex align-items-center" data-toggle="collapse"
<img src="{{ img('visiosoft.module.location::images/location-icon.svg').url }}" class="mr-2" data-target="#location" aria-expanded="true" aria-controls="location">
alt="location icon"> <img src="{{ img('visiosoft.module.location::images/location-icon.svg').url }}" class="mr-2"
<span>{{ trans("visiosoft.module.location::addon.title") }}</span> alt="location icon">
</button> <span>{{ trans("visiosoft.module.location::addon.title") }}</span>
</h5> </button>
</h5>
</div>
<div id="location" class="collapse show overflow-auto" aria-labelledby="locationHeading">
{% include "visiosoft.module.location::ads-list/partials/location-fields" %}
</div>
</div> </div>
<div id="location" class="collapse show overflow-auto" aria-labelledby="locationHeading" <script>
data-parent="#filter"> var select_trans = "{{ trans('visiosoft.module.location::field.pick_option.name') }}";
{% include "visiosoft.module.location::ads-list/partials/location-fields" %} </script>
</div> {{ asset_add("scripts.js", "visiosoft.module.location::js/filterLocation.js") }}
</div> {{ asset_add("styles.css", "visiosoft.module.location::css/filterLocation.css") }}
<script> {% endif %}
var select_trans = "{{ trans('visiosoft.module.location::field.pick_option.name') }}";
</script>
{{ asset_add("scripts.js", "visiosoft.module.location::js/filterLocation.js") }}
{{ asset_add("styles.css", "visiosoft.module.location::css/filterLocation.css") }}
{% endif %} {% endif %}