Merge pull request #1049 from openclassify/dia

#3390 Show selected cities in listing
This commit is contained in:
spektra2147 2021-04-21 09:39:31 +03:00 committed by GitHub
commit 715dd6dad4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 101 additions and 47 deletions

View File

@ -55,8 +55,12 @@ ul {
} }
} }
& > label { &:last-child {
font-size: calc(14rem / 16); max-height: 11rem;
label {
font-size: calc(14rem / 16);
}
} }
} }
} }
@ -513,13 +517,13 @@ ul {
} }
.cat-data { .cat-data {
font-size: calc(12rem / 16); font-size: calc(13rem / 16);
color: rgba(34, 34, 34, .4); color: rgba(34, 34, 34, .4);
} }
.action-data { .action-data {
color: #A1A1A1; color: #A1A1A1;
font-size: calc(8rem / 16); font-size: calc(10.7rem / 16);
& > a { & > a {
visibility: hidden; visibility: hidden;
@ -541,7 +545,7 @@ ul {
} }
svg { svg {
width: .4rem; width: .45rem;
height: auto; height: auto;
} }
} }

View File

@ -49,7 +49,7 @@
</div> </div>
{% endfor %} {% endfor %}
<div class="d-flex align-items-center"> <div class="d-flex align-items-center">
<a href="{{ app.request.pathinfo }}" <a href="{{ url_route('adv_list_seo', [category.slug]) }}"
class="text-truncate d-flex align-items-center mr-1"> class="text-truncate d-flex align-items-center mr-1">
{{ trans('visiosoft.module.advs::field.clear_all') }} {{ trans('visiosoft.module.advs::field.clear_all') }}
</a> </a>

View File

@ -56,26 +56,28 @@
{{ img('visiosoft.module.advs::images/listing/filter-arrow.svg').data|raw }} {{ img('visiosoft.module.advs::images/listing/filter-arrow.svg').data|raw }}
</div> </div>
<div class="px-2 mb-2 d-flex align-items-center"> <div class="overflow-auto">
<input type="radio" id="dateDay" {{ app.request.get('date') == 'day' ? 'checked' }} value="day" <div class="px-2 mb-2 d-flex align-items-center">
name="date"> <input type="radio" id="dateDay" {{ app.request.get('date') == 'day' ? 'checked' }} value="day"
<label for="dateDay" class="ml-2 mb-0"> name="date">
{{ trans("visiosoft.module.advs::field.in_the_last_24_hours.name") }} <label for="dateDay" class="ml-2 mb-0">
</label> {{ trans("visiosoft.module.advs::field.in_the_last_24_hours.name") }}
</div> </label>
<div class="px-2 mb-2 d-flex align-items-center"> </div>
<input type="radio" id="dateWeek" {{ app.request.get('date') == 'week' ? 'checked' }} value="week" <div class="px-2 mb-2 d-flex align-items-center">
name="date"> <input type="radio" id="dateWeek" {{ app.request.get('date') == 'week' ? 'checked' }} value="week"
<label for="dateWeek" class="ml-2 mb-0"> name="date">
{{ trans("visiosoft.module.advs::field.in_the_last_week.name") }} <label for="dateWeek" class="ml-2 mb-0">
</label> {{ trans("visiosoft.module.advs::field.in_the_last_week.name") }}
</div> </label>
<div class="px-2 mb-3 d-flex align-items-center"> </div>
<input type="radio" id="dateMonth" {{ app.request.get('date') == 'month' ? 'checked' }} value="month" <div class="px-2 mb-3 d-flex align-items-center">
name="date"> <input type="radio" id="dateMonth" {{ app.request.get('date') == 'month' ? 'checked' }} value="month"
<label for="dateMonth" class="ml-2 mb-0"> name="date">
{{ trans("visiosoft.module.advs::field.in_the_last_month.name") }} <label for="dateMonth" class="ml-2 mb-0">
</label> {{ trans("visiosoft.module.advs::field.in_the_last_month.name") }}
</label>
</div>
</div> </div>
</div> </div>
<!-- Date Filter End --> <!-- Date Filter End -->
@ -89,19 +91,21 @@
{{ img('visiosoft.module.advs::images/listing/filter-arrow.svg').data|raw }} {{ img('visiosoft.module.advs::images/listing/filter-arrow.svg').data|raw }}
</div> </div>
<div class="px-2 mb-2 d-flex align-items-center"> <div class="overflow-auto">
<input type="checkbox" id="photo" {{ app.request.get('photo') == true ? 'checked' }} value="true" <div class="px-2 mb-2 d-flex align-items-center">
name="photo"> <input type="checkbox" id="photo" {{ app.request.get('photo') == true ? 'checked' }} value="true"
<label for="photo" class="ml-2 mb-0"> name="photo">
{{ trans("visiosoft.module.advs::field.ads_with_photo.name") }} <label for="photo" class="ml-2 mb-0">
</label> {{ trans("visiosoft.module.advs::field.ads_with_photo.name") }}
</div> </label>
<div class="px-2 mb-3 d-flex align-items-center"> </div>
<input type="checkbox" id="video" {{ app.request.get('video') == true ? 'checked' }} value="true" <div class="px-2 mb-3 d-flex align-items-center">
name="video"> <input type="checkbox" id="video" {{ app.request.get('video') == true ? 'checked' }} value="true"
<label for="video" class="ml-2 mb-0"> name="video">
{{ trans("visiosoft.module.advs::field.ads_with_video.name") }} <label for="video" class="ml-2 mb-0">
</label> {{ trans("visiosoft.module.advs::field.ads_with_video.name") }}
</label>
</div>
</div> </div>
</div> </div>
<!-- Media Filter End --> <!-- Media Filter End -->
@ -115,10 +119,12 @@
{{ img('visiosoft.module.advs::images/listing/filter-arrow.svg').data|raw }} {{ img('visiosoft.module.advs::images/listing/filter-arrow.svg').data|raw }}
</div> </div>
<div class="px-2 mb-3 d-flex align-items-center"> <div class="overflow-auto">
<input type="checkbox" id="mapFilter" {{ app.request.get('map') == true ? 'checked' }} value="true" <div class="px-2 mb-3 d-flex align-items-center">
name="map"> <input type="checkbox" id="mapFilter" {{ app.request.get('map') == true ? 'checked' }} value="true"
<label for="mapFilter" class="ml-2 mb-0">{{ trans("visiosoft.module.advs::field.ads_with_map") }}</label> name="map">
<label for="mapFilter" class="ml-2 mb-0">{{ trans("visiosoft.module.advs::field.ads_with_map") }}</label>
</div>
</div> </div>
</div> </div>
<!-- Map Filter End --> <!-- Map Filter End -->

View File

@ -360,6 +360,38 @@ class AdvsController extends PublicController
]; ];
} }
if (($cities = \request()->city) && $cities = $cities[0]) {
$citiesIDs = $cityId ? [$cityId->id] : explode(',', $cities);
$cities = $this->cityRepository->findAllByIDs($citiesIDs);
$value = array();
foreach ($cities as $city) {
$removalLink = array_filter($param, function ($singleParam) {
return $singleParam !== 'city';
}, ARRAY_FILTER_USE_KEY);
$removalLink = fullLink(
$removalLink,
\request()->url(),
['city[]' => implode(
',',
array_filter($citiesIDs, function ($singleCity) use ($city) {
return $singleCity != $city->id;
})
)]
);
$value[] = [
'name' => $city->name,
'removalLink' => $removalLink
];
}
$cFArray[] = [
'name' => trans('visiosoft.module.advs::field.address'),
'value' => $value
];
}
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');

View File

@ -50,4 +50,10 @@ class CityRepository extends EntryRepository implements CityRepositoryInterface
->orderBy('order','ASC') ->orderBy('order','ASC')
->get(); ->get();
} }
public function findAllByIDs($citiesIDs) {
return $this->newQuery()
->whereIn('location_cities.id', $citiesIDs)
->get();
}
} }

View File

@ -7,4 +7,6 @@ interface CityRepositoryInterface extends EntryRepositoryInterface
public function getByEntryIDsAndOrderByTransCol($entryIDs, $orderBy, $direction = 'asc'); public function getByEntryIDsAndOrderByTransCol($entryIDs, $orderBy, $direction = 'asc');
public function getCitiesByCountryId($country_id); public function getCitiesByCountryId($country_id);
public function findAllByIDs($citiesIDs);
} }

View File

@ -4,6 +4,13 @@ class ForgotPassFormFields
{ {
public function handle(ForgotPassFormBuilder $builder) public function handle(ForgotPassFormBuilder $builder)
{ {
$resetTypeOptions = [
'mail' => 'visiosoft.theme.base::field.mail',
];
if (is_module_installed('visiosoft.module.sms')) {
$resetTypeOptions['sms'] = 'visiosoft.theme.base::field.sms';
}
$builder->setFields( $builder->setFields(
[ [
'email' => [ 'email' => [
@ -23,10 +30,7 @@ class ForgotPassFormFields
"resetType" => [ "resetType" => [
"type" => "anomaly.field_type.select", "type" => "anomaly.field_type.select",
"config" => [ "config" => [
"options" => [ "options" => $resetTypeOptions,
'sms' => 'visiosoft.theme.base::field.sms',
'mail' => 'visiosoft.theme.base::field.mail',
],
"separator" => ":", "separator" => ":",
"default_value" => 'mail', "default_value" => 'mail',
"mode" => "radio", "mode" => "radio",