Merge pull request #1044 from openclassify/vedat

#3804 fixed list
This commit is contained in:
Muammer Top 2021-04-19 12:38:50 +03:00 committed by GitHub
commit 3cc67b4b6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 89 additions and 82 deletions

View File

@ -35,6 +35,7 @@
</a>
{{ addBlock('ad-detail/seller/action',{'seller_id':adv.owner_id})|raw }}
</div>
{% if setting_value('visiosoft.module.advs::market_place') %}
<div class="col-md-12 m-2">
<i class="fas fa-hashtag"></i>
{{ trans('visiosoft.module.advs::field.ad_id') }}:{{ adv.id }}
@ -43,6 +44,7 @@
<i class="far fa-clock text-dark"></i>
{{ adv.created_at|date('d/m/Y') }}
</div>
{% endif %}
<!-- Detail With Block -->
{{ addBlock('ad-detail/details',{'adv':adv, 'options':options, 'configurations':configurations})|raw }}

View File

@ -25,7 +25,6 @@
</div>
</div>
<div class="ml-4 mt-1">
<p class="id-data">#{{ adv.id }}</p>
<h6 class="mb-1">
<a href="{{ adv.detail_url }}">{{ adv.name }}</a>
</h6>
@ -38,7 +37,9 @@
{% if showLocation %}
<p class="location-data">{{ adv.country_name }} / {{ adv.city_name }}</p>
{% endif %}
<p class="date-data">{{ adv.publish_at.value|date('d F Y') }}</p>
{% if setting_value('visiosoft.module.advs::market_place') %}
<p class="date-data">{{ adv.publish_at.value|date('d/m/Y') }}</p>
{% endif %}
</div>
</div>
</div>

View File

@ -8,10 +8,13 @@
<th class="text-nowrap" colspan="2">{{ trans('visiosoft.module.advs::field.ad_title') }}</th>
{% if listLocation %}
<th class="text-nowrap">
{{ trans('visiosoft.module.advs::field.city.name') }} / {{ trans('visiosoft.module.advs::field.district.name') }}
{{ trans('visiosoft.module.advs::field.city.name') }}
/ {{ trans('visiosoft.module.advs::field.district.name') }}
</th>
{% endif %}
{% if setting_value('visiosoft.module.advs::market_place') %}
<th class="text-nowrap">{{ trans('visiosoft.module.advs::field.listing_date') }}</th>
{% endif %}
<th class="text-nowrap">{{ trans('visiosoft.module.advs::field.price.name') }}</th>
</tr>
</thead>
@ -29,7 +32,6 @@
</a>
</td>
<td class="text-left pl-2">
<p class="id-data">#{{ adv.id }}</p>
<h6 class="mb-1">
<a href="{{ adv.detail_url }}">{{ adv.name }}</a>
</h6>
@ -46,10 +48,12 @@
<p>{{ adv.city_name }}</p>
</td>
{% endif %}
{% if setting_value('visiosoft.module.advs::market_place') %}
<td class="date-data">
<p>{{ adv.publish_at.value|date('d F') }}</p>
<p>{{ adv.publish_at.value|date('d/m') }}</p>
<p>{{ adv.publish_at.value|date('Y') }}</p>
</td>
{% endif %}
<td class="price-data">
{% if not hideStandard %}
<p class="text-nowrap">

View File

@ -280,15 +280,8 @@ class AdvsController extends PublicController
if ($category) {
$mainCats = $this->category_repository->getParentCategoryById($category->id);
$subCats = $this->category_repository->getCategoryById($category->id);
//if there is no subcategory
if (count($subCats) < 1 and count($mainCats) > 1) {
//fetch subcategories of the last category
$subCats = $this->category_repository->getCategoryById($mainCats[1]['id']);
unset($mainCats[0]);//remove last category
}
$mainCats = $this->category_repository->getParentCategoryByOrder($category->id);
$subCats = $category->getSubCategories();
$allCats = false;
} else {
$mainCats = $this->category_repository->getMainCategories();
@ -1106,6 +1099,7 @@ class AdvsController extends PublicController
}
return $response;
}
public function stockControl(Request $request, AdvRepositoryInterface $advRepository)
{
$quantity = $request->quantity;

View File

@ -4,7 +4,7 @@
<li>
<div class="d-flex">
{% if (not categoryId) or (loop.first and categoryId) %}
{% if (not category) or (loop.first and category) %}
{% set categoryIcon = (maincat.icon.value) ? maincat.icon.value : img('visiosoft.module.advs::images/listing/sample-cat-icon.svg').url %}
<img src="{{ categoryIcon }}" alt="{{ main_category.name }}" class="img-responsive">
{% endif %}

View File

@ -102,12 +102,16 @@ class CategoryRepository extends EntryRepository implements CategoryRepositoryIn
$parents_count++;
}
}
return $parents;
}
return null;
}
public function getParentCategoryByOrder($id)
{
return array_reverse($this->getParentCategoryById($id));
}
public function getLevelById($id)
{
$parents = $this->getParentCategoryById($id);

View File

@ -16,6 +16,8 @@ interface CategoryRepositoryInterface extends EntryRepositoryInterface
public function getParentCategoryById($id);
public function getParentCategoryByOrder($id);
public function getLevelById($id);
public function getDeletedCategories();

View File

@ -64,7 +64,7 @@ class ValueTableBuilder extends TableBuilder
'show_headers' => false,
'sortable_headers' => false,
'table_view' => 'anomaly.field_type.file::table',
'no_results_message' => 'visiosoft.field_type.singlefile::message.no_file_selected',
'no_results_message' => null,
];
/**