mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
565e038495
@ -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', {
|
||||
@ -65,7 +67,7 @@
|
||||
|
||||
{{ addBlock('ads-list/row',{'topfields':topfields,'selectRange':selectRange,'advs':advs, 'mainCats':mainCats|length})|raw }}
|
||||
|
||||
<div id="listingWrapper" class="border rounded p-s-3 p-0">
|
||||
<div id="listingWrapper" class="border rounded p-3">
|
||||
{% block listContent %}
|
||||
{% include "visiosoft.module.advs::list/partials/ads" %}
|
||||
{% endblock %}
|
||||
|
||||
@ -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") }}
|
||||
|
||||
@ -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 %}
|
||||
|
||||
@ -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' %}
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -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>
|
||||
@ -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;
|
||||
|
||||
@ -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!',
|
||||
];
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user