Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

index.blade.php 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. @props([
  2. 'navigation',
  3. ])
  4. <div
  5. {{
  6. $attributes->class([
  7. 'fi-topbar sticky top-0 z-20 overflow-x-clip',
  8. 'fi-topbar-with-navigation' => filament()->hasTopNavigation(),
  9. ])
  10. }}
  11. >
  12. <nav
  13. class="flex h-16 items-center gap-x-4 bg-white px-4 shadow-sm ring-1 ring-gray-950/5 dark:bg-gray-900 dark:ring-white/10 md:px-6 lg:px-8"
  14. >
  15. {{ \Filament\Support\Facades\FilamentView::renderHook('panels::topbar.start') }}
  16. <x-filament::icon-button
  17. color="gray"
  18. icon="heroicon-o-bars-3"
  19. icon-alias="panels::topbar.open-sidebar-button"
  20. icon-size="lg"
  21. :label="__('filament-panels::layout.actions.sidebar.expand.label')"
  22. x-cloak
  23. x-data="{}"
  24. x-on:click="$store.sidebar.open()"
  25. x-show="! $store.sidebar.isOpen"
  26. @class([
  27. 'lg:hidden' => (! filament()->isSidebarFullyCollapsibleOnDesktop()) || filament()->isSidebarCollapsibleOnDesktop(),
  28. ])
  29. />
  30. <x-filament::icon-button
  31. color="gray"
  32. icon="heroicon-o-x-mark"
  33. icon-alias="panels::topbar.close-sidebar-button"
  34. icon-size="lg"
  35. :label="__('filament-panels::layout.actions.sidebar.collapse.label')"
  36. x-cloak
  37. x-data="{}"
  38. x-on:click="$store.sidebar.close()"
  39. x-show="$store.sidebar.isOpen"
  40. class="lg:hidden"
  41. />
  42. @if (filament()->hasTopNavigation())
  43. <div class="me-6 hidden lg:flex">
  44. @if ($homeUrl = filament()->getHomeUrl())
  45. <a {{ \Filament\Support\generate_href_html($homeUrl) }}>
  46. <x-filament-panels::logo />
  47. </a>
  48. @else
  49. <x-filament-panels::logo />
  50. @endif
  51. </div>
  52. @if (filament()->hasTenancy())
  53. <x-filament-panels::tenant-menu class="hidden lg:block" />
  54. @endif
  55. @if (filament()->hasNavigation())
  56. <ul class="me-4 hidden items-center gap-x-4 lg:flex">
  57. @foreach($navigation as $group)
  58. @if ($group->getLabel() === null)
  59. @foreach ($group->getItems() as $item)
  60. <x-filament-panels::topbar.item
  61. :active="$item->isActive()"
  62. :active-icon="$item->getActiveIcon()"
  63. :badge="$item->getBadge()"
  64. :badge-color="$item->getBadgeColor()"
  65. :icon="$item->getIcon()"
  66. :should-open-url-in-new-tab="$item->shouldOpenUrlInNewTab()"
  67. :url="$item->getUrl()"
  68. >
  69. {{ $item->getLabel() }}
  70. </x-filament-panels::topbar.item>
  71. @endforeach
  72. @endif
  73. @endforeach
  74. @foreach ($navigation as $group)
  75. @php
  76. $groupLabel = $group->getLabel();
  77. $groupItems = collect($group->getItems());
  78. $subgroups = $groupItems->groupBy(fn(\Filament\Navigation\NavigationItem $item) => $item->getParentItem())->filter(fn($subgroup, $key) => filled($key));
  79. $standaloneItems = $groupItems->reject(fn(\Filament\Navigation\NavigationItem $item) => filled($item->getParentItem()));
  80. $itemsCount = $groupItems->count();
  81. @endphp
  82. @if ($groupLabel)
  83. <x-filament::dropdown
  84. offset="0"
  85. width="max-w-fit"
  86. placement="bottom-start"
  87. teleport
  88. x-on:mouseenter="open"
  89. x-on:mouseleave="close"
  90. :attributes="
  91. \Filament\Support\prepare_inherited_attributes($attributes)
  92. ->class(['fi-topbar-dropdown'])
  93. "
  94. >
  95. <x-slot name="trigger">
  96. <x-filament-panels::topbar.item
  97. :active="$group->isActive()"
  98. :icon="$group->getIcon()"
  99. >
  100. {{ $groupLabel }}
  101. </x-filament-panels::topbar.item>
  102. </x-slot>
  103. <x-filament::dropdown.list>
  104. @if($subgroups->isNotEmpty() || $standaloneItems->isNotEmpty())
  105. <ul class="menu-groups">
  106. @foreach($subgroups as $subgroupTitle => $subgroupItems)
  107. <li class="menu-group cols-1">
  108. <div class="submenu-wrap">
  109. <div class="menu-label">{{ $subgroupTitle }}</div>
  110. <ul class="submenu cols-1">
  111. @foreach($subgroupItems as $item)
  112. <li class="menu-item cols-1">
  113. <x-filament::dropdown.list.item
  114. @class(['fi-topbar-dropdown-list-item' => $itemsCount > 1])
  115. :badge="$item->getBadge()"
  116. :badge-color="$item->getBadgeColor()"
  117. :href="$item->getUrl()"
  118. :icon="$item->isActive() ? ($item->getActiveIcon() ?? $item->getIcon()) : $item->getIcon()"
  119. tag="a"
  120. :target="$item->shouldOpenUrlInNewTab() ? '_blank' : null"
  121. >
  122. {{ $item->getLabel() }}
  123. </x-filament::dropdown.list.item>
  124. </li>
  125. @endforeach
  126. </ul>
  127. </div>
  128. </li>
  129. @endforeach
  130. @if($standaloneItems->isNotEmpty())
  131. <li class="menu-group cols-1">
  132. <div class="submenu-wrap">
  133. <div class="menu-label-invisible-spacer"></div>
  134. <ul class="submenu cols-1">
  135. @foreach($itemsWithoutSubgroup as $item)
  136. <li class="menu-item cols-1">
  137. <x-filament::dropdown.list.item
  138. @class([
  139. 'fi-topbar-dropdown-list-item' => $itemsCount > 1,
  140. ])
  141. :badge="$item->getBadge()"
  142. :badge-color="$item->getBadgeColor()"
  143. :href="$item->getUrl()"
  144. :icon="$item->isActive() ? ($item->getActiveIcon() ?? $item->getIcon()) : $item->getIcon()"
  145. tag="a"
  146. :target="$item->shouldOpenUrlInNewTab() ? '_blank' : null"
  147. >
  148. {{ $item->getLabel() }}
  149. </x-filament::dropdown.list.item>
  150. </li>
  151. @endforeach
  152. </ul>
  153. </div>
  154. </li>
  155. @endif
  156. </ul>
  157. @else
  158. @foreach ($group->getItems() as $item)
  159. <x-filament::dropdown.list.item
  160. @class([
  161. 'fi-topbar-dropdown-list-item' => $itemsCount > 1,
  162. ])
  163. :badge="$item->getBadge()"
  164. :badge-color="$item->getBadgeColor()"
  165. :href="$item->getUrl()"
  166. :icon="$item->isActive() ? ($item->getActiveIcon() ?? $item->getIcon()) : $item->getIcon()"
  167. tag="a"
  168. :target="$item->shouldOpenUrlInNewTab() ? '_blank' : null"
  169. >
  170. {{ $item->getLabel() }}
  171. </x-filament::dropdown.list.item>
  172. @endforeach
  173. @endif
  174. </x-filament::dropdown.list>
  175. </x-filament::dropdown>
  176. @endif
  177. @endforeach
  178. </ul>
  179. @endif
  180. @endif
  181. <div
  182. x-persist="topbar.end"
  183. class="ms-auto flex items-center gap-x-4"
  184. >
  185. {{ \Filament\Support\Facades\FilamentView::renderHook('panels::global-search.before') }}
  186. @if (filament()->isGlobalSearchEnabled())
  187. @livewire(Filament\Livewire\GlobalSearch::class, ['lazy' => true])
  188. @endif
  189. {{ \Filament\Support\Facades\FilamentView::renderHook('panels::global-search.after') }}
  190. @if (filament()->auth()->check())
  191. @if (filament()->hasDatabaseNotifications())
  192. @livewire(Filament\Livewire\DatabaseNotifications::class, ['lazy' => true])
  193. @endif
  194. <x-filament-panels::user-menu />
  195. @endif
  196. </div>
  197. {{ \Filament\Support\Facades\FilamentView::renderHook('panels::topbar.end') }}
  198. </nav>
  199. </div>