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

View File

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

View File

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

View File

@ -280,15 +280,8 @@ class AdvsController extends PublicController
if ($category) { if ($category) {
$mainCats = $this->category_repository->getParentCategoryById($category->id); $mainCats = $this->category_repository->getParentCategoryByOrder($category->id);
$subCats = $this->category_repository->getCategoryById($category->id); $subCats = $category->getSubCategories();
//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
}
$allCats = false; $allCats = false;
} else { } else {
$mainCats = $this->category_repository->getMainCategories(); $mainCats = $this->category_repository->getMainCategories();
@ -1034,7 +1027,7 @@ class AdvsController extends PublicController
} }
$adv->update($params); $adv->update($params);
$this->event->dispatch(new EditedAdCategory($before_editing_ad_params,$adv)); $this->event->dispatch(new EditedAdCategory($before_editing_ad_params, $adv));
$this->messages->success(trans('visiosoft.module.advs::message.updated_category_msg')); $this->messages->success(trans('visiosoft.module.advs::message.updated_category_msg'));
return redirect('/advs/edit_advs/' . $id); return redirect('/advs/edit_advs/' . $id);
} }
@ -1106,6 +1099,7 @@ class AdvsController extends PublicController
} }
return $response; return $response;
} }
public function stockControl(Request $request, AdvRepositoryInterface $advRepository) public function stockControl(Request $request, AdvRepositoryInterface $advRepository)
{ {
$quantity = $request->quantity; $quantity = $request->quantity;

View File

@ -4,7 +4,7 @@
<li> <li>
<div class="d-flex"> <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 %} {% 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"> <img src="{{ categoryIcon }}" alt="{{ main_category.name }}" class="img-responsive">
{% endif %} {% endif %}

View File

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

View File

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

View File

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