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

View File

@ -49,7 +49,7 @@
</div>
{% endfor %}
<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">
{{ trans('visiosoft.module.advs::field.clear_all') }}
</a>

View File

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

View File

@ -50,4 +50,10 @@ class CityRepository extends EntryRepository implements CityRepositoryInterface
->orderBy('order','ASC')
->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 getCitiesByCountryId($country_id);
public function findAllByIDs($citiesIDs);
}

View File

@ -4,6 +4,13 @@ class ForgotPassFormFields
{
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(
[
'email' => [
@ -23,10 +30,7 @@ class ForgotPassFormFields
"resetType" => [
"type" => "anomaly.field_type.select",
"config" => [
"options" => [
'sms' => 'visiosoft.theme.base::field.sms',
'mail' => 'visiosoft.theme.base::field.mail',
],
"options" => $resetTypeOptions,
"separator" => ":",
"default_value" => 'mail',
"mode" => "radio",