This commit is contained in:
Diatrex 2020-08-20 15:11:32 +03:00
commit ca9f268e72
27 changed files with 518 additions and 288 deletions

View File

@ -43,6 +43,12 @@ return [
'register_email_field',
],
],
'filter' => [
'title' => 'visiosoft.module.advs::section.filter',
'fields' => [
'hide_price_filter','hide_date_filter','hide_photo_filter','hide_map_filter'
],
],
],
],
];

View File

@ -201,4 +201,31 @@ return [
'default_value' => true,
],
],
'hide_price_filter' => [
'type' => 'anomaly.field_type.boolean',
'config' => [
'default_value' => false,
]
],
'hide_date_filter' => [
'type' => 'anomaly.field_type.boolean',
'config' => [
'default_value' => false,
]
],
'hide_photo_filter' => [
'type' => 'anomaly.field_type.boolean',
'config' => [
'default_value' => false,
]
],
'hide_map_filter' => [
'type' => 'anomaly.field_type.boolean',
'config' => [
'default_value' => false,
]
],
];

View File

@ -40,13 +40,6 @@ $('.sort-by-item').on('click', function () {
window.location.replace(goURL);
});
$('.ad-info-right-bar-video').on('click', function () {
$(".video-ad-tooltip-" + $(this).attr('data-id'))[0].play();
$(".video-ad-tooltip-" + $(this).attr('data-id'))[0].controls = false;
});
$(document).ready(function () {
let searchParams = new URLSearchParams(window.location.search);
@ -167,12 +160,6 @@ $(document).ready(function () {
});
});
$('.ad-info-right-bar-video').tooltip({
animated: 'fade',
placement: 'bottom',
html: true
});
$("#listFilterForm").submit(function(e) {
const inputs = $('#listFilterForm :input');
[...inputs].forEach((input) => {

View File

@ -40,6 +40,7 @@ return [
'general' => 'General',
'ads' => 'Ads',
'user' => 'User',
'filter' => 'Filter',
'options' => [
'title' => 'Options',
],

View File

@ -133,4 +133,17 @@ return [
'market_place' => [
'name' => 'Market Place',
],
'hide_price_filter' => [
'name' => 'Hide Price Filter',
],
'hide_date_filter' => [
'name' => 'Hide Date Filter',
],
'hide_photo_filter' => [
'name' => 'Hide Photo Filter',
],
'hide_map_filter' => [
'name' => 'Hide Map Filter',
],
];

View File

@ -1,191 +1,202 @@
{% set formHtml %}
<form action="{{ url_route('visiosoft.module.advs::list') }}" method="get" id="listFilterForm">
{% endset %}
{% set catSlug = null %}
{% set citySlug = null %}
{% set pathInfo = app.request.pathinfo|split('/') %}
{% if pathInfo[1] == 'c' %}
{% set catSlug = pathInfo[2] %}
{% endif %}
{% if pathInfo|length is same as(4) %}
{% set citySlug = pathInfo[3] %}
{% endif %}
{% if catSlug %}
{% set formHtml %}
<form action="{{ url_route('adv_list_seo', [catSlug, citySlug]) }}" method="get" id="listFilterForm">
<form action="{{ url_route('visiosoft.module.advs::list') }}" method="get" id="listFilterForm">
{% endset %}
{% endif %}
{{ formHtml }}
<div class="row">
<input type="hidden" name="cat" value="{{ app.request.get('cat') }}">
<input type="hidden" name="user" value="{{ app.request.get('user') }}">
<div class="col-md-12 px-4">
<div class="row">
<div id="filter" class="w-100 mb-3">
{% set catSlug = null %}
{% set citySlug = null %}
{% set pathInfo = app.request.pathinfo|split('/') %}
{% if pathInfo[1] == 'c' %}
{% set catSlug = pathInfo[2] %}
{% endif %}
{% if pathInfo|length is same as(4) %}
{% set citySlug = pathInfo[3] %}
{% endif %}
{% if catSlug %}
{% set formHtml %}
<form action="{{ url_route('adv_list_seo', [catSlug, citySlug]) }}" method="get" id="listFilterForm">
{% endset %}
{% endif %}
{{ formHtml }}
<div class="row">
<input type="hidden" name="cat" value="{{ app.request.get('cat') }}">
<input type="hidden" name="user" value="{{ app.request.get('user') }}">
<div class="col-md-12 px-4">
<div class="row">
<div id="filter" class="w-100 mb-3">
{{ addBlock('ads-list/partials/list-filter',{
'mainCats':mainCats,
'subCats':subCats,
'ranges':ranges,
'checkboxes':checkboxes,
'topfields' : topfields,
'selectDropdown' : selectDropdown,
'selectRange' : selectRange,
'selectImage' : selectImage,
'radio':radio,
'countries':countries,
'cities':cities,
'districts':districts,
'neighborhoods':neighborhoods,
'villages':villages,
'param':param,
'categoryId':categoryId,
'cityId':cityId,
'_ORDER_':['visiosoft.module.cats', 'visiosoft.module.location']
})|raw }}
{{ addBlock('ads-list/partials/list-filter',{
'mainCats':mainCats,
'subCats':subCats,
'ranges':ranges,
'checkboxes':checkboxes,
'topfields' : topfields,
'selectDropdown' : selectDropdown,
'selectRange' : selectRange,
'selectImage' : selectImage,
'radio':radio,
'countries':countries,
'cities':cities,
'districts':districts,
'neighborhoods':neighborhoods,
'villages':villages,
'param':param,
'categoryId':categoryId,
'cityId':cityId,
'_ORDER_':['visiosoft.module.cats', 'visiosoft.module.location']
})|raw }}
<!-- Price Filter Start -->
{% include 'visiosoft.module.advs::list/partials/price-filter' %}
<!-- Price Filter End -->
<!-- Price Filter Start -->
{% include 'visiosoft.module.advs::list/partials/price-filter' %}
<!-- Price Filter End -->
<!-- Date Filter Start -->
<div class="card mb-3">
<div class="card-header breadcrumb mb-0" id="dateHeading">
<h5 class="mb-0">
<button class="btn btn-link text-dark d-flex align-items-center" data-toggle="collapse" data-target="#date"
aria-expanded="true" aria-controls="date">
<img src="{{ img('visiosoft.module.advs::images/date-icon.svg').url }}" class="mr-2"
alt="date icon">
<span>{{ trans("visiosoft.module.advs::field.date.name") }}</span>
</button>
</h5>
</div>
<div id="dateContainer" class="collapse show overflow-auto" aria-labelledby="dateHeading"
style="max-height: 300px;">
<div class="d-flex flex-column p-3 m-0">
<div class="form-check py-1">
<input class="form-check-input"
{% if app.request.get('date') == 'day' %}
checked
{% endif %}
type="radio" name="date" id="dateDay"
value="day">
<label class="form-check-label" for="dateDay">
{{ trans("visiosoft.module.advs::field.in_the_last_24_hours.name") }}
</label>
{% if setting_value('visiosoft.module.advs::hide_date_filter') == false %}
<!-- Date Filter Start -->
<div class="card mb-3">
<div class="card-header breadcrumb mb-0" id="dateHeading">
<h5 class="mb-0">
<button class="btn btn-link text-dark d-flex align-items-center"
data-toggle="collapse" data-target="#dateContainer"
aria-expanded="true" aria-controls="dateContainer">
<img src="{{ img('visiosoft.module.advs::images/date-icon.svg').url }}"
class="mr-2"
alt="date icon">
<span>{{ trans("visiosoft.module.advs::field.date.name") }}</span>
</button>
</h5>
</div>
<div class="form-check py-1">
<input class="form-check-input"
{% if app.request.get('date') == 'week' %}
checked
{% endif %}
type="radio" name="date" id="dateWeek"
value="week">
<label class="form-check-label" for="dateWeek">
{{ trans("visiosoft.module.advs::field.in_the_last_week.name") }}
</label>
</div>
<div class="form-check py-1">
<input class="form-check-input"
{% if app.request.get('date') == 'month' %}
checked
{% endif %}
type="radio" name="date" id="dateMonth"
value="month">
<label class="form-check-label" for="dateMonth">
{{ trans("visiosoft.module.advs::field.in_the_last_month.name") }}
</label>
<div id="dateContainer" class="collapse show overflow-auto"
aria-labelledby="dateHeading"
style="max-height: 300px;">
<div class="d-flex flex-column p-3 m-0">
<div class="form-check py-1">
<input class="form-check-input"
{% if app.request.get('date') == 'day' %}
checked
{% endif %}
type="radio" name="date" id="dateDay"
value="day">
<label class="form-check-label" for="dateDay">
{{ trans("visiosoft.module.advs::field.in_the_last_24_hours.name") }}
</label>
</div>
<div class="form-check py-1">
<input class="form-check-input"
{% if app.request.get('date') == 'week' %}
checked
{% endif %}
type="radio" name="date" id="dateWeek"
value="week">
<label class="form-check-label" for="dateWeek">
{{ trans("visiosoft.module.advs::field.in_the_last_week.name") }}
</label>
</div>
<div class="form-check py-1">
<input class="form-check-input"
{% if app.request.get('date') == 'month' %}
checked
{% endif %}
type="radio" name="date" id="dateMonth"
value="month">
<label class="form-check-label" for="dateMonth">
{{ trans("visiosoft.module.advs::field.in_the_last_month.name") }}
</label>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Date Filter End -->
<!-- Date Filter End -->
{% endif %}
<!-- Media Filter Start -->
<div class="card mb-3">
<div class="card-header breadcrumb mb-0" id="mediaHeading">
<h5 class="mb-0">
<button class="btn btn-link text-dark" data-toggle="collapse" data-target="#media"
aria-expanded="true" aria-controls="media">
<i class="fa fa-camera"></i>
{{ trans("visiosoft.module.advs::field.photo.name") }}
, {{ trans("visiosoft.module.advs::field.video.name") }}
</button>
</h5>
</div>
<div id="mediaContainer" class="collapse show overflow-auto" aria-labelledby="mediaHeading"
style="max-height: 300px;">
<div class="d-flex p-3 m-0 flex-column">
<div class="form-check py-1">
<input class="form-check-input" type="checkbox"
{% if app.request.get('photo') == true %}
checked
{% endif %}
value="true" name="photo"
id="photo">
<label class="form-check-label" for="photo">
{{ trans("visiosoft.module.advs::field.ads_with_photo.name") }}
</label>
{% if setting_value('visiosoft.module.advs::hide_photo_filter') == false %}
<!-- Media Filter Start -->
<div class="card mb-3">
<div class="card-header breadcrumb mb-0" id="mediaHeading">
<h5 class="mb-0">
<button class="btn btn-link text-dark" data-toggle="collapse"
data-target="#mediaContainer"
aria-expanded="true" aria-controls="mediaContainer">
<i class="fa fa-camera"></i>
{{ trans("visiosoft.module.advs::field.photo.name") }}
, {{ trans("visiosoft.module.advs::field.video.name") }}
</button>
</h5>
</div>
<div class="form-check py-1">
<input class="form-check-input" type="checkbox"
{% if app.request.get('video') == true %}
checked
{% endif %}
value="true" name="video"
id="video">
<label class="form-check-label" for="video">
{{ trans("visiosoft.module.advs::field.ads_with_video.name") }}
</label>
<div id="mediaContainer" class="collapse show overflow-auto"
aria-labelledby="mediaHeading"
style="max-height: 300px;">
<div class="d-flex p-3 m-0 flex-column">
<div class="form-check py-1">
<input class="form-check-input" type="checkbox"
{% if app.request.get('photo') == true %}
checked
{% endif %}
value="true" name="photo"
id="photo">
<label class="form-check-label" for="photo">
{{ trans("visiosoft.module.advs::field.ads_with_photo.name") }}
</label>
</div>
<div class="form-check py-1">
<input class="form-check-input" type="checkbox"
{% if app.request.get('video') == true %}
checked
{% endif %}
value="true" name="video"
id="video">
<label class="form-check-label" for="video">
{{ trans("visiosoft.module.advs::field.ads_with_video.name") }}
</label>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Media Filter End -->
<!-- Media Filter End -->
{% endif %}
<!-- Map Filter Start -->
<div class="card mb-3">
<div class="card-header breadcrumb mb-0" id="mapHeading">
<h5 class="mb-0">
<button class="btn btn-link text-dark" data-toggle="collapse"
data-target="#mapFilter"
aria-expanded="true" aria-controls="mapFilter">
<i class="fa fa-map"></i>
{{ trans("visiosoft.module.advs::field.map.name") }}
</button>
</h5>
</div>
<div id="mapContainer" class="collapse show overflow-auto" aria-labelledby="mapHeading"
style="max-height: 300px;">
<div class="row p-3 m-0">
<div class="form-check py-1">
<input class="form-check-input" type="checkbox"
{% if app.request.get('map') == true %}
checked
{% endif %}
value="true" name="map"
id="mapFilter">
<label class="form-check-label" for="mapFilter">
{{ trans("visiosoft.module.advs::field.yes.name") }}
</label>
{% if setting_value('visiosoft.module.advs::hide_map_filter') == false %}
<!-- Map Filter Start -->
<div class="card mb-3">
<div class="card-header breadcrumb mb-0" id="mapHeading">
<h5 class="mb-0">
<button class="btn btn-link text-dark" data-toggle="collapse"
data-target="#mapContainer"
aria-expanded="true" aria-controls="mapContainer">
<i class="fa fa-map"></i>
{{ trans("visiosoft.module.advs::field.map.name") }}
</button>
</h5>
</div>
<div id="mapContainer" class="collapse show overflow-auto" aria-labelledby="mapHeading"
style="max-height: 300px;">
<div class="row p-3 m-0">
<div class="form-check py-1">
<input class="form-check-input" type="checkbox"
{% if app.request.get('map') == true %}
checked
{% endif %}
value="true" name="map"
id="mapFilter">
<label class="form-check-label" for="mapFilter">
{{ trans("visiosoft.module.advs::field.yes.name") }}
</label>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Map Filter End -->
<!-- Map Filter End -->
{% endif %}
<div class="card">
<div class="card-header bg-primary text-center" id="submitHeading">
<h5 class="mb-0">
<button class="btn btn-link text-white w-100">
<i class="fas fa-search"></i>
{{ trans("visiosoft.module.advs::field.search") }}
</button>
</h5>
<div class="card">
<div class="card-header bg-primary text-center" id="submitHeading">
<h5 class="mb-0">
<button class="btn btn-link text-white w-100">
<i class="fas fa-search"></i>
{{ trans("visiosoft.module.advs::field.search") }}
</button>
</h5>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</form>
</form>

View File

@ -1,41 +1,44 @@
<div class="card mb-3">
<div class="card-header breadcrumb mb-0" id="priceHeading">
<h5 class="mb-0">
<button class="btn btn-link text-dark d-flex align-items-center" data-toggle="collapse" data-target="#price"
aria-expanded="true" aria-controls="price">
<img src="{{ img('visiosoft.module.advs::images/price-icon.svg').url }}" alt="price icon" class="mr-2">
<span>{{ trans("visiosoft.module.advs::field.price.name") }}</span>
</button>
</h5>
</div>
<div id="price" class="collapse show overflow-auto" aria-labelledby="priceHeading"
data-parent="#filter"
style="max-height: 300px;">
<div class="row p-0 m-0">
{% set active_currencies = setting_value('visiosoft.module.advs::enabled_currencies') %}
<div class="col-md-4 p-1 m-0">
<input type="number" class="price-input form-control w-100"
value="{{ app.request.get('min_price') }}"
name="min_price" min="0"
placeholder="{{ trans('visiosoft.module.advs::field.min.name') }}">
</div>
<div class="col-md-4 p-1 pr-0 m-0">
<input class="price-input form-control w-100" type="number"
value="{{ app.request.get('max_price') }}"
name="max_price"
placeholder="{{ trans('visiosoft.module.advs::field.max.name') }}">
{% if setting_value('visiosoft.module.advs::hide_price_filter') == false %}
<div class="card mb-3">
<div class="card-header breadcrumb mb-0" id="priceHeading">
<h5 class="mb-0">
<button class="btn btn-link text-dark d-flex align-items-center" data-toggle="collapse"
data-target="#price"
aria-expanded="true" aria-controls="price">
<img src="{{ img('visiosoft.module.advs::images/price-icon.svg').url }}" alt="price icon"
class="mr-2">
<span>{{ trans("visiosoft.module.advs::field.price.name") }}</span>
</button>
</h5>
</div>
<div id="price" class="collapse show overflow-auto" aria-labelledby="priceHeading"
style="max-height: 300px;">
<div class="row p-0 m-0">
{% set active_currencies = setting_value('visiosoft.module.advs::enabled_currencies') %}
<div class="col-md-4 p-1 m-0">
<input type="number" class="price-input form-control w-100"
value="{{ app.request.get('min_price') }}"
name="min_price" min="0"
placeholder="{{ trans('visiosoft.module.advs::field.min.name') }}">
</div>
<div class="col-md-4 p-1 pr-0 m-0">
<input class="price-input form-control w-100" type="number"
value="{{ app.request.get('max_price') }}"
name="max_price"
placeholder="{{ trans('visiosoft.module.advs::field.max.name') }}">
</div>
<div class="col-md-4 py-1 px-0">
<select name="currency" id="currency" class="form-control">
{% for currency in active_currencies %}
<option {{ app.request.get('currency') == currency ? 'selected' }} value="{{ currency }}">
{{ currency_symbol(currency) }}
</option>
{% endfor %}
</select>
</div>
</div>
<div class="col-md-4 py-1 px-0">
<select name="currency" id="currency" class="form-control">
{% for currency in active_currencies %}
<option {{ app.request.get('currency') == currency ? 'selected' }} value="{{ currency }}">
{{ currency_symbol(currency) }}
</option>
{% endfor %}
</select>
</div>
</div>
</div>
</div>
{% endif %}

View File

@ -11,16 +11,18 @@ class appendRequestURL
protected $request;
protected $url;
protected $new_parameters;
protected $remove_parameters;
/**
* appendRequestURL constructor.
* @param $request
*/
public function __construct($request, $url, $new_parameters = [])
public function __construct($request, $url, $new_parameters = [], $remove_parameters = [])
{
$this->url = $url;
$this->request = $request;
$this->new_parameters = $new_parameters;
$this->remove_parameters = $remove_parameters;
}
/**
@ -28,23 +30,23 @@ class appendRequestURL
*/
public function handle()
{
if (count($this->new_parameters) === 0 && count($this->request) === 0) {
return $this->url;
} elseif (count($this->new_parameters) > 0 && count($this->request) > 0) {
return $this->url
. (Str::contains($this->url, '?') ? '&' : '?')
. Arr::query($this->appends(array_merge($this->request, $this->new_parameters)));
} elseif (count($this->new_parameters) > 0 && count($this->request) === 0) {
return $this->url
. (Str::contains($this->url, '?') ? '&' : '?')
. Arr::query($this->appends($this->new_parameters));
} elseif (count($this->new_parameters) === 0 && count($this->request) > 0) {
return $this->url
. (Str::contains($this->url, '?') ? '&' : '?')
. Arr::query($this->appends($this->request));
$request = $this->removeParameters($this->request);
$count_newParameters = count($this->new_parameters);
$count_request = count($this->request);
if ($count_newParameters > 0) {
return ($count_request > 0) ? $this->createURL(array_merge($request, $this->new_parameters)) : $this->createURL($this->new_parameters);
} else {
return ($count_request > 0) ? $this->createURL($request) : $this->url;
}
}
public function createURL($append)
{
return $this->url . (Str::contains($this->url, '?') ? '&' : '?') . Arr::query($this->appends($append));
}
/**
* @param $key
* @param null $value
@ -87,4 +89,13 @@ class appendRequestURL
return $this;
}
public function removeParameters(array $array)
{
foreach ($this->remove_parameters as $parameter) {
unset($array[$parameter]);
}
return $array;
}
}

View File

@ -57,9 +57,9 @@ class AdvsModulePlugin extends Plugin
),
new \Twig_SimpleFunction(
'appendRequestURL',
function ($request, $url, $new_parameters) {
function ($request, $url, $new_parameters, $removeParams = []) {
return $this->dispatch(new appendRequestURL($request, $url, $new_parameters));
return $this->dispatch(new appendRequestURL($request, $url, $new_parameters, $removeParams));
}
),
new \Twig_SimpleFunction(

View File

@ -35,14 +35,20 @@ class redirectDiffrentLang
$setting_language = setting_value('streams::default_locale');
$current_language = $request->session()->get('_locale', $setting_language);
$request_url = ltrim($request->getRequestUri(), '/');
// If the segment(1) is admin and language parameters is not null, no forwarding will be made.
if ($request->segment(1) == "admin" and in_array($current_language, explode('/', $original_url))) {
return $this->redirect->to($request->fullUrl());
}
if ($current_language != $setting_language) {
if ($request_url != "" and $original_url != '/' . $current_language . '/' . $request_url) {
// If the method is get, no forwarding will be made.
// If the segment(1) is admin, no forwarding will be made.
if ($request->method() == "GET" and $request->segment(1) != "admin" and $request_url != "" and $original_url != '/' . $current_language . '/' . $request_url) {
return $this->redirect->to('/' . $current_language . '/' . $request_url);
}
} else {
if ($request_url == "" and '/' . $current_language != $original_url) {
$this->redirect->to($current_language);
}
}
return $next($request);

View File

@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="{{ config('app.locale') }}">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
{% block styles %}{% endblock %}
</head>
<body>
<div class="container" style="max-width: 800px;">
{% include "theme::partials/messages" %}
{% block content %}
{% endblock %}
</div>
</body>
</html>

View File

@ -0,0 +1,37 @@
<!doctype html>
<!--[if lt IE 7]>
<html class="nojs ms lt_ie7" lang="en"><![endif]-->
<!--[if IE 7]>
<html class="nojs ms ie7" lang="en"><![endif]-->
<!--[if IE 8]>
<html class="nojs ms ie8" lang="en"><![endif]-->
<!--[if gt IE 8]>
<html class="nojs ms" lang="en"><![endif]-->
<html>
<head>
{% include "visiosoft.theme.base::partials/metadata" %}
{% block styles %}{% endblock %}
</head>
<body>
{% include "visiosoft.theme.base::partials/header" %}
<main id="main">
<div class="container">
{% include "visiosoft.theme.base::partials/messages" %}
{% block content %}{% endblock %}
</div>
</main>
{% include "visiosoft.theme.base::partials/footer" %}
{% include "visiosoft.theme.base::partials/settings" %}
</body>
</html>

View File

@ -0,0 +1,5 @@
<?php
return [
'categories_mass_delete_success' => 'Categories and related sub-categories has been deleted successfully!',
];

View File

@ -8,8 +8,7 @@
</button>
</h5>
</div>
<div id="category" class="collapse show overflow-auto" aria-labelledby="categoryHeading"
data-parent="#filter" style="max-height: 300px;">
<div id="category" class="collapse show overflow-auto" aria-labelledby="categoryHeading" style="max-height: 300px;">
<div class="list-group">
{% for maincat in params.mainCats %}
{% set name = maincat['val'] %}
@ -29,9 +28,9 @@
{% set citySlug = pathInfo[3] %}
{% endif %}
<a href="{% if(viewType != "map") %}
{{ appendRequestURL(request_query(),url_route('adv_list_seo', [catId.slug, citySlug]),{}) }}
{{ appendRequestURL(request_query(),url_route('adv_list_seo', [catId.slug, citySlug]),{},['page']) }}
{% else %}
{{ appendRequestURL(request_query(),url_route('advs_map_list'),{'cat':id}) }}
{{ appendRequestURL(request_query(),url_route('advs_map_list'),{'cat':id},['page']) }}
{% endif %}" class="list-group-item list-group-item-action text-truncate">
<i class="fas fa-dot-circle"></i>
{{ name }}
@ -41,9 +40,9 @@
{% if subcat.parent_category_id == maincat['id'] %}
{% set subCatId = entries('cats', 'category').find(subcat.id) %}
<a href="{% if(viewType != "map") %}
{{ appendRequestURL(request_query(),url_route('adv_list_seo', [subCatId.slug, citySlug]),{}) }}
{{ appendRequestURL(request_query(),url_route('adv_list_seo', [subCatId.slug, citySlug]),{},['page']) }}
{% else %}
{{ appendRequestURL(request_query(),url_route('advs_map_list'),{'cat':subcat.id}) }}
{{ appendRequestURL(request_query(),url_route('advs_map_list'),{'cat':subcat.id},['page']) }}
{% endif %}" class="list-group-item list-group-item-action text-truncate">
{{ subcat.name }}
</a>

View File

@ -1,6 +1,7 @@
<?php namespace Visiosoft\CatsModule\Category\Table;
use Anomaly\Streams\Platform\Ui\Table\TableBuilder;
use Visiosoft\CatsModule\Category\Table\Handler\Delete;
class CategoryTableBuilder extends TableBuilder
{
@ -68,6 +69,9 @@ class CategoryTableBuilder extends TableBuilder
* @var array|string
*/
protected $actions = [
'delete' => [
'handler' => Delete::class
]
];
/**

View File

@ -0,0 +1,26 @@
<?php namespace Visiosoft\CatsModule\Category\Table\Handler;
use Anomaly\Streams\Platform\Ui\Table\Component\Action\ActionHandler;
use Visiosoft\CatsModule\Category\Contract\CategoryRepositoryInterface;
use Visiosoft\CatsModule\Category\Table\CategoryTableBuilder;
class Delete extends ActionHandler
{
public function handle(
CategoryTableBuilder $builder, array $selected,
CategoryRepositoryInterface $categoryRepository
)
{
try {
foreach ($selected as $id) {
$categoryRepository->DeleteCategories($id);
}
if ($selected) {
$this->messages->success(trans('visiosoft.module.cats::message.categories_mass_delete_success'));
}
} catch (\Exception $e) {
$this->messages->error($e->getMessage());
}
}
}

View File

@ -6,4 +6,34 @@ return [
'type' => 'anomaly.field_type.textarea',
'input_view' => 'visiosoft.theme.defaultadmin::admin/navigation/settings',
],
"icon" => [
"type" => "anomaly.field_type.file",
"config" => [
"folders" => ['images'],
]
],
"title" => [
"type" => "anomaly.field_type.text",
"config" => [
"default_value" => 'OpenClassify',
]
],
"sidebar_main_color" => [
"type" => "anomaly.field_type.colorpicker",
"config" => [
"default_value" => '#252525',
]
],
"sidebar_secondary_color" => [
"type" => "anomaly.field_type.colorpicker",
"config" => [
"default_value" => '#333333',
]
],
"active_sidebar_border_color" => [
"type" => "anomaly.field_type.colorpicker",
"config" => [
"default_value" => '#c61db4',
]
],
];

View File

@ -769,8 +769,8 @@ pre code {
.container-fluid {
margin-left: auto;
margin-right: auto;
/*padding-left: 15px;*/
/*padding-right: 15px;*/
padding-left: 15px;
padding-right: 15px;
}
.row {

View File

@ -26,7 +26,7 @@
margin-top: 0;
position: fixed;
overflow-x: scroll;
background: #333333;
background: {{ setting_value('visiosoft.theme.defaultadmin::sidebar_secondary_color') }};
padding-bottom: 70px;
box-shadow: 2px 0 0 rgba(66, 66, 66, 0.1);
}
@ -218,8 +218,8 @@
#topbar .logo span {
display: none;
}
#topbar .logo svg {
width: 22px;
#topbar .logo svg, #topbar .logo img {
max-width: 40px;
height: 40px;
margin-top: -9px;
vertical-align: middle;
@ -398,7 +398,7 @@ body.expand #topbar .topbar-left .logo span {
position: fixed;
overflow-x: scroll;
overflow-y: hidden;
background: #252525;
background: {{ setting_value('visiosoft.theme.defaultadmin::sidebar_main_color') }};
padding-bottom: 70px;
transition: width 200ms cubic-bezier(0.075, 0.82, 0.165, 1);
}
@ -456,9 +456,9 @@ body.expand #topbar .topbar-left .logo span {
display: none;
}
#sidebar > ul > li.active {
background: #333333;
background: {{ setting_value('visiosoft.theme.defaultadmin::sidebar_secondary_color') }};
box-sizing: border-box;
border-left: 3px solid #ffffff;
border-left: 3px solid {{ setting_value('visiosoft.theme.defaultadmin::active_sidebar_border_color') }} !important;
}
#sidebar > ul > li.active a {
color: #eeeeee;
@ -2625,9 +2625,9 @@ body {
#login .login-container .logo {
display: none;
}
#login .login-container .logo svg {
#login .login-container .logo svg, #login .login-container .logo img {
width: 45px;
height: 82px;
max-height: 82px;
fill: #ffffff;
margin-top: -30px;
vertical-align: middle;
@ -2665,9 +2665,9 @@ body {
text-align: center;
font-family: "Montserrat", sans-serif;
}
#login .logo svg {
#login .logo svg, #login .logo img {
width: 45px;
height: 82px;
max-height: 82px;
margin-top: -30px;
vertical-align: middle;
}
@ -2719,9 +2719,9 @@ body {
display: inherit;
margin-bottom: 2rem;
}
#login .login-container .logo svg {
#login .login-container .logo svg, #login .login-container .logo img {
width: 55px;
height: 100px;
max-height: 100px;
}
}
@media (max-width: 767px) {

View File

@ -11,4 +11,19 @@ return [
'warning' => 'The first accessible navigation item is used as the <strong>home</strong> area.',
'reorder' => 'Drag and drop the primary navigation items in the <strong>sidebar</strong> to reorder them.',
],
"icon" => [
'name' => 'Icon',
],
"title" => [
'name' => 'Title',
],
"sidebar_main_color" => [
'name' => 'Sidebar Main Color',
],
"sidebar_secondary_color" => [
'name' => 'Sidebar Secondary Color',
],
"active_sidebar_border_color" => [
'name' => 'Active Sidebar Border Color',
]
];

View File

@ -4,8 +4,12 @@
<div class="logo-container">
<div class="logo">
{{ img('theme::img/icon.svg').data|raw }}
OpenClassify
{% if setting_value('visiosoft.theme.defaultadmin::icon') %}
<img src="{{ file(setting_value('visiosoft.theme.defaultadmin::icon')).url }}" alt="site icon">
{% else %}
{{ img('theme::img/icon.svg').data|raw }}
{% endif %}
{{ setting_value('visiosoft.theme.defaultadmin::title') }}
</div>
<div class="overlay"></div>
</div>
@ -14,7 +18,11 @@
<div class="login-wrapper container-fluid">
<div class="logo">
{{ img('theme::img/icon.svg').data|raw }}
{% if setting_value('visiosoft.theme.defaultadmin::icon') %}
<img src="{{ file(setting_value('visiosoft.theme.defaultadmin::icon')).url }}" alt="site icon">
{% else %}
{{ img('theme::img/icon.svg').data|raw }}
{% endif %}
</div>
<div class="col-sm-12 offset-sm-6">

View File

@ -2,8 +2,12 @@
<div class="topbar-left">
<a href="/admin" class="logo variant-logo">
{{ img('theme::img/icon.svg').data|raw }}
<span>OpenClassify</span>
{% if setting_value('visiosoft.theme.defaultadmin::icon') %}
<img src="{{ file(setting_value('visiosoft.theme.defaultadmin::icon')).url }}" alt="site icon">
{% else %}
{{ img('theme::img/icon.svg').data|raw }}
{% endif %}
<span>{{ setting_value('visiosoft.theme.defaultadmin::title') }}</span>
</a>
</div>

View File

@ -22,6 +22,12 @@ return [
'google_map_key', 'map_coordinates_long', 'map_coordinates_lat'
],
],
'filter' => [
'title' => 'visiosoft.module.location::section.filter',
'fields' => [
'hide_location_filter'
],
],
'html' => [
'html' => '{% include "visiosoft.module.location::settings/field" %}',
],

View File

@ -68,4 +68,11 @@ return [
'default_value' => '40.97817786299617',
],
],
'hide_location_filter' => [
'type' => 'anomaly.field_type.boolean',
'config' => [
'default_value' => false,
],
],
];

View File

@ -19,4 +19,5 @@ return [
'general' => 'General',
'map' => 'Map',
'setting' => 'Setting',
'filter' => 'Filter',
];

View File

@ -40,4 +40,8 @@ return [
'map_coordinates_lat' => [
'name' => 'Default Lat',
],
'hide_location_filter' => [
'name' => 'Hide Location Filter',
],
];

View File

@ -1,23 +1,24 @@
{% if setting_value('visiosoft.module.location::list_page_location') %}
<div class="card mb-3">
<div class="card-header breadcrumb mb-0" id="locationHeading">
<h5 class="mb-0">
<button class="btn btn-link text-dark d-flex align-items-center" data-toggle="collapse"
data-target="#location" aria-expanded="true" aria-controls="location">
<img src="{{ img('visiosoft.module.location::images/location-icon.svg').url }}" class="mr-2"
alt="location icon">
<span>{{ trans("visiosoft.module.location::addon.title") }}</span>
</button>
</h5>
{% if setting_value('visiosoft.module.location::hide_location_filter') == false %}
{% if setting_value('visiosoft.module.location::list_page_location') %}
<div class="card mb-3">
<div class="card-header breadcrumb mb-0" id="locationHeading">
<h5 class="mb-0">
<button class="btn btn-link text-dark d-flex align-items-center" data-toggle="collapse"
data-target="#location" aria-expanded="true" aria-controls="location">
<img src="{{ img('visiosoft.module.location::images/location-icon.svg').url }}" class="mr-2"
alt="location icon">
<span>{{ trans("visiosoft.module.location::addon.title") }}</span>
</button>
</h5>
</div>
<div id="location" class="collapse show overflow-auto" aria-labelledby="locationHeading">
{% include "visiosoft.module.location::ads-list/partials/location-fields" %}
</div>
</div>
<div id="location" class="collapse show overflow-auto" aria-labelledby="locationHeading"
data-parent="#filter">
{% include "visiosoft.module.location::ads-list/partials/location-fields" %}
</div>
</div>
<script>
var select_trans = "{{ trans('visiosoft.module.location::field.pick_option.name') }}";
</script>
{{ asset_add("scripts.js", "visiosoft.module.location::js/filterLocation.js") }}
{{ asset_add("styles.css", "visiosoft.module.location::css/filterLocation.css") }}
<script>
var select_trans = "{{ trans('visiosoft.module.location::field.pick_option.name') }}";
</script>
{{ asset_add("scripts.js", "visiosoft.module.location::js/filterLocation.js") }}
{{ asset_add("styles.css", "visiosoft.module.location::css/filterLocation.css") }}
{% endif %}
{% endif %}