wip: OrdersController#new
This commit is contained in:
@@ -208,7 +208,7 @@
|
||||
|
||||
<!-- Right Column: Ticket Selection -->
|
||||
<div class="lg:col-span-1">
|
||||
<%= form_with url: "#", method: :post, id: "checkout_form", local: true, data: {
|
||||
<%= form_with url: order_new_path, method: :get, id: "checkout_form", local: true, data: {
|
||||
controller: "ticket-selection",
|
||||
ticket_selection_target: "form",
|
||||
ticket_selection_event_slug_value: @event.slug,
|
||||
|
||||
71
app/views/orders/new.html.erb
Normal file
71
app/views/orders/new.html.erb
Normal file
@@ -0,0 +1,71 @@
|
||||
<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>
|
||||
@@ -26,7 +26,7 @@
|
||||
</div>
|
||||
|
||||
<div class="featured-events-grid" data-controller="featured-event">
|
||||
<% @events.each do |event| %>
|
||||
<% @featured_events.each do |event| %>
|
||||
<div class="featured-event-card" data-featured-event-target="card">
|
||||
<%= link_to event_path(event.slug, event) do %>
|
||||
<img src="<%= event.image %>" alt="<%= event.name %>" class="featured-event-image" data-featured-event-target="animated">
|
||||
@@ -37,7 +37,7 @@
|
||||
<span class="badge badge-featured">★ En vedette</span>
|
||||
<% end %>
|
||||
<% if event.ticket_types.any? { |ticket_type| ticket_type.available_quantity > 0 } %>
|
||||
<span class="badge badge-available">Disponible</span>
|
||||
<!--<span class="badge badge-available">Disponible</span>-->
|
||||
<% end %>
|
||||
</div>
|
||||
<h3 class="featured-event-title"><%= event.name %></h3>
|
||||
@@ -154,4 +154,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
Reference in New Issue
Block a user