menu.blade.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. @php
  2. $depth = $item['depth'] ?? 0;
  3. $horizontal = config('admin.layout.horizontal_menu');
  4. $defaultIcon = config('admin.menu.default_icon', 'feather icon-circle');
  5. $num = \App\Admin\Repositories\DistInquiry::getProcessingNum();
  6. @endphp
  7. @if($builder->visible($item))
  8. @if(empty($item['children']))
  9. <li class="nav-item">
  10. <a data-id="{{ $item['id'] ?? '' }}" @if(mb_strpos($item['uri'], '://') !== false) target="_blank" @endif
  11. href="{{ $builder->getUrl($item['uri']) }}"
  12. class="nav-link {!! $builder->isActive($item) ? 'active' : '' !!}">
  13. {!! str_repeat('&nbsp;', $depth) !!}<i class="fa fa-fw {{ $item['icon'] ?: $defaultIcon }}"></i>
  14. <p>
  15. {!! $builder->translate($item['title']) !!}
  16. </p>
  17. @if($item['title'] == 'Inquiry' && $num > 0) <i class="badge badge-danger">{{$num}}</i>@endif
  18. </a>
  19. </li>
  20. @else
  21. <li class="{{ $horizontal ? 'dropdown' : 'has-treeview' }} {{ $depth > 0 ? 'dropdown-submenu' : '' }} nav-item {{ $builder->isActive($item) ? 'menu-open' : '' }}">
  22. <a href="#" data-id="{{ $item['id'] ?? '' }}"
  23. class="nav-link {{ $builder->isActive($item) ? ($horizontal ? 'active' : '') : '' }}
  24. {{ $horizontal ? 'dropdown-toggle' : '' }}">
  25. {!! str_repeat('&nbsp;', $depth) !!}<i class="fa fa-fw {{ $item['icon'] ?: $defaultIcon }}"></i>
  26. <p>
  27. {!! $builder->translate($item['title']) !!}
  28. @if(! $horizontal)
  29. <i class="right fa fa-angle-left"></i>
  30. @endif
  31. </p>
  32. </a>
  33. <ul class="nav {{ $horizontal ? 'dropdown-menu' : 'nav-treeview' }}">
  34. @foreach($item['children'] as $item)
  35. @php
  36. $item['depth'] = $depth + 1;
  37. @endphp
  38. @include('admin::partials.menu', ['item' => $item])
  39. @endforeach
  40. </ul>
  41. </li>
  42. @endif
  43. @endif