Merge remote-tracking branch 'origin/master'

This commit is contained in:
fatihalp 2020-06-08 16:57:34 +03:00
commit ca2360498c
17 changed files with 109 additions and 36 deletions

View File

@ -1,6 +1,7 @@
.dropleft-edit {
right: 0;
top: 40%;
z-index: 5;
}
.dropleft-edit button {
transform: rotate(-90deg) translate(0, -100%);

View File

@ -47,8 +47,6 @@
/* Mobile filter */
.mobile-list-action {
margin-left: -30px;
margin-right: -30px;
border: 1px solid #dee2e68a;
}
@ -76,6 +74,10 @@
background: #c9c9c9;
}
.mobile-list-action div:last-child a:after {
content: none;
}
.mobile-list-action i {
font-size: 19px;
color: #a1a1a1;
@ -105,4 +107,18 @@
#filterModal {
overflow-y: auto;
}
.result-text {
font-size: 13px;
margin: 0 -15px;
}
.result-text span:first-child {
font-weight: 500;
}
.result-text span:last-child {
color: #8f0100;
font-weight: 500;
}

View File

@ -141,4 +141,13 @@ $('.set_category').on('click', function () {
$('#filterModal').find('form').attr("action", '/advs/list');
$('#filterModal').modal('toggle');
})
});
// Move filter on small screen
$(window).on("load resize", function () {
const width = (window.innerWidth > 0) ? window.innerWidth : screen.width;
if (width <= 575) {
const detach = $('#listFilterForm').detach();
$('#modalListFilterForm').append(detach);
}
});

View File

@ -173,5 +173,17 @@ $('.ad-info-right-bar-video').tooltip({
html: true
});
$("#listFilterForm").submit(function(e) {
const inputs = $('#listFilterForm :input');
[...inputs].forEach((input) => {
if (input.type === 'checkbox' || input.type === 'radio') {
if ($(input).prop("checked") == false) {
$(input).prop('disabled', true);
}
} else {
if ($(input).val() == "" || $(input).find(':selected').val() == "") {
$(input).prop('disabled', true);
}
}
});
});

View File

@ -263,6 +263,8 @@ return [
"no_location" => "No location is selected.",
"continue" => 'Continue',
"gallery" => 'Gallery',
"ads" => 'Ads',
"were_found" => 'were found.',
// Pending screen
'pending_message_1' => 'The Ad is in the Approval Process',

View File

@ -1,5 +1,9 @@
{% extends layout('list') %}
{% block styles %}
{{ asset_style("visiosoft.module.advs::css/list.css") }}
{% endblock %}
{% block content %}
<section>
@ -15,7 +19,15 @@
</div>
<div class="col-md-9">
<div class="section recommended-classified">
{% if catText %}
<div class="result-text border py-2 px-3 mb-3 d-none d-sm-block">
<p class="mb-0">
<span>"{{ catText }}"</span>
<span>{{ advs.total }} {{ trans('visiosoft.module.advs::field.ads')|lower }}</span>
{{ trans('visiosoft.module.advs::field.were_found') }}
</p>
</div>
{% endif %}
<div class="row breadcrumb list-header">
<div class="col-md-6 my-2 d-none d-sm-block">
@ -61,7 +73,6 @@
</script>
{{ asset_add("scripts.js", "visiosoft.module.advs::js/list.js") }}
{{ asset_add("styles.css", "visiosoft.module.advs::css/list.css") }}
{% endblock %}
{% block customjs %}

View File

@ -36,7 +36,7 @@
{% endif %}
</a>
</div>
{% include "visiosoft.module.advs::list/partials/list-filter" %}
<div id="modalListFilterForm"></div>
</div>
</div>
</div>

View File

@ -1,5 +1,5 @@
{% set formHtml %}
<form action="{{ url_route('visiosoft.module.advs::list') }}" method="get">
<form action="{{ url_route('visiosoft.module.advs::list') }}" method="get" id="listFilterForm">
{% endset %}
{% set catSlug = null %}
{% set citySlug = null %}
@ -12,7 +12,7 @@
{% endif %}
{% if catSlug %}
{% set formHtml %}
<form action="{{ url_route('adv_list_seo', [catSlug, citySlug]) }}" method="get">
<form action="{{ url_route('adv_list_seo', [catSlug, citySlug]) }}" method="get" id="listFilterForm">
{% endset %}
{% endif %}
{{ formHtml }}

View File

@ -279,9 +279,26 @@ class AdvsController extends PublicController
$viewType = $this->requestHttp->cookie('viewType');
if (!isset($allCats)) {
if (count($mainCats) == 1 || count($mainCats) == 2) {
$catText = end($mainCats)['val'];
} elseif (count($mainCats) > 2) {
$catArray = array_slice($mainCats, 2);
$catText = '';
$loop = 0;
foreach ($catArray as $cat) {
$catText = !$loop ? $catText . $cat['val'] : $catText . ' ' . $cat['val'];
$loop++;
}
}
$this->template->set('showTitle', false);
$this->template->set('meta_title', $catText);
$this->template->set('meta_description', $catText);
}
$compact = compact('advs', 'countries', 'mainCats', 'subCats', 'checkboxes', 'request', 'param',
'user', 'featured_advs', 'viewType', 'topfields', 'selectDropdown', 'selectRange', 'selectImage', 'ranges', 'seenList',
'searchedCountry', 'radio', 'categoryId', 'cityId', 'allCats');
'user', 'featured_advs', 'viewType', 'topfields', 'selectDropdown', 'selectRange', 'selectImage', 'ranges',
'seenList', 'searchedCountry', 'radio', 'categoryId', 'cityId', 'allCats', 'catText');
return $this->viewTypeBasedRedirect($viewType, $compact);
}

View File

@ -9,11 +9,11 @@
<div class="row p-2">
{% if setting_value('visiosoft.theme.base::latest_and_view_all_btn') %}
<div class="col-md-6">
<h4 class="p-2">{{ trans('theme::field.latest_ads') }}</h4>
<h4 class="p-2">{{ trans('visiosoft.theme.base::field.latest_ads') }}</h4>
</div>
<div class="col-md-6 text-right">
<a class="btn btn-outline-secondary"
href="{{ url_route('visiosoft.module.advs::list') }}">{{ trans('theme::field.show_all') }}</a>
href="{{ url_route('visiosoft.module.advs::list') }}">{{ trans('visiosoft.theme.base::field.show_all') }}</a>
</div>
{% endif %}

View File

@ -12,22 +12,22 @@
<html>
<head>
{% include "theme::partials/metadata" %}
{% include "visiosoft.theme.base::partials/metadata" %}
{% block styles %}{% endblock %}
</head>
<body>
{% include "theme::partials/header" %}
{% include "visiosoft.theme.base::partials/header" %}
{{ addBlock('layouts/default/section')|raw }}
<main id="main">
<div class="container">
{% include "theme::partials/messages" %}
{% include "visiosoft.theme.base::partials/messages" %}
{% if (request_path() == '/') %}
{% include "theme::index/default" %}
{% include "visiosoft.theme.base::index/default" %}
{% else %}
{% block content %}{% endblock %}
{% endif %}
@ -35,9 +35,9 @@
</div>
</main>
{% include "theme::partials/footer" %}
{% include "theme::partials/assets" %}
{% include "theme::partials/settings" %}
{% include "visiosoft.theme.base::partials/footer" %}
{% include "visiosoft.theme.base::partials/assets" %}
{% include "visiosoft.theme.base::partials/settings" %}
</body>
</html>

View File

@ -14,7 +14,7 @@
{{ asset_add("theme.js", "visiosoft.theme.base::js/jquery.maskedinput.js") }}
{{ asset_add("theme.js", "visiosoft.theme.base::js/intlTelInput.min.js") }}
{{ asset_add("theme.js", "visiosoft.theme.base::js/utils.js") }}
{{ asset_add("theme.js", "visiosoft.theme.base::js/phoneField.js") }}
{{ asset_add("theme.js", "visiosoft.theme.base::js/phonefield.js") }}
{{ asset_add("theme.js", "visiosoft.theme.base::js/jquery.inputmask.bundle.min.js") }}
{# Theme Scripts #}

View File

@ -1,5 +1,5 @@
<header id="header">
{% include "theme::partials/navigation" %}
{% include "visiosoft.theme.base::partials/navigation" %}
</header>

View File

@ -8,8 +8,11 @@
<!-- Meta Tags -->
<title>
{{ setting_value('streams::name', config_get('streams::distribution.name')) }}
&#8250;
{% set showTitle = template.showTitle is same as(false) ? false : true %}
{% if showTitle %}
{{ setting_value('streams::name', config_get('streams::distribution.name')) }}
&#8250;
{% endif %}
{{ trans(template.meta_title) }}
</title>

View File

@ -37,7 +37,7 @@
<a class="nav-link" href="{{ url_route('profile::profile') }}">{{ trans('visiosoft.theme.base::field.profile') }}</a>
</li>
<li class="nav-item">
<a href="/advs/create_adv" class="btn btn-primary">{{ trans("theme::button.post_ad.name") }}</a>
<a href="/advs/create_adv" class="btn btn-primary">{{ trans("visiosoft.theme.base::button.post_ad.name") }}</a>
</li>
</ul>
{% endif %}
@ -56,7 +56,7 @@
<a class="nav-link" href="{{ url_route('profile::profile') }}">{{ trans('visiosoft.theme.base::field.profile') }}</a>
</li>
<li class="nav-item">
<a href="/advs/create_adv" class="btn btn-primary">{{ trans("theme::button.post_ad.name") }}</a>
<a href="/advs/create_adv" class="btn btn-primary">{{ trans("visiosoft.theme.base::button.post_ad.name") }}</a>
</li>
</ul>
{% endif %}

View File

@ -41,13 +41,15 @@ class AddViewAdsButton
protected function addViewAdsButton(UserTableBuilder $builder)
{
$buttons = $builder->getButtons();
$dropdown = array_merge($buttons['settings']['dropdown'], [
"ads" => [
"text" => trans('visiosoft.theme.defaultadmin::button.view_ads'),
"href" => "admin/advs?filter_User={entry.id}"
]
]);
$buttons['settings']['dropdown'] = $dropdown;
$builder->setButtons($buttons);
if (isset($buttons['settings'])) {
$dropdown = array_merge($buttons['settings']['dropdown'], [
"ads" => [
"text" => trans('visiosoft.theme.defaultadmin::button.view_ads'),
"href" => "admin/advs?filter_User={entry.id}"
]
]);
$buttons['settings']['dropdown'] = $dropdown;
$builder->setButtons($buttons);
}
}
}

View File

@ -102,4 +102,4 @@
<script>
var default_country = "{{ setting_value('visiosoft.module.location::default_country') }}"
</script>
{{ asset_add("scripts.js", "visiosoft.theme.base::js/phoneField.js") }}
{{ asset_add("scripts.js", "visiosoft.theme.base::js/phonefield.js") }}