develop #3

Merged
kbe merged 227 commits from develop into main 2025-09-16 14:35:23 +00:00
8 changed files with 186 additions and 207 deletions
Showing only changes of commit 1989cbf6af - Show all commits

View File

@@ -1,39 +1,70 @@
/* Flash Messages - Theme Integration */ .notification {
.flash-message { font-family: var(--font-sans, 'Plus Jakarta Sans', sans-serif);
@apply max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 mb-4; box-shadow: var(--shadow-lg);
border: 1px solid;
transition: all var(--duration-normal, 0.3s) ease-out;
} }
/* Base styles for all flash messages */ .notification-icon {
.flash-message .flex { min-width: 20px;
@apply rounded-md p-4 border shadow-md; height: 20px;
} }
/* Success message styles */ .notification-icon i {
.flash-message-success { color: currentColor !important;
@apply bg-green-50 border-green-100 text-green-800;
} }
/* Error message styles */ .notification-success {
.flash-message-error { background: var(--color-success-light, #dcfce7);
@apply bg-red-50 border-red-100 text-red-800; color: var(--color-success-dark, #15803d);
border-color: var(--color-success, #22c55e);
} }
/* Warning message styles */ .notification-warning {
.flash-message-warning { background: var(--color-warning-light, #fef3c7);
@apply bg-yellow-50 border-yellow-100 text-yellow-800; color: var(--color-warning-dark, #92400e);
border-color: var(--color-warning, #f59e0b);
} }
/* Info message styles */ .notification-error {
.flash-message-info { background: var(--color-danger-light, #fecaca);
@apply bg-blue-50 border-blue-100 text-blue-800; color: var(--color-danger-dark, #dc2626);
border-color: var(--color-danger, #ef4444);
} }
/* Notice message styles */ .notification-info {
.flash-message-notice { background: var(--color-primary-50, #f0f9ff);
@apply bg-purple-50 border-purple-100 text-purple-800; color: var(--color-primary-800, #1e40af);
border-color: var(--color-primary-200, #bfdbfe);
} }
/* Alert message styles */ /* Fallback colors if CSS variables are not available */
.flash-message-alert { .notification-success {
@apply bg-red-50 border-red-100 text-red-800; background: #dcfce7;
color: #15803d;
border-color: #22c55e;
} }
.notification-warning {
background: #fef3c7;
color: #92400e;
border-color: #f59e0b;
}
.notification-error {
background: #fecaca;
color: #dc2626;
border-color: #ef4444;
}
.notification-info {
background: #f0f9ff;
color: #1e40af;
border-color: #bfdbfe;
}
/* Animation for fade out */
.flash-messages-container .notification.opacity-0 {
opacity: 0;
transform: translateY(-10px);
}

View File

@@ -10,7 +10,7 @@ const buttonVariants = cva(
variants: { variants: {
variant: { variant: {
default: default:
"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90", "bg-purple text-purple-foreground shadow-xs hover:bg-purple/90",
destructive: destructive:
"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60", "bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
outline: outline:
@@ -19,7 +19,7 @@ const buttonVariants = cva(
"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80", "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
ghost: ghost:
"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50", "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
link: "text-primary underline-offset-4 hover:underline", link: "text-purple underline-offset-4 hover:underline",
}, },
size: { size: {
default: "h-9 px-4 py-2 has-[>svg]:px-3", default: "h-9 px-4 py-2 has-[>svg]:px-3",

View File

@@ -1,137 +1,95 @@
<header class="shadow-sm border-b border-neutral-700"> <header class="bg-neutral-800 border-b border-neutral-700">
<div class="bg-neutral-900"> <nav x-data="{ open: false }" class="container mx-auto px-4 sm:px-6 lg:px-8">
<nav x-data="{ open: false }" class="bg-neutral-800 border-b border-neutral-700"> <div class="flex justify-between h-16">
<!-- Primary Navigation Menu --> <!-- Logo & Navigation -->
<div class="container mx-auto px-4 sm:px-6 lg:px-8"> <div class="flex items-center space-x-8">
<div class="flex justify-between h-16"> <%= link_to Rails.application.config.app_name, current_user ? "/dashboard" : "/",
<div class="flex"> class: "text-xl font-bold text-white" %>
<!-- Logo -->
<div class="shrink-0 flex items-center"> <div class="hidden sm:flex space-x-6">
<%= link_to Rails.application.config.app_name, current_user ? "/dashboard" : "/", class: "text-xl font-bold text-white" %> <%= link_to t("header.parties"), events_path,
</div> class: "bg-black text-gray-100 hover:text-purple-200 px-3 py-2 rounded-md text-sm font-medium transition-colors duration-200" %>
<!-- Navigation Links --> <%= link_to t("header.concerts"), "#",
<div class="hidden space-x-8 sm:-my-px sm:ms-10 sm:flex items-center"> 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.parties'), events_path,
class: "text-neutral-100 hover:text-primary-200 px-3 py-2 rounded-md text-sm font-medium transition-colors duration-200"
%>
<%= link_to t('header.concerts'), "#" ,
class: "text-neutral-100 hover:text-primary-200 px-3 py-2 rounded-md text-sm font-medium transition-colors duration-200"
%>
</div>
</div> </div>
<!-- Authentication Links --> </div>
<!-- Authentication -->
<div class="flex items-center space-x-4">
<% if user_signed_in? %> <% if user_signed_in? %>
<!-- Settings Dropdown --> <div class="relative" x-data="{ open: false }" @click.outside="open = false">
<div class="hidden sm:flex sm:items-center sm:ms-6"> <button @click="open = !open"
<div class="relative" x-data="{ open: false }" @click.outside="open = false" @close.stop="open = false"> 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">
<div @click="open = ! open"> <span><%= current_user.email.length > 20 ? current_user.email[0,20] + "..." : current_user.email %></span>
<button <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 20 20">
class="bg-primary-700 text-white border border-primary-800 font-medium py-2 px-4 rounded-lg hover:bg-primary-800 transition-colors duration-200 focus-ring"> <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" />
<div> </svg>
<%= current_user.email.length> 20 ? current_user.email[0,20] + "..." : current_user.email %> </button>
</div>
<div class="ms-1"> <div x-show="open" x-transition
<svg class="fill-current h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"> class="absolute right-0 mt-2 w-48 rounded-md shadow-lg z-50">
<path fill-rule="evenodd" <%= link_to t("header.profile"), edit_user_registration_path,
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" class: "block px-4 py-2 text-sm bg-black text-gray-100 hover:bg-purple-700 first:rounded-t-md" %>
clip-rule="evenodd" /> <%= link_to t("header.reservations"), "#",
</svg> class: "block px-4 py-2 text-sm bg-black text-gray-100 hover:bg-purple-700" %>
</div> <%= link_to t("header.logout"), destroy_user_session_path,
</button> data: { controller: "logout", action: "click->logout#signOut",
</div> logout_url_value: destroy_user_session_path, login_url_value: new_user_session_path, turbo: false },
<div x-show="open" x-transition:enter="transition ease-out duration-200" class: "block px-4 py-2 text-sm bg-black text-gray-100 hover:bg-purple-700 last:rounded-b-md" %>
x-transition:enter-start="opacity-0 scale-95" x-transition:enter-end="opacity-100 scale-100" </div>
x-transition:leave="transition ease-in duration-75" x-transition:leave-start="opacity-100 scale-100" </div>
x-transition:leave-end="opacity-0 scale-95" <% else %>
class="absolute z-50 mt-2 w-48 rounded-md shadow-lg origin-top-right right-0" style="display: none;" <div class="hidden sm:flex items-center space-x-4">
@click="open = false"> <%= link_to t("header.login"), new_user_session_path,
<div class="rounded-md ring-1 ring-primary-700 py-1 bg-primary-600"> 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.profile') , edit_user_registration_path, <%= link_to t("header.register"), new_user_registration_path,
class: "block w-full px-4 py-2 text-start text-sm leading-5 text-neutral-100 hover:bg-primary-700" %> class: "bg-purple-600 text-white font-medium py-2 px-4 rounded-lg hover:bg-purple-700 transition-colors duration-200" %>
<%= link_to t('header.reservations') , "#" ,
class: "block w-full px-4 py-2 text-start text-sm leading-5 text-neutral-100 hover:bg-primary-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 w-full px-4 py-2 text-start text-sm leading-5 text-neutral-100 hover:bg-primary-700" %>
</div>
</div>
h <!-- Login/Register Links -->
<div class="hidden sm:flex sm:items-center sm:ms-6 space-x-4 items-center">
<%= link_to t('header.login') , new_user_session_path,
class: "text-neutral-100 hover:text-primary-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-primary-50 text-primary-600 font-medium py-2 px-4 rounded-lg shadow-sm hover:bg-primary-100 transition-all duration-200"
%>
</div> </div>
<% end %> <% end %>
<!-- Hamburger --> <!-- Mobile Menu Button -->
<div class="-me-2 flex items-center sm:hidden"> <button @click="open = !open" class="sm:hidden p-2 rounded-md text-neutral-300 hover:text-white hover:bg-purple-700">
<button @click="open = ! open" <svg class="h-6 w-6" stroke="currentColor" fill="none" viewBox="0 0 24 24">
class="p-2 rounded-md text-neutral-300 hover:text-white hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-white"> <path :class="{ "hidden": open }" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" />
<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="M6 18L18 6M6 6l12 12" />
<path :class="{ 'hidden': open, 'inline-flex': !open }" class="inline-flex" stroke-linecap="round" </svg>
stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" /> </button>
<path :class="{ 'hidden': !open, 'inline-flex': open }" class="hidden" stroke-linecap="round"
stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
</svg>
</button>
</div>
</div> </div>
</div> </div>
<!-- Responsive Navigation Menu -->
<div :class="{ 'block': open, 'hidden': !open }" class="hidden sm:hidden">
<div class="pt-2 pb-3 space-y-1 bg-primary-600">
<%= link_to t('header.parties') , "#" ,
class: "block px-3 py-2 rounded-md text-base font-medium text-neutral-100 hover:text-primary-200 hover:bg-primary-700"
%>
<%= link_to t('header.concerts') , "#" ,
class: "block px-3 py-2 rounded-md text-base font-medium text-neutral-100 hover:text-primary-200 hover:bg-primary-700"
%>
</div>
<!-- Responsive Settings Options -->
<div class="pt-4 pb-1 border-t border-primary-700 bg-primary-600">
<% if user_signed_in? %>
<div class="px-4">
<% if current_user.first_name %>
<div class="font-medium text-base text-white">
<%= current_user.first_name %>
</div>
<% else %>
<div class="font-medium text-base text-white">
<%= current_user.email.length> 20 ? current_user.email[0,20] + "..." : current_user.email %>
</div>
<%# <div class="font-medium text-sm text-purple-200">
<%= current_user.email.length> 20 ? current_user.email[0,20] + "..." : current_user.email %>
</div>
<% end %>
</div>
<div class="mt-3 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-neutral-100 hover:text-primary-200 hover:bg-primary-700"
%>
<%= link_to t('header.reservations') , "#" ,
class: "block px-3 py-2 rounded-md text-base font-medium text-neutral-100 hover:text-primary-200 hover:bg-primary-700"
%>
<%= link_to t('header.logout') , destroy_user_session_path, data: { controller: "logout" , action: "click->logout#signOut", <!-- Mobile Menu -->
logout_url_value: destroy_user_session_path, login_url_value: new_user_session_path, turbo: false }, <div :class="{ "block": open, "hidden": !open }" class="hidden sm:hidden">
class: "block px-3 py-2 rounded-md text-base font-medium text-neutral-100 hover:text-primary-200 hover:bg-primary-700" <div class="px-2 pt-2 pb-3 space-y-1">
%> <%= link_to t("header.parties"), events_path,
</div> 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" %>
<% else %> <%= link_to t("header.concerts"), "#",
<div class="mt-3 space-y-1"> 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, </div>
class: "block px-3 py-2 rounded-md text-base font-medium text-neutral-100 hover:text-primary-200 hover:bg-primary-700"
%> <div class="pt-4 pb-3 border-t border-gray-700">
<%= link_to t('header.login') , new_user_session_path, <% if user_signed_in? %>
class: "block px-3 py-2 rounded-md text-base font-medium text-neutral-100 hover:text-primary-200 hover:bg-primary-700" <div class="px-4 mb-3">
%> <div class="text-base font-medium text-white">
</div> <%= current_user.first_name || current_user.email %>
<% end %> </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> </div>
</div> </nav>
</nav>
</div>
</header> </header>

View File

@@ -40,9 +40,6 @@
<label for="user_remember_me" class="ml-2 block text-sm text-neutral-700"> <%= t('devise.sessions.new.remember_me') %> </label> <label for="user_remember_me" class="ml-2 block text-sm text-neutral-700"> <%= t('devise.sessions.new.remember_me') %> </label>
</div> </div>
<div class="text-sm">
<%= link_to t('devise.sessions.new.forgot_password'), new_password_path(resource_name), class: "font-medium text-purple-600 hover:text-purple-500" %>
</div>
</div> </div>
<% end %> <% end %>

View File

@@ -32,13 +32,10 @@
<div class="app-wrapper"> <div class="app-wrapper">
<%= render "components/header" %> <%= render "components/header" %>
<main> <!-- Flash messages positioned between header and content -->
<% if flash.any? %> <%= render "shared/flash_messages" %>
<div class="flash py-6">
<%= render "shared/flash_messages" %>
</div>
<% end %>
<main class="">
<div class="yield"> <div class="yield">
<%= yield %> <%= yield %>
</div> </div>

View File

@@ -1,25 +1,21 @@
<% flash.each do |type, message| %> <% if flash.any? %>
<% if message.present? %> <div class="flash-messages-container" style="position: relative; width: 100%; display: flex; justify-content: center; padding: var(--space-4); margin-top: var(--space-4);">
<div class="rounded-md bg-green-50 border-green-100 p-4 border <%= flash_class(type) %> animate-fade-in" data-controller="flash-message"> <div style="width: 100%; max-width: 600px;">
<div class="flex"> <% flash.each do |type, message| %>
<div class="shrink-0"> <div class="notification <%= flash_class(type) %>"
<%= flash_icon(type) %> data-controller="flash-message"
</div> style="display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4); border-radius: var(--radius-lg); margin-bottom: var(--space-3); font-weight: 500; width: 100%; box-sizing: border-box;">
<div class="ml-3 w-full"> <div class="notification-icon" style="display: flex; align-items: center; flex-shrink: 0;">
<div class="space-y-2"> <%= flash_icon(type) %>
<div class="text-sm text-green-700">
<p class="text-sm font-medium"><%= message %></p>
</div>
</div> </div>
</div> <span style="flex: 1;"><%= message %></span>
<div class="ml-4 flex-shrink-0 flex"> <button data-action="click->flash-message#close"
<button data-action="click->flash-message#close" class="inline-flex text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-purple-500"> style="background: none; border: none; cursor: pointer; padding: var(--space-1); color: inherit; opacity: 0.7; transition: opacity 0.2s;">
<svg class="h-5 w-5" fill="currentColor" viewBox="0 0 20 20"> <i data-lucide="x" style="width: 16px; height: 16px;"></i>
<path fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd" />
</svg>
</button> </button>
</div> </div>
</div> <% end %>
</div> </div>
<% end %> </div>
<% end %>
<% end %>

View File

@@ -15,10 +15,10 @@ Rails.application.routes.draw do
# Pages # Pages
get "dashboard", to: "pages#dashboard", as: "dashboard" get "dashboard", to: "pages#dashboard", as: "dashboard"
# events # Events
get "events", to: "events#index", as: "events" get "events", to: "events#index", as: "events"
get "events/:slug.:id", to: "events#show", as: "party" get "events/:slug.:id", to: "events#show", as: "event"
post "events/:slug.:id/checkout", to: "events#checkout", as: "party_checkout" post "events/:slug.:id/checkout", to: "events#checkout", as: "event_checkout"
# Routes for devise authentication Gem # Routes for devise authentication Gem
# Bind devise to user # Bind devise to user

View File

@@ -31,11 +31,11 @@ end
# Reload all users after creation # Reload all users after creation
users = User.all.to_a users = User.all.to_a
# Create sample parties # Create sample events
parties_data = [ events_data = [
{ {
name: "Summer Beach Party", name: "Summer Beach Event",
slug: "summer-beach-party", slug: "summer-beach-event",
description: "Join us for an amazing night at the beach with music, dancing, and cocktails.", description: "Join us for an amazing night at the beach with music, dancing, and cocktails.",
venue_name: "Sunset Beach Resort", venue_name: "Sunset Beach Resort",
venue_address: "123 Ocean Drive, Miami, FL", venue_address: "123 Ocean Drive, Miami, FL",
@@ -77,40 +77,40 @@ parties_data = [
} }
] ]
parties = [] events = []
parties_data.each do |party_data| events_data.each do |event_data|
user = party_data.delete(:user) user = event_data.delete(:user)
party = Party.find_or_create_by!(name: party_data[:name]) do |p| event = Event.find_or_create_by!(name: event_data[:name]) do |p|
p.assign_attributes(party_data) p.assign_attributes(event_data)
p.user = user p.user = user
p.state = :published p.state = :published
end end
parties << party events << event
end end
# Create ticket types for each party # Create ticket types for each event
parties.each_with_index do |party, index| events.each_with_index do |event, index|
# General Admission ticket type # General Admission ticket type
TicketType.find_or_create_by!(party: party, name: "General Admission") do |tt| TicketType.find_or_create_by!(event: event, name: "General Admission") do |tt|
tt.description = "General admission ticket for #{party.name}" tt.description = "General admission ticket for #{event.name}"
tt.price_cents = 2500 # $25.00 tt.price_cents = 2500 # $25.00
tt.quantity = 100 tt.quantity = 100
tt.sale_start_at = 1.month.ago tt.sale_start_at = 1.month.ago
tt.sale_end_at = party.start_time - 1.hour tt.sale_end_at = event.start_time - 1.hour
tt.requires_id = false tt.requires_id = false
tt.minimum_age = 18 tt.minimum_age = 18
end end
# VIP ticket type # VIP ticket type
TicketType.find_or_create_by!(party: party, name: "VIP") do |tt| TicketType.find_or_create_by!(event: event, name: "VIP") do |tt|
tt.description = "VIP access ticket for #{party.name} with premium benefits" tt.description = "VIP access ticket for #{event.name} with premium benefits"
tt.price_cents = 7500 # $75.00 tt.price_cents = 7500 # $75.00
tt.quantity = 20 tt.quantity = 20
tt.sale_start_at = 1.month.ago tt.sale_start_at = 1.month.ago
tt.sale_end_at = party.start_time - 1.hour tt.sale_end_at = event.start_time - 1.hour
tt.requires_id = true tt.requires_id = true
tt.minimum_age = 21 tt.minimum_age = 21
end end
end end
puts "Created #{User.count} users, #{Party.count} parties, and #{TicketType.count} ticket types" puts "Created #{User.count} users, #{Event.count} events, and #{TicketType.count} ticket types"