mirror of
https://github.com/openclassify/openclassify.git
synced 2026-02-09 06:46:08 -06:00
customfields repair list page && customfields bootsrap 4 template
This commit is contained in:
parent
26f9457a10
commit
7dc34dc411
@ -1,7 +1,6 @@
|
|||||||
<div class="description-info">
|
<div class="description-info">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
||||||
|
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<nav>
|
<nav>
|
||||||
<div class="nav nav-tabs nav-fill ad-detail-tabs" id="nav-tab" role="tablist">
|
<div class="nav nav-tabs nav-fill ad-detail-tabs" id="nav-tab" role="tablist">
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div id="filter" class="w-100 mb-3">
|
<div id="filter" class="w-100 mb-3">
|
||||||
|
|
||||||
{{ addBlock('ads-list/partials/list-filter',{'mainCats':mainCats,'subCats':subCats})|raw }}
|
{{ addBlock('ads-list/partials/list-filter',{'mainCats':mainCats,'subCats':subCats,'ranges':ranges,'checkboxes':checkboxes})|raw }}
|
||||||
|
|
||||||
<div class="card mb-3">
|
<div class="card mb-3">
|
||||||
<div class="card-header breadcrumb mb-0" id="priceHeading">
|
<div class="card-header breadcrumb mb-0" id="priceHeading">
|
||||||
|
|||||||
@ -14,6 +14,7 @@
|
|||||||
<th scope="col"
|
<th scope="col"
|
||||||
class="text-center align-middle">{{ trans('visiosoft.module.advs::field.advs_list_table_thead.location_city') }}
|
class="text-center align-middle">{{ trans('visiosoft.module.advs::field.advs_list_table_thead.location_city') }}
|
||||||
/ {{ trans('visiosoft.module.advs::field.advs_list_table_thead.location_country') }}</th>
|
/ {{ trans('visiosoft.module.advs::field.advs_list_table_thead.location_country') }}</th>
|
||||||
|
{{ addBlock('ads-list/table-column',{'seenList':seenList})|raw }}
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -43,6 +44,7 @@
|
|||||||
<small>{{ adv.city_name }} / {{ adv.country_name }}</small>
|
<small>{{ adv.city_name }} / {{ adv.country_name }}</small>
|
||||||
</td>
|
</td>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{{ addBlock('ads-list/table-row',{'seenList':seenList,'adv':adv})|raw }}
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
|
|||||||
@ -80,7 +80,11 @@ class AdvRepository extends EntryRepository implements AdvRepositoryInterface
|
|||||||
}
|
}
|
||||||
if (!empty($param['cat'])) {
|
if (!empty($param['cat'])) {
|
||||||
$cat = new CategoryModel();
|
$cat = new CategoryModel();
|
||||||
$catLevel = $cat->getCatLevel($param['cat']);
|
$cat_d = $cat->find($param['cat']);
|
||||||
|
if ($cat_d->parent_category_id == null)
|
||||||
|
$catLevel = 1;
|
||||||
|
else
|
||||||
|
$catLevel = $cat->getCatLevel($param['cat']);
|
||||||
$catLevel = "cat" . $catLevel;
|
$catLevel = "cat" . $catLevel;
|
||||||
$query = $query->where($catLevel, $param['cat']);
|
$query = $query->where($catLevel, $param['cat']);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -194,6 +194,8 @@ class AdvsController extends PublicController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (isset($param['cat']) and $param['cat'] != "") {
|
if (isset($param['cat']) and $param['cat'] != "") {
|
||||||
$cat = $param['cat'];
|
$cat = $param['cat'];
|
||||||
$seo_keywords = $this->category_model->getMeta_keywords($param['cat']);
|
$seo_keywords = $this->category_model->getMeta_keywords($param['cat']);
|
||||||
@ -214,7 +216,6 @@ class AdvsController extends PublicController
|
|||||||
if ($isActiveCustomFields) {
|
if ($isActiveCustomFields) {
|
||||||
$returnvalues = app('Visiosoft\CustomfieldsModule\Http\Controller\cfController')->index($mainCats, $subCats);
|
$returnvalues = app('Visiosoft\CustomfieldsModule\Http\Controller\cfController')->index($mainCats, $subCats);
|
||||||
$checkboxes = $returnvalues['checkboxes'];
|
$checkboxes = $returnvalues['checkboxes'];
|
||||||
$textfields = $returnvalues['textfields'];
|
|
||||||
$topfields = $returnvalues['topfields'];
|
$topfields = $returnvalues['topfields'];
|
||||||
$ranges = $returnvalues['ranges'];
|
$ranges = $returnvalues['ranges'];
|
||||||
}
|
}
|
||||||
@ -224,7 +225,7 @@ class AdvsController extends PublicController
|
|||||||
$userProfile = $this->profile_repository->getProfile($user->id);
|
$userProfile = $this->profile_repository->getProfile($user->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
$compact = compact('advs', 'countries', 'mainCats', 'subCats', 'textfields', 'checkboxes', 'request',
|
$compact = compact('advs', 'countries', 'mainCats', 'subCats', 'checkboxes', 'request',
|
||||||
'user', 'userProfile', 'featured_advs', 'type', 'topfields', 'ranges', 'seenList', 'searchedCountry');
|
'user', 'userProfile', 'featured_advs', 'type', 'topfields', 'ranges', 'seenList', 'searchedCountry');
|
||||||
|
|
||||||
Cookie::queue(Cookie::make('last_search', $this->requestHttp->getRequestUri(), 84000));
|
Cookie::queue(Cookie::make('last_search', $this->requestHttp->getRequestUri(), 84000));
|
||||||
|
|||||||
@ -104,7 +104,7 @@ class CategoryModel extends CatsCategoryEntryModel implements CategoryInterface
|
|||||||
|
|
||||||
$cats = $cats->leftJoin('cats_category_translations', function ($join) {
|
$cats = $cats->leftJoin('cats_category_translations', function ($join) {
|
||||||
$join->on('cats_category.id', '=', 'cats_category_translations.entry_id');
|
$join->on('cats_category.id', '=', 'cats_category_translations.entry_id');
|
||||||
$join->where('cats_category_translations.locale', '=', Request()->session()->get('_locale'));
|
$join->where('cats_category_translations.locale', '=', Request()->session()->get('_locale', setting_value('streams::default_locale')));
|
||||||
});
|
});
|
||||||
$cats = $cats->select('cats_category.*', 'cats_category_translations.name as name');
|
$cats = $cats->select('cats_category.*', 'cats_category_translations.name as name');
|
||||||
$cats = $cats->orderBy('id', 'DESC')
|
$cats = $cats->orderBy('id', 'DESC')
|
||||||
@ -148,4 +148,24 @@ class CategoryModel extends CatsCategoryEntryModel implements CategoryInterface
|
|||||||
{
|
{
|
||||||
return $this->find($cat_id)->name;
|
return $this->find($cat_id)->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getMains($id)
|
||||||
|
{
|
||||||
|
$categories = array();
|
||||||
|
$z = 1;
|
||||||
|
for ($i = 1; $i <= $z; $i++) {
|
||||||
|
$main = $this->find($id);
|
||||||
|
$new = array();
|
||||||
|
$new['id'] = $main->id;
|
||||||
|
$new['val'] = $main->name;
|
||||||
|
$categories[] = $new;
|
||||||
|
if ($main->parent_category_id != null) {
|
||||||
|
$id = $main->parent_category_id;
|
||||||
|
$z++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$categories = array_reverse($categories);
|
||||||
|
unset($categories[count($categories) - 1]);
|
||||||
|
return $categories;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,8 +5,9 @@ use Anomaly\Streams\Platform\Model\Cats\CatsCategoryEntryModel;
|
|||||||
|
|
||||||
class CategoryPresenter extends EntryPresenter
|
class CategoryPresenter extends EntryPresenter
|
||||||
{
|
{
|
||||||
public function getAdvsListUrl($attributes) {
|
public function getAdvsListUrl($attributes)
|
||||||
return \route('visiosoft.module.advs::list', "cat=".$attributes);
|
{
|
||||||
|
return \route('visiosoft.module.advs::list', "cat=" . $attributes);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCategoryName($id)
|
public function getCategoryName($id)
|
||||||
@ -23,23 +24,7 @@ class CategoryPresenter extends EntryPresenter
|
|||||||
|
|
||||||
public function getMains($id)
|
public function getMains($id)
|
||||||
{
|
{
|
||||||
$categories = array();
|
$category_model = new CategoryModel();
|
||||||
$z = 1;
|
return $category_model->getMains($id);
|
||||||
for($i = 1; $i <= $z; $i++)
|
|
||||||
{
|
|
||||||
$main = $this->find($id);
|
|
||||||
$new = array();
|
|
||||||
$new['id'] = $main->id;
|
|
||||||
$new['val'] = $this->getname($main->id);
|
|
||||||
$categories[] = $new;
|
|
||||||
if($main->parent_category_id != null)
|
|
||||||
{
|
|
||||||
$id = $main->parent_category_id;
|
|
||||||
$z++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$categories = array_reverse($categories);
|
|
||||||
unset($categories[count($categories)-1]);
|
|
||||||
return $categories;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user