96 lines
5.8 KiB
Plaintext
Executable File
96 lines
5.8 KiB
Plaintext
Executable File
<header class="bg-neutral-800 border-b border-neutral-700">
|
|
<nav x-data="{ open: false }" class="container mx-auto px-4 sm:px-6 lg:px-8">
|
|
<div class="flex justify-between h-16">
|
|
<!-- Logo & Navigation -->
|
|
<div class="flex items-center space-x-8">
|
|
<%= link_to Rails.application.config.app_name, current_user ? "/dashboard" : "/",
|
|
class: "text-xl font-bold text-white" %>
|
|
|
|
<div class="hidden sm:flex space-x-6">
|
|
<%= link_to t("header.parties"), events_path,
|
|
class: "bg-black 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.concerts"), "#",
|
|
class: "bg-black text-gray-100 hover:text-purple-200 px-3 py-2 rounded-md text-sm font-medium transition-colors duration-200" %>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Authentication -->
|
|
<div class="flex items-center space-x-4">
|
|
<% if user_signed_in? %>
|
|
<div class="relative" x-data="{ open: false }" @click.outside="open = false">
|
|
<button @click="open = !open"
|
|
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>
|
|
|
|
<div x-show="open" x-transition
|
|
class="absolute right-0 mt-2 w-48 rounded-md shadow-lg z-50">
|
|
<%= link_to t("header.profile"), edit_user_registration_path,
|
|
class: "block px-4 py-2 text-sm bg-black text-gray-100 hover:bg-purple-700 first:rounded-t-md" %>
|
|
<%= link_to t("header.reservations"), "#",
|
|
class: "block px-4 py-2 text-sm bg-black text-gray-100 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-4 py-2 text-sm bg-black text-gray-100 hover:bg-purple-700 last:rounded-b-md" %>
|
|
</div>
|
|
</div>
|
|
<% else %>
|
|
<div class="hidden sm:flex items-center space-x-4">
|
|
<%= link_to t("header.login"), new_user_session_path,
|
|
class: "bg-black 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" %>
|
|
</div>
|
|
<% end %>
|
|
<!-- Mobile Menu Button -->
|
|
<button @click="open = !open" class="sm:hidden p-2 rounded-md text-neutral-300 hover:text-white hover:bg-purple-700">
|
|
<svg class="h-6 w-6" stroke="currentColor" fill="none" viewBox="0 0 24 24">
|
|
<path :class="{ "hidden": open }" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" />
|
|
<path :class="{ "hidden": !open }" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
|
|
</svg>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Mobile Menu -->
|
|
<div :class="{ "block": open, "hidden": !open }" 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 bg-black 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 bg-black 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 bg-black 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 bg-black 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 bg-black 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 bg-black 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>
|