fix layout
This commit is contained in:
@@ -20,19 +20,37 @@ class CategoryController extends Controller
|
||||
|
||||
public function show(Request $request, $category_id)
|
||||
{
|
||||
switch ($request->input('article_nature')) {
|
||||
case 'semences':
|
||||
$product_type = 'botanic';
|
||||
$article_nature_id = 1;
|
||||
break;
|
||||
case 'plants':
|
||||
$product_type = 'botanic';
|
||||
$article_nature_id = 2;
|
||||
break;
|
||||
default:
|
||||
$product_type = 'botanic';
|
||||
$article_nature_id = 1;
|
||||
break;
|
||||
}
|
||||
$data = [
|
||||
'category' => Categories::getFull($category_id),
|
||||
'breadcrumb' => Categories::getAncestorsByCategory($category_id),
|
||||
'display_by_rows' => $request->input('display_by_rows') ?? false,
|
||||
'product_type' => $request->input('product_type') ?? 'botanic',
|
||||
'product_type' => $product_type,
|
||||
'article_nature' => $request->input('article_nature'),
|
||||
'tags_selected' => $request->input('tags') ?? [],
|
||||
'articles' => Articles::getArticlesToSell([
|
||||
'category_id' => $category_id,
|
||||
'tags' => $request->input('tags') ?? [],
|
||||
'product_type' => $request->input('product_type') ?? 'botanic',
|
||||
'product_type' => $product_type,
|
||||
'article_nature_id' => $article_nature_id ?? false,
|
||||
]),
|
||||
'tags' => TagGroups::getWithTagsAndCountOffers($category_id),
|
||||
];
|
||||
// dump($data);
|
||||
// exit;
|
||||
return view('Shop.Shelves.shelve', $data);
|
||||
}
|
||||
|
||||
|
||||
@@ -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') }}";
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
@@ -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">
|
||||
<!--
|
||||
|
||||
@@ -1,5 +1,20 @@
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<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-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> €
|
||||
@@ -7,9 +22,8 @@
|
||||
-
|
||||
@endif
|
||||
</span><br/>
|
||||
<strong>Semence</strong>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
@endif
|
||||
@if ($article_nature == 'plants')
|
||||
<span style="font-size: 1.4em">
|
||||
@if ($article['plants'] ?? false)
|
||||
{{ $article['plants']['price'] }}</span> €
|
||||
@@ -17,6 +31,6 @@
|
||||
-
|
||||
@endif
|
||||
</span><br/>
|
||||
<strong>Plant</strong>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@@ -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'] !!}
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form id="filter">
|
||||
@if ($tags ?? false)
|
||||
@foreach ($tags as $tag_group_id => $group)
|
||||
@if ($group['tags'] ?? false)
|
||||
@@ -31,7 +30,6 @@
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
</form>
|
||||
</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
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
lazyLoad: 'ondemand',
|
||||
slidesToShow: 6,
|
||||
slidesToScroll: 1,
|
||||
dots: true,
|
||||
dots: false,
|
||||
autoplay: true,
|
||||
autoplaySpeed: 5000
|
||||
});
|
||||
|
||||
@@ -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 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>
|
||||
@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 = 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>
|
||||
|
||||
@@ -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
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user