Refactor routes to use cleaner URL structure with order_id parameter

This commit is contained in:
kbe
2025-09-06 03:12:11 +02:00
parent 01b545c83e
commit d9d43f45e5
11 changed files with 75 additions and 101 deletions

View File

@@ -30,7 +30,7 @@
<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">
@@ -49,9 +49,9 @@
</div>
</div>
<% else %>
<%= link_to t("header.login"), new_user_session_path,
<%= link_to "Se connecter", 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,
<%= link_to "S'inscrire", 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>

View File

@@ -197,7 +197,8 @@
<!-- Right Column: Ticket Selection -->
<div class="lg:col-span-1">
<%= form_with url: event_order_new_path(@event.slug, @event.id), method: :get, id: "checkout_form", local: true, data: {
<%= form_with url: order_new_path(@event.slug, @event.id), method: :get, id: "checkout_form", local: true, data: {
target: order_new_path(@event.slug, @event.id),
controller: "ticket-selection",
ticket_selection_target: "form",
ticket_selection_event_slug_value: @event.slug,

View File

@@ -89,7 +89,7 @@
<p class="text-gray-600 max-w-md mx-auto">Veuillez fournir les prénoms et noms des personnes qui utiliseront les billets.</p>
</div>
<%= form_with url: event_order_create_path(@event.slug, @event.id), method: :post, local: true, class: "space-y-8" do |form| %>
<%= form_with url: order_create_path(@event.slug, @event.id), method: :post, local: true, class: "space-y-8" do |form| %>
<div class="space-y-6">
<div class="flex items-center justify-center mb-2">
<div class="bg-purple-600 rounded-full p-2 mr-3">

View File

@@ -88,7 +88,7 @@
</div>
<% end %>
<% if @order.can_retry_payment? %>
<%= link_to checkout_order_path(@order), class: "bg-purple-600 hover:bg-purple-700 text-white font-medium py-2 px-4 rounded-lg transition-colors" do %>
<%= link_to order_checkout_path(@order), class: "bg-purple-600 hover:bg-purple-700 text-white font-medium py-2 px-4 rounded-lg transition-colors" do %>
<div class="flex items-center">
<svg class="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z"/>