Files
aperonight/app/views/orders/new.html.erb
2025-09-03 01:52:48 +02:00

71 lines
3.3 KiB
Plaintext

<div class="min-h-screen bg-gradient-to-br from-gray-50 to-gray-100">
<div class="max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
<!-- Page Header -->
<div class="mb-8">
<h1 class="text-3xl font-bold text-gray-900 mb-2">Nouvelle Commande</h1>
<p class="text-gray-600">Vérifiez vos billets avant de continuer vers le paiement</p>
</div>
<!-- Order Summary -->
<div class="bg-white rounded-2xl shadow-sm border border-gray-200 p-6">
<h2 class="text-xl font-semibold text-gray-900 mb-4">Résumé de votre commande</h2>
<% if @event %>
<div class="mb-6">
<h3 class="text-lg font-medium text-gray-800"><%= @event.name %></h3>
<p class="text-gray-600"><%= @event.venue_name %></p>
<% if @event.starts_at %>
<p class="text-sm text-gray-500">
<%= @event.starts_at.strftime("%d/%m/%Y à %H:%M") %>
</p>
<% end %>
</div>
<!-- Cart Items -->
<div class="space-y-4 mb-6">
<% @cart_data.each do |ticket_type_id, item| %>
<% ticket_type = @event.ticket_types.find_by(id: ticket_type_id) %>
<% if ticket_type && item["quantity"].to_i > 0 %>
<div class="flex justify-between items-center py-3 border-b border-gray-100">
<div>
<h4 class="font-medium text-gray-900"><%= ticket_type.name %></h4>
<p class="text-sm text-gray-600"><%= ticket_type.description if ticket_type.description.present? %></p>
</div>
<div class="text-right">
<p class="font-medium">Quantité: <%= item["quantity"] %></p>
<p class="text-lg font-semibold text-purple-700">
<%= number_to_currency(ticket_type.price_cents * item["quantity"].to_i / 100.0, unit: "€", separator: ",", delimiter: " ") %>
</p>
</div>
</div>
<% end %>
<% end %>
</div>
<!-- Continue to Tickets -->
<div class="flex justify-end">
<%= link_to ticket_new_path,
class: "inline-flex items-center px-6 py-3 border border-transparent text-base font-medium rounded-xl text-white bg-gradient-to-r from-purple-600 to-indigo-600 hover:from-purple-700 hover:to-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-purple-500 transition-all duration-200" do %>
<svg class="w-5 h-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 7l5 5m0 0l-5 5m5-5H6"></path>
</svg>
Continuer vers les détails
<% end %>
</div>
<% end %>
</div>
<!-- Back to Event -->
<div class="mt-6">
<% if @event %>
<%= link_to event_path(@event.slug, @event),
class: "inline-flex items-center text-purple-600 hover:text-purple-700 font-medium transition-colors" do %>
<svg class="w-4 h-4 mr-1" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 19l-7-7m0 0l7-7m-7 7h18"></path>
</svg>
Retour à l'événement
<% end %>
<% end %>
</div>
</div>
</div>