navigation.blade.php 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <nav x-data="{ open: false }" class="bg-burnt shadow">
  2. <!-- Primary Navigation Menu -->
  3. <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
  4. <div class="flex justify-between h-16">
  5. <div class="flex">
  6. <!-- Logo -->
  7. <div class="shrink-0 flex items-center">
  8. <a href="{{ route('home') }}">
  9. <x-application-logo class="block h-14 w-auto fill-current text-fogra hover:text-yelmax font-bold" />
  10. </a>
  11. </div>
  12. <!-- Navigation Links -->
  13. <div class="hidden space-x-8 sm:-my-px sm:ml-10 sm:flex">
  14. <x-nav-link class="text-fogra" :href="route('vorschlag')" :active="request()->routeIs('vorschlag')">
  15. {{ __('Vorschläge') }}
  16. </x-nav-link>
  17. <x-nav-link class="text-fogra" :href="route('gesehen')" :active="request()->routeIs('gesehen')">
  18. {{ __('Archiv') }}
  19. </x-nav-link>
  20. <x-nav-link class="text-fogra" :href="route('neu')" :active="request()->routeIs('neu')">
  21. {{ __('Film vorschlagen') }}
  22. </x-nav-link>
  23. </div>
  24. </div>
  25. <!-- Settings Dropdown -->
  26. <div class="hidden sm:flex sm:items-center sm:ml-6">
  27. @if (Auth::check())
  28. <x-dropdown align="right" width="48">
  29. <x-slot name="trigger">
  30. <button class="flex items-center text-sm font-medium text-fogra hover:text-yelmax hover:border-yelmax focus:outline-none focus:text-yelmax focus:border-yelmax transition duration-150 ease-in-out">
  31. <div>{{ Auth::user()->name }}</div>
  32. <div class="ml-1">
  33. <svg class="fill-current h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
  34. <path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd" />
  35. </svg>
  36. </div>
  37. </button>
  38. </x-slot>
  39. <x-slot name="content">
  40. <!-- Authentication -->
  41. <form method="POST" action="{{ route('logout') }}">
  42. @csrf
  43. <x-dropdown-link :href="route('dashboard')">
  44. {{ __('Einstellungen') }}
  45. </x-dropdown-link>
  46. <x-dropdown-link :href="route('logout')"
  47. onclick="event.preventDefault();
  48. this.closest('form').submit();">
  49. {{ __('Abmelden') }}
  50. </x-dropdown-link>
  51. </form>
  52. </x-slot>
  53. </x-dropdown>
  54. @else
  55. <div class="hidden space-x-8 sm:-my-px sm:ml-10 sm:flex">
  56. <x-nav-link :href="route('login')" :active="request()->routeIs('login')">
  57. {{ __('login') }}
  58. </x-nav-link>
  59. </div>
  60. @endif
  61. </div>
  62. <!-- Hamburger -->
  63. <div class="-mr-2 flex items-center sm:hidden">
  64. <button @click="open = ! open" class="inline-flex items-center justify-center p-2 rounded-md text-fogra hover:text-yelmax focus:outline-none transition duration-150 ease-in-out">
  65. <svg class="h-6 w-6" stroke="currentColor" fill="none" viewBox="0 0 24 24">
  66. <path :class="{'hidden': open, 'inline-flex': ! open }" class="inline-flex" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" />
  67. <path :class="{'hidden': ! open, 'inline-flex': open }" class="hidden" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
  68. </svg>
  69. </button>
  70. </div>
  71. </div>
  72. </div>
  73. <!-- Responsive Navigation Menu -->
  74. <div :class="{'block': open, 'hidden': ! open}" class="hidden sm:hidden">
  75. <div class="pt-2 pb-3 space-y-1">
  76. <x-responsive-nav-link :href="route('vorschlag')" :active="request()->routeIs('vorschlag')">
  77. {{ __('Vorschläge') }}
  78. </x-responsive-nav-link>
  79. <x-responsive-nav-link :href="route('neu')" :active="request()->routeIs('neu')">
  80. {{ __('Film vorschlagen') }}
  81. </x-responsive-nav-link>
  82. <x-responsive-nav-link :href="route('gesehen')" :active="request()->routeIs('gesehen')">
  83. {{ __('Archiv') }}
  84. </x-responsive-nav-link>
  85. </div>
  86. <!-- Responsive Settings Options -->
  87. <div class="pt-4 pb-1 border-t border-field">
  88. @if (Auth::check())
  89. <div class="px-4">
  90. <div class="font-medium text-base text-fogra">{{ Auth::user()->name }}</div>
  91. <div class="font-medium text-sm text-field">{{ Auth::user()->email }}</div>
  92. </div>
  93. <div class="mt-3 space-y-1">
  94. <x-responsive-nav-link :href="route('dashboard')" :active="request()->routeIs('dashboard')">
  95. {{ __('Einstellungen') }}
  96. </x-responsive-nav-link>
  97. <!-- Authentication -->
  98. <form method="POST" action="{{ route('logout') }}">
  99. @csrf
  100. <x-responsive-nav-link :href="route('logout')"
  101. onclick="event.preventDefault();
  102. this.closest('form').submit();">
  103. {{ __('Abmelden') }}
  104. </x-responsive-nav-link>
  105. </form>
  106. </div>
  107. @else
  108. <x-responsive-nav-link :href="route('login')" :active="request()->routeIs('login')">
  109. {{ __('Login') }}
  110. </x-responsive-nav-link>
  111. @endif
  112. </div>
  113. </div>
  114. </nav>