109 lines
6.5 KiB
Plaintext
Executable File
109 lines
6.5 KiB
Plaintext
Executable File
<header class="bg-neutral-800 border-b border-neutral-700">
|
|
<nav data-controller="header" class="container mx-auto px-4 sm:px-6 lg:px-8">
|
|
<div class="flex items-center h-16 justify-between">
|
|
<!-- Logo -->
|
|
<div class="flex-shrink-0 flex items-center">
|
|
<%= link_to Rails.application.config.app_name, current_user ? "/dashboard" : "/",
|
|
class: "text-xl font-bold text-white" %>
|
|
</div>
|
|
|
|
<!-- Desktop Navigation -->
|
|
<div class="hidden sm:flex items-center space-x-6 w-full justify-start">
|
|
<%= link_to "Afterworks", events_path,
|
|
class: "mx-4 text-gray-100 hover:text-purple-200 py-2 rounded-md text-sm font-medium transition-colors duration-200" %>
|
|
|
|
<%= link_to "Évenements", "#",
|
|
class: "mx-4 text-gray-100 hover:text-purple-200 py-2 rounded-md text-sm font-medium transition-colors duration-200" %>
|
|
|
|
<%= link_to "Concerts", "#",
|
|
class: "mx-4 text-gray-100 hover:text-purple-200 py-2 rounded-md text-sm font-medium transition-colors duration-200" %>
|
|
</div>
|
|
|
|
<!-- Authentication -->
|
|
<div class="hidden sm:flex items-center space-x-4">
|
|
<% if user_signed_in? %>
|
|
<div class="relative" data-header-target="userMenuButton">
|
|
<button data-action="click->header#toggleUserMenu"
|
|
class="bg-purple-700 text-white border border-purple-800 font-medium py-2 px-4 rounded-lg hover:bg-purple-800 transition-colors duration-200 flex items-center space-x-2">
|
|
<span><%= current_user.email.length > 20 ? current_user.email[0,20] + "..." : current_user.email %></span>
|
|
<svg class="w-4 h-4" fill="currentColor" viewBox="0 0 20 20">
|
|
<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" />
|
|
</svg>
|
|
</button>
|
|
|
|
<!-- User Dropdown Menu -->
|
|
<div data-header-target="userMenu" class="hidden absolute right-0 mt-2 w-56 bg-white rounded-lg shadow-lg border border-gray-200 py-1 z-50">
|
|
<div class="px-4 py-2 text-sm text-gray-900 border-b border-gray-100">
|
|
<div class="font-medium"><%= current_user.first_name || current_user.email %></div>
|
|
<div class="text-gray-500"><%= current_user.email %></div>
|
|
</div>
|
|
<%= link_to "Profile", edit_user_registration_path,
|
|
class: "block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 transition-colors duration-200" %>
|
|
<%= link_to "Reservations", "#",
|
|
class: "block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 transition-colors duration-200" %>
|
|
<div class="border-t border-gray-100">
|
|
<%= link_to "Sign out", destroy_user_session_path,
|
|
data: { controller: "logout", action: "click->logout#signOut", logout_url_value: destroy_user_session_path, login_url_value: new_user_session_path, turbo: false },
|
|
class: "block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 transition-colors duration-200" %>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<% else %>
|
|
<%= link_to t("header.login"), new_user_session_path,
|
|
class: "text-gray-100 hover:text-purple-200 px-3 py-2 rounded-md text-sm font-medium transition-colors duration-200" %>
|
|
<%= link_to t("header.register"), new_user_registration_path,
|
|
class: "bg-purple-600 text-white font-medium py-2 px-4 rounded-lg hover:bg-purple-700 transition-colors duration-200" %>
|
|
<% end %>
|
|
</div>
|
|
|
|
<!-- Mobile menu button -->
|
|
<div class="flex-shrink-0 sm:hidden">
|
|
<button data-action="click->header#toggleMobileMenu" data-header-target="mobileMenuButton" class="p-2 rounded-md text-neutral-300 hover:text-white hover:bg-purple-700">
|
|
<svg data-menu-icon="open" class="h-6 w-6" stroke="currentColor" fill="none" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" />
|
|
</svg>
|
|
<svg data-menu-icon="close" class="h-6 w-6 hidden" stroke="currentColor" fill="none" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
|
|
</svg>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Mobile Menu -->
|
|
<div data-header-target="mobileMenu" class="hidden sm:hidden">
|
|
<div class="px-2 pt-2 pb-3 space-y-1">
|
|
<%= link_to t("header.parties"), events_path,
|
|
class: "block px-3 py-2 rounded-md text-base font-medium text-gray-100 hover:text-purple-200 hover:bg-purple-700" %>
|
|
<%= link_to t("header.concerts"), "#",
|
|
class: "block px-3 py-2 rounded-md text-base font-medium text-gray-100 hover:text-purple-200 hover:bg-purple-700" %>
|
|
</div>
|
|
|
|
<div class="pt-4 pb-3 border-t border-gray-700">
|
|
<% if user_signed_in? %>
|
|
<div class="px-4 mb-3">
|
|
<div class="text-base font-medium text-white">
|
|
<%= current_user.first_name || current_user.email %>
|
|
</div>
|
|
</div>
|
|
<div class="px-2 space-y-1">
|
|
<%= link_to t("header.profile"), edit_user_registration_path,
|
|
class: "block px-3 py-2 rounded-md text-base font-medium text-gray-100 hover:text-purple-200 hover:bg-purple-700" %>
|
|
<%= link_to t("header.reservations"), "#",
|
|
class: "block px-3 py-2 rounded-md text-base font-medium text-gray-100 hover:text-purple-200 hover:bg-purple-700" %>
|
|
<%= link_to t("header.logout"), destroy_user_session_path,
|
|
data: { controller: "logout", action: "click->logout#signOut", logout_url_value: destroy_user_session_path, login_url_value: new_user_session_path, turbo: false },
|
|
class: "block px-3 py-2 rounded-md text-base font-medium text-gray-100 hover:text-purple-200 hover:bg-purple-700" %>
|
|
</div>
|
|
<% else %>
|
|
<div class="px-2 space-y-1">
|
|
<%= link_to t("header.login"), new_user_session_path,
|
|
class: "block px-3 py-2 rounded-md text-base font-medium text-gray-100 hover:text-purple-200 hover:bg-purple-700" %>
|
|
<%= link_to t("header.register"), new_user_registration_path,
|
|
class: "block px-3 py-2 rounded-md text-base font-medium bg-purple-600 text-white hover:bg-purple-700" %>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
</header>
|