fix layout

This commit is contained in:
Ludovic CANDELLIER
2022-12-21 18:33:15 +01:00
parent 9895266798
commit ae39681cb0
16 changed files with 164 additions and 135 deletions

View File

@@ -44,7 +44,8 @@
label: '{{ __('Commander') }}',
className: 'btn-success',
callback: function() {
window.location = "{{ route('Shop.Orders.order') }}";
console.log('ici');
window.location = "{{ route('Shop.Basket.basket') }}";
}
},
};

View File

@@ -1,7 +1,7 @@
<a href="{{ route('Shop.Articles.show', ['id' => $article['semences']['article_id'] ?? false ]) }}" class="{{ ($product_type == 'botanic') ? 'green-dark' : 'green-dark' }}">
<div class="card {{ ($product_type == 'botanic') ? 'bg-yellow' : 'bg-green-light' }}">
<div class="card {{ ($article_nature == 'semences') ? 'bg-yellow' : 'bg-green-light' }}">
<img src="{{ App\Repositories\Shop\Articles::getPreviewSrc($article['image'] ?? false) }}" class="card-img-top" alt="{{ $product_name }}">
<div class="card-body">
<div class="card-body p-2 pb-1">
<div class="row card-title">
<div class="col-12">
<!--

View File

@@ -1,22 +1,36 @@
<div class="row">
<div class="col-6">
<span style="font-size: 1.4em">
@if ($article['semences'] ?? false)
{{ $article['semences']['price'] ?? null }}</span>
@else
-
@endif
</span><br/>
<strong>Semence</strong>
<div class="col-7">
@if ($article_nature == 'semences')
<strong>Semences</strong><br/>
<small>
{{ $article['semences']['variation'] ?? null }}
</small>
@endif
@if ($article_nature == 'plants')
<strong>Plants</strong><br/>
<small>
{{ $article['plants']['variation'] ?? null }}
</small>
@endif
</div>
<div class="col-6">
<span style="font-size: 1.4em">
@if ($article['plants'] ?? false)
{{ $article['plants']['price'] }}</span>
@else
-
@endif
</span><br/>
<strong>Plant</strong>
<div class="col-5 text-right" style="font-weight: 700; font-size: 1.1em;">
@if ($article_nature == 'semences')
<span style="font-size: 1.4em">
@if ($article['semences'] ?? false)
{{ $article['semences']['price'] ?? null }}</span>
@else
-
@endif
</span><br/>
@endif
@if ($article_nature == 'plants')
<span style="font-size: 1.4em">
@if ($article['plants'] ?? false)
{{ $article['plants']['price'] }}</span>
@else
-
@endif
</span><br/>
@endif
</div>
</div>

View File

@@ -16,8 +16,8 @@
</div>
<a href="{{ route('Shop.Articles.show', ['id' => $article['id'] ?? false ]) }}" class="green-dark">
<div class="row">
<div class="col-2">
<img src="{{ App\Repositories\Shop\Articles::getPreviewSrc($article['image'] ?? false) }}" class="card-img-top" alt="...">
<div class="col-2 pr-0">
<img src="{{ App\Repositories\Shop\Articles::getPreviewSrc($article['image'] ?? false) }}" class="card-img-top shadow" alt="...">
</div>
<div class="col-10 text-justify">
{!! $article['description'] !!}

View File

@@ -1,5 +1,5 @@
@if ($article['semences'] ?? false)
<div class="w-100 mt-3 p-1 bg-green-light green-dark rounded-lg border border-success text-center">
@if ($article_nature == 'semences')
<div class="w-100 mt-3 p-1 bg-yellow yellow-dark rounded-lg border text-center">
<span style="font-size: 1.4em; font-weight: bold;">{{ $article['semences']['price'] ?? null }}</span> <br>
{{ $article['semences']['variation'] }}
<div>
@@ -13,8 +13,8 @@
</div>
@endif
@if ($article['plants'] ?? false)
<div class="w-100 mt-3 p-1 bg-yellow-light yellow-dark border border-warning text-center">
@if ($article_nature == 'plants')
<div class="w-100 mt-3 p-1 bg-green green-dark rounded-lg border text-center text-white">
<span style="font-size: 1.4em; font-weight: bold;">{{ $article['plants']['price'] ?? null }}</span> <br>
{{ $article['plants']['variation'] }}
<div>

View File

@@ -0,0 +1,9 @@
<h1 style="font-size: 1.5em;">
@foreach($breadcrumb ?? [] as $parent)
<a href="{{ route('Shop.Categories.show', ['id' => $parent['id']]) }}" style="text-decoration: none; color: inherit;">{{ $parent['name'] }}</a> /
@endforeach
<span style="font-size: 1.4em;">
{{ $category['name'] }}
</span>
</h1>
<h3 style="font-size: 1.2em;">{!! $category['description'] !!}</h3>

View File

@@ -1,31 +1,15 @@
<div class="row">
<div class="col-12 text-right">
@if ($display_by_rows ?? false)
@include('components.form.button', [
'id' => 'by_cards',
'icon' => 'fa-th',
'class' => 'btn-secondary',
'title' => 'Vue par vignettes',
])
@else
@include('components.form.button', [
'id' => 'by_rows',
'icon' => 'fa-list',
'class' => 'btn-secondary',
'title' => 'Vue par lignes',
])
@endif
@include('components.form.button', [
'data_id' => 'botanic',
'data_id' => 'semences',
'icon' => 'fa-leaf',
'class' => 'products bg-yellow yellow-dark',
'class' => 'products bg-yellow yellow-dark' . (($article_nature == 'semences') ? ' d-none' : ''),
'title' => 'Par semences',
])
@include('components.form.button', [
'data_id' => 'merchandise',
'data_id' => 'plants',
'icon' => 'fa-seedling',
'class' => 'products bg-green text-white',
'class' => 'products bg-green text-white' . (($article_nature == 'plants') ? ' d-none' : ''),
'title' => 'Par plants',
])
@@ -43,7 +27,7 @@
$('#category-form').submit();
});
$('.products').click(function() {
$('#product_type').val($(this).data('id'));
$('#article_nature').val($(this).data('id'));
$('#category-form').submit();
});
</script>

View File

@@ -2,9 +2,9 @@
@if ($articles ?? false)
@foreach ($articles as $product_name => $article)
@if ((($product_type == 'botanic') && (($article['semences'] ?? false) || ($article['plants'] ?? false))) || (($product_type == 'merchandise') &&($article['mercchandises'] ?? false)))
<div class="col-3 mb-3">
@include('Shop.Articles.partials.article')
</div>
<div class="col-3 mb-3">
@include('Shop.Articles.partials.article')
</div>
@endif
@endforeach
@endif

View File

@@ -7,21 +7,14 @@
{{ Form::open(['id' => 'category-form', 'autocomplete' => 'off']) }}
<input type="hidden" id="display_by_rows" name="display_by_rows" value="{{ $display_by_rows ?? false }}">
<input type="hidden" id="product_type" name="product_type" value="{{ $product_type ?? false }}">
<input type="hidden" id="article_nature" name="article_nature" value="{{ $article_nature ?? false }}">
<div class="row mb-3">
<div class="col-3">
@include('Shop._partials.display_filters')
</div>
<div class="col-6">
<h1 style="font-size: 1.5em;">
@foreach($breadcrumb ?? [] as $parent)
<a href="{{ route('Shop.Categories.show', ['id' => $parent['id']]) }}" style="text-decoration: none; color: inherit;">{{ $parent['name'] }}</a> /
@endforeach
<span style="font-size: 1.4em;">
{{ $category['name'] }}
</span>
</h1>
<h3 style="font-size: 1.2em;">{!! $category['description'] !!}</h3>
@include('Shop.Shelves.partials.breadcrumb')
</div>
<div class="col-3">
@include('Shop.Shelves.partials.category_add')

View File

@@ -7,31 +7,29 @@
</div>
</div>
<form id="filter">
@if ($tags ?? false)
@foreach ($tags as $tag_group_id => $group)
@if ($group['tags'] ?? false)
@component('components.layout.box-collapse', [
'title' => $group['name'],
'id' => 'tag_group_' . $tag_group_id,
])
@foreach ($group['tags'] as $tag)
<div class="form-inline">
@include('components.form.checkboxes.icheck', [
'name' => 'tags[]',
'val' => $tag['id'],
'value' => in_array($tag['id'], $tags_selected ?? []),
'id_name' => 'tag_' . $tag['id'],
'class' => 'filter_tags',
])
{{ $tag['name'] }} ({{ $tag['count'] }})
</div>
@endforeach
@endcomponent
@endif
@endforeach
@endif
</form>
@if ($tags ?? false)
@foreach ($tags as $tag_group_id => $group)
@if ($group['tags'] ?? false)
@component('components.layout.box-collapse', [
'title' => $group['name'],
'id' => 'tag_group_' . $tag_group_id,
])
@foreach ($group['tags'] as $tag)
<div class="form-inline">
@include('components.form.checkboxes.icheck', [
'name' => 'tags[]',
'val' => $tag['id'],
'value' => in_array($tag['id'], $tags_selected ?? []),
'id_name' => 'tag_' . $tag['id'],
'class' => 'filter_tags',
])
{{ $tag['name'] }} ({{ $tag['count'] }})
</div>
@endforeach
@endcomponent
@endif
@endforeach
@endif
</section>
</aside>
@@ -49,5 +47,13 @@
$('#category-form').submit();
})
initChevron();
$('#reset_filters').click(function() {
$("input[type=checkbox]").each(function() {
$(this).prop("checked", false);
});
$('#category-form').submit();
});
</script>
@endpush

View File

@@ -1,12 +1,28 @@
@if (!($no_filter ?? false))
Filtres
<a id="filters" href="#" class="btn btn-success p-0">
<span id="filter-on" class="fa-stack fa-sm @if ($filter_on ?? false) d-none" @endif">
<i class="fa fa-stack-1x fa-filter"></i>
<button type="button" class="btn btn-success" id="filters" title="Filtres" data-toggle="tooltip">
<span id="filter-on" class="fa fa-fw @if ($filter_on ?? false) d-none" @endif">
<i class="fa fa-filter"></i>
</span>
<span id="filter-off" class="fa-stack fa-sm @if (!($filter_on ?? false)) d-none" @endif">
<i class="fa fa-stack-1x fa-eye"></i>
<span id="filter-off" class="fa-stack fa fa-fw @if (!($filter_on ?? false)) d-none" @endif" style="font-size: 0.75em;">
<i class="fa fa-stack-1x fa-filter"></i>
<i class="fa fa-stack-2x fa-ban" style="color:Tomato"></i>
</span>
</a>
</button>
@endif
@if ($display_by_rows ?? false)
@include('components.form.button', [
'id' => 'by_cards',
'icon' => 'fa-th',
'class' => 'btn-secondary',
'title' => 'Vue par vignettes',
])
@else
@include('components.form.button', [
'id' => 'by_rows',
'icon' => 'fa-list',
'class' => 'btn-secondary',
'title' => 'Vue par lignes',
])
@endif

View File

@@ -29,7 +29,7 @@
lazyLoad: 'ondemand',
slidesToShow: 6,
slidesToScroll: 1,
dots: true,
dots: false,
autoplay: true,
autoplaySpeed: 5000
});

View File

@@ -1,45 +1,23 @@
<div class="container">
<div class="row rounded m-0 drop-shadow bg-white p-2">
<div class="col mb-4">
@for ($i = 0; $i < round(count($category['children']) / 3); $i++)
<strong>
<a class="green-dark" href="{{ route('Shop.Categories.show', ['id' => $category['children'][$i]['id']]) }}">
{{ $category['children'][$i]['name'] }}
</a>
</strong><br>
@foreach ($category['children'][$i]['children'] ?? [] as $leaf)
<a class="green-dark" href="{{ route('Shop.Categories.show', ['id' => $leaf['id']]) }}">
{{ $leaf['name'] }}
</a><br>
@endforeach
<strong>
<a class="green-dark @if (($category['id'] ?? false) == $menu['id']) active @endif" href="{{ route('Shop.Categories.show', ['id' => $menu['id']]) }}">
Tous les articles
</a>
</strong><br>
@for ($i = 0; $i < round(count($menu['children']) / 3); $i++)
@include('Shop.layout.partials.megamenu_leafs')
@endfor
</div>
<div class="col mb-4">
@for ($i = round(count($category['children']) / 3); $i < round(2 * count($category['children']) / 3); $i++)
<strong>
<a class="green-dark" href="{{ route('Shop.Categories.show', ['id' => $category['children'][$i]['id']]) }}">
{{ $category['children'][$i]['name'] }}
</a>
</strong><br>
@foreach ($category['children'][$i]['children'] ?? [] as $leaf)
<a class="green-dark" href="{{ route('Shop.Categories.show', ['id' => $leaf['id']]) }}">
{{ $leaf['name'] }}
</a><br>
@endforeach
@for ($i = round(count($menu['children']) / 3); $i < round(2 * count($menu['children']) / 3); $i++)
@include('Shop.layout.partials.megamenu_leafs')
@endfor
</div>
<div class="col mb-4">
@for ($i = round(2 * count($category['children']) / 3); $i < count($category['children']); $i++)
<strong>
<a class="green-dark" href="{{ route('Shop.Categories.show', ['id' => $category['children'][$i]['id']]) }}">
{{ $category['children'][$i]['name'] }}
</a>
</strong><br>
@foreach ($category['children'][$i]['children'] ?? [] as $leaf)
<a class="green-dark" href="{{ route('Shop.Categories.show', ['id' => $leaf['id']]) }}">
{{ $leaf['name'] }}
</a><br>
@endforeach
@for ($i = round(2 * count($menu['children']) / 3); $i < count($menu['children']); $i++)
@include('Shop.layout.partials.megamenu_leafs')
@endfor
</div>
</div>

View File

@@ -0,0 +1,10 @@
<strong>
<a class="green-dark @if (($category['id'] ?? false) == $menu['children'][$i]['id']) active @endif" href="{{ route('Shop.Categories.show', ['id' => $menu['children'][$i]['id']]) }}">
{{ $menu['children'][$i]['name'] }}
</a>
</strong><br>
@foreach ($menu['children'][$i]['children'] ?? [] as $leaf)
<a class="green-dark @if (($category['id'] ?? false) == $leaf['id']) active @endif" href="{{ route('Shop.Categories.show', ['id' => $leaf['id']]) }}">
{{ $leaf['name'] }}
</a><br>
@endforeach

View File

@@ -3,18 +3,18 @@
<nav class="navbar navbar-expand-lg navbar-light bg-light ">
<div class="collapse navbar-collapse" id="navbarContent">
<ul class="navbar-nav">
@foreach ($categories as $category)
@foreach ($categories as $menu)
<li class="nav-item dropdown megamenu">
@if (isset($category['children']))
<a id="megamenu_{{ $category['id'] }}" href="{{ route('Shop.Categories.show', ['id' => $category['id']]) }}" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" class="nav-link dropdown-toggle font-weight-bold text-uppercase">
{{ $category['name'] }}
@if ($menu['children'] ?? false)
<a id="megamenu_{{ $menu['id'] }}" href="{{ route('Shop.Categories.show', ['id' => $menu['id']]) }}" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" class="nav-link dropdown-toggle font-weight-bold text-uppercase @if (($category['id'] ?? false) == $menu['id']) active @endif">
{{ $menu['name'] }}
</a>
<div aria-labelledby="megamenu_{{ $category['id'] }}" class="dropdown-menu border-0 p-0 m-0">
<div aria-labelledby="megamenu_{{ $menu['id'] }}" class="dropdown-menu border-0 p-0 m-0">
@include('Shop.layout.partials.megamenu')
</div>
@else
<a href="{{ route('Shop.Categories.show', ['id' => $category['id']]) }}" class="nav-link font-weight-bold text-uppercase">
{{ $category['name'] }}
<a href="{{ route('Shop.Categories.show', ['id' => $menu['id']]) }}" class="nav-link font-weight-bold text-uppercase @if (($category['id'] ?? false) == $menu['id']) active @endif">
{{ $menu['name'] }}
</a>
@endif
</li>