Merge branch 'master' into image-view-fix

# Conflicts:
#	addons/default/visiosoft/advs-module/resources/views/list/list.twig
This commit is contained in:
Metehan Celik 2022-01-10 17:04:00 +03:00
commit d99ae40cc9
13 changed files with 118 additions and 60 deletions

View File

@ -7,7 +7,9 @@
{% block content %}
<div id="listingPage" class="">
{% include "visiosoft.module.advs::list/partials/mobile-list" %}
<div id="listingPage" class="d-none d-sm-block">
{% include "visiosoft.module.advs::list/partials/breadcrumb" %}
@ -15,7 +17,7 @@
{% include "visiosoft.module.advs::list/partials/list-filter" %}
<div id="listingContainer" class="flex-fill ml-s-4 ml-0">
<div id="listingContainer" class="flex-fill ml-4">
<div id="pageTitle" class="d-flex justify-content-between border-bottom pb-2 px-3 mb-3">
<p>
{{ trans('visiosoft.module.advs::field.search_ad_result_text', {

View File

@ -1,6 +1,6 @@
<div id="breadcrumb" class="border-bottom border-right border-left d-flex justify-content-between pl-s-3 p-0">
<div id="breadcrumb" class="border-bottom border-right border-left d-flex justify-content-between">
<div class="overflow-hidden d-flex align-items-center">
<span class="text-truncate d-s-block d-none">
<span class="text-truncate">
<a href="{{ url('/') }}" data-toggle="tooltip" data-placement="bottom"
title="{{ trans("visiosoft.module.advs::field.home") }}">
{{ trans("visiosoft.module.advs::field.home") }}

View File

@ -26,9 +26,9 @@
<a href="javascript:;"
class="text-decoration-none text-truncate d-block selected-category-name">
{% if app.request.get('cat') %}
{% if category %}
{% for category_breadcrumbs in mainCats %}
{{ category_breadcrumbs['val'] }}
{{ category_breadcrumbs['name'] }}
{% if count(mainCats) != loop.index %}
,
{% endif %}

View File

@ -3,7 +3,7 @@
{% set citySlug = pathInfo|length is same as(4) ? pathInfo[3] : null %}
{% set formAction = catSlug ? url_route('adv_list_seo', [catSlug, citySlug]) : url_route('visiosoft.module.advs::list') %}
<form action="{{ formAction }}" method="get" id="{{ (filter_id) ? filter_id : "listFilterForm" }}" rel="nofollow"
class="flex-shrink-0 d-md-block d-none">
class="flex-shrink-0">
<input type="hidden" name="cat" value="{{ app.request.get('cat') }}">
<input type="hidden" name="user" value="{{ app.request.get('user') }}">
@ -26,26 +26,26 @@
{% include 'visiosoft.module.cats::ads-list/partials/cat-filter' %}
</div>
{{ addBlock('ads-list/partials/list-filter',{
'mainCats':mainCats,
'subCats':subCats,
'ranges':ranges,
'text':text,
'checkboxes':checkboxes,
'topfields' : topfields,
'selectDropdown' : selectDropdown,
'selectRange' : selectRange,
'selectImage' : selectImage,
'radio':radio,
'countries':countries,
'cities':cities,
'districts':districts,
'neighborhoods':neighborhoods,
'villages':villages,
'param':param,
'category':category,
'cityId':cityId
})|raw }}
{{ addBlock('ads-list/partials/list-filter',{
'mainCats':mainCats,
'subCats':subCats,
'ranges':ranges,
'text':text,
'checkboxes':checkboxes,
'topfields' : topfields,
'selectDropdown' : selectDropdown,
'selectRange' : selectRange,
'selectImage' : selectImage,
'radio':radio,
'countries':countries,
'cities':cities,
'districts':districts,
'neighborhoods':neighborhoods,
'villages':villages,
'param':param,
'category':category,
'cityId':cityId
})|raw }}
<!-- Price Filter Start -->
{% include 'visiosoft.module.advs::list/partials/price-filter' %}

View File

@ -4,7 +4,7 @@
<a href="{{ url('/') }}">{{ trans("visiosoft.module.advs::field.home") }}</a>
</li>
{{ addBlock('ads-list/partials/breadcrumb-mobile', {'mainCats': mainCats, 'category': categoryId})|raw }}
{{ addBlock('ads-list/partials/breadcrumb-mobile', {'mainCats': mainCats, 'category': category})|raw }}
</ul>
</div>

View File

@ -0,0 +1,46 @@
<div id="mobileListingPage" class="d-sm-none mb-5">
{% if setting_value('visiosoft.module.advs::show_subcats_mobile') %}
{% include "visiosoft.module.advs::list/partials/sub-categories-mobile" %}
{% endif %}
{% if not hideBreadcrump %}
{% include "visiosoft.module.advs::list/partials/mobile-breadcrumb" %}
{% endif %}
{% if not hideActions %}
<div id="mobileListNav" class="d-flex p-2 align-items-center mb-1">
<div id="filter_modal_btn" class="d-flex flex-column align-items-center mobile-list-nav-item">
{{ img('visiosoft.module.advs::images/listing/mobile-filter.svg').data|raw }}
<p class="mt-1">{{ trans('visiosoft.module.advs::field.filter') }}</p>
</div>
<div class="divider"></div>
<div id="sort_modal_btn" class="d-flex flex-column align-items-center mobile-list-nav-item">
{{ img('visiosoft.module.advs::images/listing/mobile-sort.svg').data|raw }}
<p class="mt-1">{{ trans('visiosoft.module.advs::field.sort') }}</p>
</div>
<div class="divider"></div>
{{ addBlock('ads-list/mobile/action-bar')|raw }}
</div>
{% endif %}
<div id="mobileListing">
{{ addBlock('ad-list/partials/mobile-list', {'featured_advs': featured_advs, 'vars': _context})|raw }}
{% for adv in advs %}
<a href="{{ adv.detail_url }}" class="listing-item d-flex p-2">
<img src="{{ adv.cover_photo }}" alt="{{ adv.name }}" class="rounded-sm">
<div class="ml-3 mt-1">
<h6 class="mb-1">{{ adv.name }}</h6>
{% if listLocation %}
<p class="mb-1">{{ adv.country_name }} / {{ adv.city_name }}</p>
{% endif %}
<p>{{ adv.price != '0' ? currency_format(adv.price,adv.currency) : trans('visiosoft.module.advs::field.free') }}</p>
</div>
</a>
{% endfor %}
</div>
{% include "visiosoft.module.advs::list/partials/pagination" %}
</div>

View File

@ -271,7 +271,7 @@ class AdvsController extends PublicController
if ($category) {
$mainCats = $this->category_repository->getParentCategoryByOrder($category->id);
$mainCats = collect($this->category_repository->getParentCategoryByOrder($category->id));
$subCats = $category->getSubCategories();
$allCats = false;
} else {
@ -450,9 +450,9 @@ class AdvsController extends PublicController
if ($city) {
$catText = "$city->name $catText";
} elseif (count($mainCats) == 1 || count($mainCats) == 2) {
$catText = end($mainCats)->name;
$catText = $mainCats->last()->name;
} elseif (count($mainCats) > 2) {
$catArray = array_slice($mainCats, 2);
$catArray = $mainCats->slice(2);
$loop = 0;
foreach ($catArray as $cat) {
$catText = !$loop ? $catText . $cat->name : $catText . ' ' . $cat->name;
@ -742,6 +742,13 @@ class AdvsController extends PublicController
return $cats;
}
public function checkUser()
{
return [
'success' => \auth()->check(),
];
}
public function create(AdvFormBuilder $formBuilder, CategoryRepositoryInterface $repository)
{
$isActive = new AdvModel();

View File

@ -22,7 +22,7 @@
{{ addBlock('layouts/default/section')|raw }}
<main id="main">
<div class="container-md container-fluid">
<div class="container">
{% include "visiosoft.theme.base::partials/messages" %}

View File

@ -2,4 +2,5 @@
return [
'categories_mass_delete_success' => 'Categories and related sub-categories has been deleted successfully!',
'cat_slug_exists' => 'A category with a slug of :slug already exists!',
];

View File

@ -6,4 +6,4 @@
</a>
</li>
{% endfor %}
{% endif %}
{% endif %}

View File

@ -63,8 +63,6 @@ class CategoryController extends AdminController
public function create(FileUploader $uploader, FolderRepositoryInterface $folderRepository, MountManager $manager)
{
if ($this->request->action == "save") {
$all = $this->request->all();
$id = $all['parent_category'];
$parent_id = $all['parent_category'];
@ -119,24 +117,40 @@ class CategoryController extends AdminController
}
}
if (empty($isMultiCat)) {
$category = $this->categoryRepository->create(array_merge($translatableEntries, [
'slug' => $all['slug'],
'parent_category' => $all['parent_category'] === "" ? null : $all['parent_category'],
'seo_keyword' => $all['seo_keyword'],
'seo_description' => $all['seo_description'],
$slug = $all['slug'];
if (!$this->categoryRepository->findBySlug($slug)) {
$category = $this->categoryRepository->create(array_merge($translatableEntries, [
'slug' => $all['slug'],
'parent_category' => $all['parent_category'] === "" ? null : $all['parent_category'],
'seo_keyword' => $all['seo_keyword'],
'seo_description' => $all['seo_description'],
]));
$this->createIconFile($category->getId());
$this->dispatch(new CalculateCategoryLevel($category->getId()));
}
$this->messages->error(trans('visiosoft.module.cats::message.cat_slug_exists', [
'slug' => $slug
]));
$this->createIconFile($category->getId());
$this->dispatch(new CalculateCategoryLevel($category->getId()));
} else {
for ($i = 0; $i < count($isMultiCat[0]); $i++) {
foreach ($isMultiCat as $cat) {
$translatableEntries = array_merge($translatableEntries, $cat[$i]);
}
$slug = $this->str->slug(reset($translatableEntries)['name'], '_');
if ($this->categoryRepository->findBySlug($slug)) {
$this->messages->error(trans('visiosoft.module.cats::message.cat_slug_exists', [
'slug' => $slug
]));
continue;
}
$category = $this->categoryRepository->create(array_merge($translatableEntries, [
'slug' => $this->str->slug(reset($translatableEntries)['name'], '_'),
'slug' => $slug,
'parent_category' => $all['parent_category'] === "" ? null : $all['parent_category'],
'seo_keyword' => $all['seo_keyword'],
'seo_description' => $all['seo_description'],
@ -148,18 +162,6 @@ class CategoryController extends AdminController
}
};
// $this->categoryRepository->create(array_merge($translatableEntries, [
// 'slug' => $all['slug'],
// 'parent_category' => $all['parent_category'],
// 'icon' => $all['icon'],
// 'seo_keyword' => $all['seo_keyword'],
// 'seo_description' => $all['seo_description'],
// ]));
// $form->make();
// if ($form->hasFormErrors()) {
// return $this->redirect->to('/admin/cats/create');
// }
if ($parent_id != "") {
return $this->redirect->to('/admin/cats?cat=' . $parent_id);
}

View File

@ -66,7 +66,7 @@ class ValueTableBuilder extends TableBuilder
],
'rotate' => [
'target' => '_blank',
'icon' => 'fa fa-sync-alt',
'icon' => 'fa fa-sync-alt fa-refresh',
'type' => 'info',
'text' => '',
'class' => 'col-4',

View File

@ -41,7 +41,7 @@
"anomaly/decimal-field_type": "~2.1.0",
"anomaly/integer-field_type": "~2.1.0",
"anomaly/editor-field_type": "~3.1.0",
"anomaly/select-field_type": "~2.3.0",
"anomaly/select-field_type": "2.3.8",
"anomaly/slider-field_type": "~3.0.0",
"anomaly/addon-field_type": "~2.2.0",
"anomaly/email-field_type": "~2.1.0",