navigation.blade.php 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. @auth
  2. <nav x-data="{ open: false }" class="bg-white border-b border-gray-100">
  3. <!-- Primary Navigation Menu -->
  4. <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
  5. <div class="flex justify-between h-16">
  6. <div class="flex">
  7. <!-- Logo -->
  8. <div class="shrink-0 flex items-center">
  9. <a href="{{ route('dashboard') }}">
  10. <x-application-logo class="block h-9 w-auto fill-current text-gray-800" />
  11. </a>
  12. </div>
  13. <!-- Navigation Links -->
  14. <div class="hidden space-x-8 sm:-my-px sm:ms-10 sm:flex">
  15. <x-nav-link :href="route('dashboard')" :active="request()->routeIs('dashboard')">
  16. {{ __('Dashboard') }}
  17. </x-nav-link>
  18. <x-nav-link :href="route('applications.index')" :active="request()->routeIs('applications.index')">
  19. {{ __('Заявки') }}
  20. </x-nav-link>
  21. <x-nav-link :href="route('applications.create')" :active="request()->routeIs('applications.create')">
  22. {{ __('Создать заявку') }}
  23. </x-nav-link>
  24. @if (Auth::user()->role === 'admin')
  25. <x-nav-link :href="route('dashboard')" :active="request()->routeIs('dashboard')">
  26. {{ __('Администрирование') }}
  27. </x-nav-link>
  28. @endif
  29. </div>
  30. </div>
  31. <!-- Settings Dropdown -->
  32. <div class="hidden sm:flex sm:items-center sm:ms-6">
  33. <x-dropdown align="right" width="48">
  34. <x-slot name="trigger">
  35. <button class="inline-flex items-center px-3 py-2 border border-transparent text-sm leading-4 font-medium rounded-md text-gray-500 bg-white hover:text-gray-700 focus:outline-none transition ease-in-out duration-150">
  36. <div>{{ Auth::user()->login }}</div>
  37. <div class="ms-1">
  38. <svg class="fill-current h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
  39. <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" />
  40. </svg>
  41. </div>
  42. </button>
  43. </x-slot>
  44. <x-slot name="content">
  45. <x-dropdown-link :href="route('profile.edit')">
  46. {{ __('Profile') }}
  47. </x-dropdown-link>
  48. <!-- Authentication -->
  49. <form method="POST" action="{{ route('logout') }}">
  50. @csrf
  51. <x-dropdown-link :href="route('logout')"
  52. onclick="event.preventDefault();
  53. this.closest('form').submit();">
  54. {{ __('Log Out') }}
  55. </x-dropdown-link>
  56. </form>
  57. </x-slot>
  58. </x-dropdown>
  59. </div>
  60. <!-- Hamburger -->
  61. <div class="-me-2 flex items-center sm:hidden">
  62. <button @click="open = ! open" class="inline-flex items-center justify-center p-2 rounded-md text-gray-400 hover:text-gray-500 hover:bg-gray-100 focus:outline-none focus:bg-gray-100 focus:text-gray-500 transition duration-150 ease-in-out">
  63. <svg class="h-6 w-6" stroke="currentColor" fill="none" viewBox="0 0 24 24">
  64. <path :class="{'hidden': open, 'inline-flex': ! open }" class="inline-flex" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" />
  65. <path :class="{'hidden': ! open, 'inline-flex': open }" class="hidden" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
  66. </svg>
  67. </button>
  68. </div>
  69. </div>
  70. </div>
  71. <!-- Responsive Navigation Menu -->
  72. <div :class="{'block': open, 'hidden': ! open}" class="hidden sm:hidden">
  73. <div class="pt-2 pb-3 space-y-1">
  74. <x-responsive-nav-link :href="route('dashboard')" :active="request()->routeIs('dashboard')">
  75. {{ __('Dashboard') }}
  76. </x-responsive-nav-link>
  77. <x-responsive-nav-link :href="route('applications.index')" :active="request()->routeIs('applications.index')">
  78. {{ __('Заявки') }}
  79. </x-responsive-nav-link>
  80. <x-responsive-nav-link :href="route('applications.create')" :active="request()->routeIs('applications.create')">
  81. {{ __('Создать заявку') }}
  82. </x-responsive-nav-link>
  83. @if (Auth::user()->role === 'admin')
  84. <x-responsive-nav-link :href="route('dashboard')" :active="request()->routeIs('dashboard')">
  85. {{ __('Администрирование') }}
  86. </x-responsive-nav-link>
  87. @endif
  88. </div>
  89. <!-- Responsive Settings Options -->
  90. <div class="pt-4 pb-1 border-t border-gray-200">
  91. <div class="px-4">
  92. <div class="font-medium text-base text-gray-800">{{ Auth::user()->login }}</div>
  93. <div class="font-medium text-sm text-gray-500">{{ Auth::user()->email }}</div>
  94. </div>
  95. <div class="mt-3 space-y-1">
  96. <x-responsive-nav-link :href="route('profile.edit')">
  97. {{ __('Profile') }}
  98. </x-responsive-nav-link>
  99. <!-- Authentication -->
  100. <form method="POST" action="{{ route('logout') }}">
  101. @csrf
  102. <x-responsive-nav-link :href="route('logout')"
  103. onclick="event.preventDefault();
  104. this.closest('form').submit();">
  105. {{ __('Log Out') }}
  106. </x-responsive-nav-link>
  107. </form>
  108. </div>
  109. </div>
  110. </div>
  111. </nav>
  112. @else
  113. <nav x-data="{ open: false }" class="bg-white border-b border-gray-100">
  114. <!-- Primary Navigation Menu -->
  115. <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
  116. <div class="flex justify-between h-16">
  117. <div class="flex">
  118. <!-- Navigation Links -->
  119. <div class="hidden space-x-8 sm:-my-px sm:ms-10 sm:flex">
  120. <x-nav-link :href="route('login')" :active="request()->routeIs('login')">
  121. {{ __('Войти') }}
  122. </x-nav-link>
  123. <x-nav-link :href="route('register')" :active="request()->routeIs('register')">
  124. {{ __('Регистрация') }}
  125. </x-nav-link>
  126. </div>
  127. </div>
  128. <!-- Hamburger -->
  129. <div class="-me-2 flex items-center sm:hidden">
  130. <button @click="open = ! open" class="inline-flex items-center justify-center p-2 rounded-md text-gray-400 hover:text-gray-500 hover:bg-gray-100 focus:outline-none focus:bg-gray-100 focus:text-gray-500 transition duration-150 ease-in-out">
  131. <svg class="h-6 w-6" stroke="currentColor" fill="none" viewBox="0 0 24 24">
  132. <path :class="{'hidden': open, 'inline-flex': ! open }" class="inline-flex" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" />
  133. <path :class="{'hidden': ! open, 'inline-flex': open }" class="hidden" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
  134. </svg>
  135. </button>
  136. </div>
  137. </div>
  138. </div>
  139. <!-- Responsive Navigation Menu -->
  140. <div :class="{'block': open, 'hidden': ! open}" class="hidden sm:hidden">
  141. <div class="pt-2 pb-3 space-y-1">
  142. <x-responsive-nav-link :href="route('login')" :active="request()->routeIs('login')">
  143. {{ __('Войти') }}
  144. </x-responsive-nav-link>
  145. <x-responsive-nav-link :href="route('register')" :active="request()->routeIs('register')">
  146. {{ __('Регистрация') }}
  147. </x-responsive-nav-link>
  148. </div>
  149. </div>
  150. </nav>
  151. @endauth