mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-24 22:11:01 -06:00
#765 added url parameters for link
This commit is contained in:
parent
5b9056bdc5
commit
dc7922dd41
@ -47,7 +47,8 @@
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-check py-1">
|
<div class="form-check py-1">
|
||||||
<input class="form-check-input" type="radio" name="date" id="dateMonth" value="month">
|
<input class="form-check-input" type="radio" name="date" id="dateMonth"
|
||||||
|
value="month">
|
||||||
<label class="form-check-label" for="dateMonth">
|
<label class="form-check-label" for="dateMonth">
|
||||||
{{ trans("visiosoft.module.advs::field.in_the_last_month.name") }}
|
{{ trans("visiosoft.module.advs::field.in_the_last_month.name") }}
|
||||||
</label>
|
</label>
|
||||||
@ -64,7 +65,8 @@
|
|||||||
<button class="btn btn-link text-dark" data-toggle="collapse" data-target="#media"
|
<button class="btn btn-link text-dark" data-toggle="collapse" data-target="#media"
|
||||||
aria-expanded="true" aria-controls="media">
|
aria-expanded="true" aria-controls="media">
|
||||||
<i class="fa fa-camera"></i>
|
<i class="fa fa-camera"></i>
|
||||||
{{ trans("visiosoft.module.advs::field.photo.name") }}, {{ trans("visiosoft.module.advs::field.video.name") }}
|
{{ trans("visiosoft.module.advs::field.photo.name") }}
|
||||||
|
, {{ trans("visiosoft.module.advs::field.video.name") }}
|
||||||
</button>
|
</button>
|
||||||
</h5>
|
</h5>
|
||||||
</div>
|
</div>
|
||||||
@ -73,13 +75,15 @@
|
|||||||
style="max-height: 300px;">
|
style="max-height: 300px;">
|
||||||
<div class="row p-3 m-0">
|
<div class="row p-3 m-0">
|
||||||
<div class="form-check py-1">
|
<div class="form-check py-1">
|
||||||
<input class="form-check-input" type="checkbox" value="true" name="photo" id="photo">
|
<input class="form-check-input" type="checkbox" value="true" name="photo"
|
||||||
|
id="photo">
|
||||||
<label class="form-check-label" for="photo">
|
<label class="form-check-label" for="photo">
|
||||||
{{ trans("visiosoft.module.advs::field.ads_with_photo.name") }}
|
{{ trans("visiosoft.module.advs::field.ads_with_photo.name") }}
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-check py-1">
|
<div class="form-check py-1">
|
||||||
<input class="form-check-input" type="checkbox" value="true" name="video" id="video">
|
<input class="form-check-input" type="checkbox" value="true" name="video"
|
||||||
|
id="video">
|
||||||
<label class="form-check-label" for="video">
|
<label class="form-check-label" for="video">
|
||||||
{{ trans("visiosoft.module.advs::field.ads_with_video.name") }}
|
{{ trans("visiosoft.module.advs::field.ads_with_video.name") }}
|
||||||
</label>
|
</label>
|
||||||
@ -105,7 +109,8 @@
|
|||||||
style="max-height: 300px;">
|
style="max-height: 300px;">
|
||||||
<div class="row p-3 m-0">
|
<div class="row p-3 m-0">
|
||||||
<div class="form-check py-1">
|
<div class="form-check py-1">
|
||||||
<input class="form-check-input" type="checkbox" value="true" name="map" id="mapFilter">
|
<input class="form-check-input" type="checkbox" value="true" name="map"
|
||||||
|
id="mapFilter">
|
||||||
<label class="form-check-label" for="mapFilter">
|
<label class="form-check-label" for="mapFilter">
|
||||||
{{ trans("visiosoft.module.advs::field.yes.name") }}
|
{{ trans("visiosoft.module.advs::field.yes.name") }}
|
||||||
</label>
|
</label>
|
||||||
@ -133,13 +138,13 @@
|
|||||||
{% set active_currencies = setting_value('visiosoft.module.advs::enabled_currencies') %}
|
{% set active_currencies = setting_value('visiosoft.module.advs::enabled_currencies') %}
|
||||||
<div class="col-md-4 p-1 m-0">
|
<div class="col-md-4 p-1 m-0">
|
||||||
<input type="number" class="price-input form-control w-100"
|
<input type="number" class="price-input form-control w-100"
|
||||||
value="{{ request.min_price }}"
|
value="{{ app.request.get('min_price') }}"
|
||||||
name="min_price" min="0"
|
name="min_price" min="0"
|
||||||
placeholder="{{ trans('visiosoft.module.advs::field.min.name') }}">
|
placeholder="{{ trans('visiosoft.module.advs::field.min.name') }}">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-4 p-1 pr-0 m-0">
|
<div class="col-md-4 p-1 pr-0 m-0">
|
||||||
<input class="price-input form-control w-100" type="number"
|
<input class="price-input form-control w-100" type="number"
|
||||||
value="{{ request.max_price }}"
|
value="{{ app.request.get('max_price') }}"
|
||||||
name="max_price"
|
name="max_price"
|
||||||
placeholder="{{ trans('visiosoft.module.advs::field.max.name') }}">
|
placeholder="{{ trans('visiosoft.module.advs::field.max.name') }}">
|
||||||
|
|
||||||
@ -147,7 +152,9 @@
|
|||||||
<div class="col-md-4 py-1 px-0">
|
<div class="col-md-4 py-1 px-0">
|
||||||
<select name="currency" id="currency" class="form-control">
|
<select name="currency" id="currency" class="form-control">
|
||||||
{% for currency in active_currencies %}
|
{% for currency in active_currencies %}
|
||||||
<option value="{{ currency }}">{{ currency }}</option>
|
<option {% if app.request.get('currency') == currency %}
|
||||||
|
selected
|
||||||
|
{% endif %}value="{{ currency }}">{{ currency }}</option>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -0,0 +1,78 @@
|
|||||||
|
<?php namespace Visiosoft\AdvsModule\Adv\Command;
|
||||||
|
|
||||||
|
use Illuminate\Support\Arr;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
|
class appendRequestURL
|
||||||
|
{
|
||||||
|
|
||||||
|
protected $query = [];
|
||||||
|
|
||||||
|
protected $request;
|
||||||
|
protected $url;
|
||||||
|
protected $new_parameters;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* appendRequestURL constructor.
|
||||||
|
* @param $request
|
||||||
|
*/
|
||||||
|
public function __construct($request, $url, $new_parameters = [])
|
||||||
|
{
|
||||||
|
$this->url = $url;
|
||||||
|
$this->request = $request;
|
||||||
|
$this->new_parameters = $new_parameters;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return appendRequestURL
|
||||||
|
*/
|
||||||
|
public function handle()
|
||||||
|
{
|
||||||
|
return $this->url
|
||||||
|
. (Str::contains($this->url, '?') ? '&' : '?')
|
||||||
|
. Arr::query($this->appends(array_merge($this->request, $this->new_parameters)));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $key
|
||||||
|
* @param null $value
|
||||||
|
* @return $this|appendRequestURL
|
||||||
|
*/
|
||||||
|
public function appends($key, $value = null)
|
||||||
|
{
|
||||||
|
if (is_null($key)) {
|
||||||
|
return $this->query;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (is_array($key)) {
|
||||||
|
return $this->appendArray($key)->query;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->addQuery($key, $value)->query;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param array $keys
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
protected function appendArray(array $keys)
|
||||||
|
{
|
||||||
|
foreach ($keys as $key => $value) {
|
||||||
|
$this->addQuery($key, $value);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $key
|
||||||
|
* @param $value
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
protected function addQuery($key, $value)
|
||||||
|
{
|
||||||
|
$this->query[$key] = $value;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,6 +1,7 @@
|
|||||||
<?php namespace Visiosoft\AdvsModule;
|
<?php namespace Visiosoft\AdvsModule;
|
||||||
|
|
||||||
use Anomaly\Streams\Platform\Addon\Plugin\Plugin;
|
use Anomaly\Streams\Platform\Addon\Plugin\Plugin;
|
||||||
|
use Visiosoft\AdvsModule\Adv\Command\appendRequestURL;
|
||||||
use Visiosoft\AdvsModule\Adv\Command\GetAd;
|
use Visiosoft\AdvsModule\Adv\Command\GetAd;
|
||||||
use Visiosoft\AdvsModule\Adv\Command\isActive;
|
use Visiosoft\AdvsModule\Adv\Command\isActive;
|
||||||
use Visiosoft\AdvsModule\Adv\Command\LatestAds;
|
use Visiosoft\AdvsModule\Adv\Command\LatestAds;
|
||||||
@ -44,6 +45,13 @@ class AdvsModulePlugin extends Plugin
|
|||||||
|
|
||||||
return $latestAds;
|
return $latestAds;
|
||||||
}
|
}
|
||||||
|
),
|
||||||
|
new \Twig_SimpleFunction(
|
||||||
|
'appendRequestURL',
|
||||||
|
function ($request, $url, $new_parameters) {
|
||||||
|
|
||||||
|
return $this->dispatch(new appendRequestURL($request, $url, $new_parameters));
|
||||||
|
}
|
||||||
)
|
)
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -214,13 +214,13 @@ class AdvsController extends PublicController
|
|||||||
$userProfile = $this->profile_repository->getProfile($user->id);
|
$userProfile = $this->profile_repository->getProfile($user->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
$compact = compact('advs', 'countries', 'mainCats', 'subCats', 'checkboxes', 'request',
|
|
||||||
'user', 'userProfile', 'featured_advs', 'type', 'topfields', 'ranges', 'seenList', 'searchedCountry', 'radio');
|
|
||||||
|
|
||||||
Cookie::queue(Cookie::make('last_search', $this->requestHttp->getRequestUri(), 84000));
|
Cookie::queue(Cookie::make('last_search', $this->requestHttp->getRequestUri(), 84000));
|
||||||
|
|
||||||
$viewType = $this->requestHttp->cookie('viewType');
|
$viewType = $this->requestHttp->cookie('viewType');
|
||||||
|
|
||||||
|
$compact = compact('advs', 'countries', 'mainCats', 'subCats', 'checkboxes', 'request',
|
||||||
|
'user', 'userProfile', 'featured_advs', 'viewType', 'topfields', 'ranges', 'seenList', 'searchedCountry', 'radio');
|
||||||
|
|
||||||
if (isset($viewType) and $viewType == 'table')
|
if (isset($viewType) and $viewType == 'table')
|
||||||
return $this->view->make('visiosoft.module.advs::list/table', $compact);
|
return $this->view->make('visiosoft.module.advs::list/table', $compact);
|
||||||
elseif (isset($viewType) and $viewType == 'map')
|
elseif (isset($viewType) and $viewType == 'map')
|
||||||
|
|||||||
@ -21,7 +21,13 @@
|
|||||||
{% set id = maincat.id %}
|
{% set id = maincat.id %}
|
||||||
{% set parent_category = false %}
|
{% set parent_category = false %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<a href="{% if(type == "list") %}{{ url_route('visiosoft.module.advs::list') }}{% else %}{{ url_route('advs_map_list') }}{% endif %}?cat={{ id }}"
|
<a href="
|
||||||
|
{% if(viewType != "map") %}
|
||||||
|
{{ appendRequestURL(request_query(),url_route('visiosoft.module.advs::list'),{'cat':id}) }}
|
||||||
|
{% else %}
|
||||||
|
{{ appendRequestURL(request_query(),url_route('advs_map_list'),{'cat':id}) }}
|
||||||
|
{% endif %}
|
||||||
|
"
|
||||||
class="list-group-item list-group-item-action text-truncate">
|
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 }}
|
||||||
@ -29,7 +35,13 @@
|
|||||||
{% for subcat in params.subCats %}
|
{% for subcat in params.subCats %}
|
||||||
<div class="list-group pl-3 bg-light">
|
<div class="list-group pl-3 bg-light">
|
||||||
{% if subcat.parent_category_id == maincat['id'] %}
|
{% if subcat.parent_category_id == maincat['id'] %}
|
||||||
<a href="{% if(type == "list") %}{{ url_route('visiosoft.module.advs::list') }}{% else %}{{ url_route('advs_map_list') }}{% endif %}?cat={{ subcat.id }}"
|
<a href="
|
||||||
|
{% if(viewType != "map") %}
|
||||||
|
{{ appendRequestURL(request_query(),url_route('visiosoft.module.advs::list'),{'cat':subcat.id}) }}
|
||||||
|
{% else %}
|
||||||
|
{{ appendRequestURL(request_query(),url_route('advs_map_list'),{'cat':subcat.id}) }}
|
||||||
|
{% endif %}
|
||||||
|
"
|
||||||
class="list-group-item list-group-item-action
|
class="list-group-item list-group-item-action
|
||||||
text-truncate">{{ subcat.name }}</a>
|
text-truncate">{{ subcat.name }}</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user