This commit is contained in:
Dia 2022-01-20 16:30:34 +03:00
commit 926e30eb31
12 changed files with 139 additions and 14 deletions

View File

@ -1,3 +1,13 @@
$(".clickable-row").click(function () {
window.location = $(this).data("href");
});
$('.hover-area').mouseover((e) => {
var el = $(e);
var img = $(`.${$(el[0].target).data('id')}`);
img.siblings('img').hide();
img.show();
});

View File

@ -156,6 +156,7 @@ return [
'phone_gsm' => 'Gsm Phone',
'phone_office' => 'Office Phone',
'add_to_favorites' => "Add to Favorites",
'add_to_cart'=> "Add to Cart",
'send' => 'Send',
'search_name' => 'Search Name',
'my_favorite_searches' => 'Favorite Searches',

View File

@ -156,6 +156,7 @@ return [
'phone_gsm' => 'Cep Telefonu',
'phone_office' => 'Sabit telefon',
'add_to_favorites' => "Favorilere Ekle",
'add_to_cart'=> "Sepete Ekle",
'send' => 'Gönder',
'search_name' => 'Arama Adı',
'my_favorite_searches' => 'Favori Aramalar',

View File

@ -13,8 +13,18 @@
<div class="col-xl-4 col-6 p-sm-3 p-0">
<div class="d-flex flex-column product-hb gallery-card pb-3 px-1 pt-1 border shadow-sm rounded">
<div class="product-image-hb p-sm-3 p-1">
<a href="{{ adv.detail_url }}">
<img class="product-image-in" src="{{ adv.cover_photo }}" alt="{{ adv.name }}">
<a href="{{ adv.detail_url }}" class="imgs" id="{{ adv.id }}">
{% set slicedPhotos = adv.getViewPhotoUrl|slice(0,3) %}
{% for key,photo in slicedPhotos %}
<img src="{{ photo }}" class="product-image-in ads-img img-{{ adv.id ~ '-' ~ key }}" alt="">
{% endfor %}
<div class="hover-area">
{% for key, photo in slicedPhotos %}
<div class="hover-{{ key }}" data-parent="{{ adv.id }}" data-id="img-{{ adv.id ~ '-' ~ key }}"></div>
{% endfor %}
</div>
</a>
{{ addBlock('list/extra-actions', {'ad': adv, 'vars': _context}, ['favs'])|raw }}
</div>
@ -24,12 +34,14 @@
</a>
{% if not setting_value('visiosoft.module.advs::hide_ad_cat') %}
<a href="{{ adv.detail_url }}" class="product-name-hb text-truncate text-decoration-none text-dark">{{ adv.cat1_name }} /{{ adv.cat2_name }}</a>
{% endif %}
{% if showPrice %}
<div class="product-price-hb rounded d-flex align-items-center px-lg-3 px-2 mt-2 text-dark justify-content-between">
<div class="product-price-hb rounded d-flex align-items-center mt-2 bg-secondary-md bg-none text-dark justify-content-between">
{{ adv.price != '0' ? currency_format(adv.price,adv.currency) : trans('visiosoft.module.advs::field.free') }}
{{ addBlock('list/extra-actions', {'ad': adv, 'vars': _context}, ['comparisons'])|raw }}
</div>
{% endif %}
</div>
</div>
@ -37,6 +49,8 @@
{% endfor %}
</div>
{{ asset_add("scripts.js", "visiosoft.module.advs::js/list-table.js") }}
{% endblock %}
{% block styles %}
@ -45,6 +59,7 @@
{% endblock %}
{% block customjs %}
{{ asset_add("scripts.js", "visiosoft.module.advs::js/list-table.js") }}
{% include "theme::scroll-modal" %}
{% endblock %}

View File

@ -67,7 +67,7 @@
{{ addBlock('ads-list/row',{'topfields':topfields,'selectRange':selectRange,'advs':advs, 'mainCats':mainCats|length})|raw }}
<div id="listingWrapper" class="border rounded p-3">
<div id="listingWrapper" class="rounded p-s-3 p-0">
{% block listContent %}
{% include "visiosoft.module.advs::list/partials/ads" %}
{% endblock %}

View File

@ -47,9 +47,84 @@
.product-price-hb {
font-size: 24px;
font-weight:bolder;
background-color: rgb(244,244,244);
height: 50px;
}
@media screen and (max-width: 766px) {
.product-price-hb {
font-size: 24px;
font-weight:bolder;
height: 50px;
}
.product-info-hb>button{
position: inherit !important;
width: 100%;
}
#listingWrapper{
border:none !important;
}
.product-hb{
border:none !important;
box-shadow: none !important;
}
.review{
height: auto;
}
.review>p{
display: none;
}
}
.fs-14{
font-size: 14px;
}
.product-price-hb~p{
font-size:.7em;
}
.review{
height: 32px;
}
.gallery-card:hover>.product-info-hb>.review>button{
display:block !important;
}
.gallery-card:hover>.product-info-hb>.review>p {
display: none;
}
.imgs{
position: relative;
}
.ads-img{
position:inherit;
}
.imgs .ads-img {
width: 100%;
height: 100%;
display: none;
}
.imgs .ads-img:first-child {
display: flex;
}
.hover-area{
position: absolute;
display: flex;
height: 100%;
width: 200px;
top: 0;
left: 0;
}
.hover-0 {
width: 33%;
height: 100%;
}
.hover-1 {
width: 33%;
height: 100%;
}
.hover-2 {
width: 33%;
height: 100%;
}

View File

@ -5,4 +5,5 @@ return [
'add_sub_category' => 'Add Sub Category',
'sub_category' => 'Show Sub Category',
'new_placeholderforsearch' => 'New Placeholderforsearch',
'convert_main' => 'Convert Main Category',
];

View File

@ -5,4 +5,5 @@ return [
'add_sub_category' => 'Alt Kategori Ekle',
'sub_category' => 'Alt Kategoriyi Göster',
'new_placeholderforsearch' => 'Arama için Yeni Yer Tutucu',
'convert_main' => 'Ana Kategori Yap',
];

View File

@ -21,12 +21,21 @@ class CategoryTableButtons
'type' => 'success',
'href' => '/admin/cats?cat={entry.id}'
],
'convert_main' => [
'icon' => 'refresh',
'class' => function () {
if (!request('cat')) {
return 'hidden';
}
},
'type' => 'info',
'href' => '/admin/cats/convert-main/{entry.id}'
],
'delete' => [
'icon' => 'fa fa-trash',
'type' => 'danger',
'href' => function(EntryInterface $entry)
{
return route('visiosoft.module.cats::admin.delete_category', ['id' => $entry->getId()])."?parent=".$entry->parent_category_id;
'href' => function (EntryInterface $entry) {
return route('visiosoft.module.cats::admin.delete_category', ['id' => $entry->getId()]) . "?parent=" . $entry->parent_category_id;
}
]
]);

View File

@ -40,6 +40,7 @@ class CatsModuleServiceProvider extends AddonServiceProvider
'as' => 'visiosoft.module.cats::import',
'uses' => 'Visiosoft\CatsModule\Http\Controller\Admin\CategoryController@import',
],
'admin/cats/convert-main/{id}' => 'Visiosoft\CatsModule\Http\Controller\Admin\CategoryController@convertMain',
'admin/cats/export' => [
'as' => 'visiosoft.module.cats::export',
'uses' => 'Visiosoft\CatsModule\Http\Controller\Admin\CategoryController@export',

View File

@ -276,7 +276,7 @@ class CategoryController extends AdminController
$file = $uploader->upload($file, $folder);
$url = route('anomaly.module.files::files.view',['folder' => $folder->slug,'name' => $file->name]);
$url = route('anomaly.module.files::files.view', ['folder' => $folder->slug, 'name' => $file->name]);
$category->setCategoryIconUrl($url);
} catch (\Exception $exception) {
@ -341,4 +341,14 @@ class CategoryController extends AdminController
];
}
}
public function convertMain($id)
{
if ($category = $this->categoryRepository->find($id)) {
$category->update(['parent_category_id' => null]);
$this->messages->success(trans('streams::message.edit_success', ['name' => trans('visiosoft.module.cats::addon.title')]));
return redirect('admin/cats');
}
}
}

View File

@ -15,7 +15,8 @@ class AdressController extends AdminController
$table->setColumns(array_merge($table->getColumns(), [
'city' => [
'value' => function (EntryInterface $entry, CityRepositoryInterface $cityRepository) {
return $cityRepository->find($entry->city)->name;
$city = $cityRepository->find($entry->city);
return ($city) ? $city->name : '-';
},
],
]));
@ -37,11 +38,11 @@ class AdressController extends AdminController
return $form->render($id);
}
public function adressUpdate(AdressFormBuilder $form,Request $request,$id)
public function adressUpdate(AdressFormBuilder $form, Request $request, $id)
{
$error = $form->build()->validate()->getFormErrors()->getMessages();
if(!empty($error)) {
if (!empty($error)) {
return $this->redirect->back();
}