This commit is contained in:
Diatrex 2020-10-06 15:42:26 +03:00
commit 14a221af3e
3 changed files with 28 additions and 19 deletions

View File

@ -213,3 +213,7 @@ a.sort-by-open-dropdown:hover {
text-decoration: underline; text-decoration: underline;
cursor: pointer; cursor: pointer;
} }
.filter-section .countries input[type=checkbox] {
display: none;
}

View File

@ -198,6 +198,7 @@ function SelectOnClick() {
var id = $(this).attr('data-id'); var id = $(this).attr('data-id');
if ($(this).attr('data-field') == "country") { if ($(this).attr('data-field') == "country") {
$('.filter-location-modal,.filter-location-back,.filter-location-modal .countries').hide();
$('input[name="country"]').val(id) $('input[name="country"]').val(id)
text_html.html(input_text) text_html.html(input_text)
$(".filter-location-body input[type='checkbox']").prop('checked', false); $(".filter-location-body input[type='checkbox']").prop('checked', false);

View File

@ -1,25 +1,29 @@
<div class="row w-100 px-2 m-0"> <div class="row w-100 px-2 m-0">
<div class="col-12 px-0 py-1 px-2"> {% set defaultCountry = setting_value('visiosoft.module.location::default_country') %}
<b> {% set selectedCountry = app.request.get('country') %}
<span class="float-left">{{ trans('visiosoft.module.location::field.address.name') }}</span>
</b> {% set countryValue = '' %}
{% set defaultCountry = setting_value('visiosoft.module.location::default_country') %} {% if selectedCountry %}
{% set selectedCountry = app.request.get('country') %} {% set countryName = getCountry(selectedCountry).name %}
<a href="#" class="a-sahibinden-type selected-country filter-country-btn float-right"> {% set countryValue = defaultCountry == selectedCountry ? '' : selectedCountry %}
{% set countryValue = '' %} {% elseif defaultCountry %}
{% if selectedCountry %} {% set countryName = getCountry(defaultCountry).name %}
{% set countryName = getCountry(selectedCountry).name %} {% set countryValue = defaultCountry %}
{% set countryValue = defaultCountry == selectedCountry ? '' : selectedCountry %} {% else %}
{% elseif defaultCountry %} {% set countryName = trans("visiosoft.module.location::field.country.name") %}
{% set countryName = getCountry(defaultCountry).name %} {% endif %}
{% set countryValue = defaultCountry %} <div class="col-12 px-0 py-1">
{% else %} <button type="button" class="btn btn-default border border-1 w-100 selected-country filter-country-btn"
{% set countryName = trans("visiosoft.module.location::field.country.name") %} data-toggle="modal">
{% endif %} <span class="float-left">
<small>{{ countryName }}</small> {{ trans("visiosoft.module.location::field.country.name") }}
</a> <small class="text-muted selected-country">{{ countryName }}</small>
</span>
<i class="fas fa-sort-down float-right"></i>
</button>
<input name="country" value="{{ countryValue }}" type="hidden"> <input name="country" value="{{ countryValue }}" type="hidden">
</div> </div>
<div class="col-12 px-0 py-1"> <div class="col-12 px-0 py-1">
<button type="button" class="btn btn-default border border-1 w-100 filter-city-btn" data-toggle="modal" <button type="button" class="btn btn-default border border-1 w-100 filter-city-btn" data-toggle="modal"
data-parent=""> data-parent="">