fix layout
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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