From 54e99c2f7e57bc378ad70679df13b02430d88245 Mon Sep 17 00:00:00 2001 From: kbe Date: Thu, 4 Sep 2025 01:43:04 +0200 Subject: [PATCH] feat: Enhance orders/new view with integrated name collection form MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add breadcrumb navigation for better UX - Combine order summary and ticket name collection into single page - Add comprehensive name collection form for each ticket - Update form to submit to event-scoped order creation route - Improve visual design with proper sections and styling - Remove need for separate tickets controller flow 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- app/views/orders/new.html.erb | 115 +++++++++++++++++++++++++++------- 1 file changed, 92 insertions(+), 23 deletions(-) diff --git a/app/views/orders/new.html.erb b/app/views/orders/new.html.erb index df85ca3..d784f12 100644 --- a/app/views/orders/new.html.erb +++ b/app/views/orders/new.html.erb @@ -1,9 +1,39 @@
+ + +

Nouvelle Commande

-

Vérifiez vos billets avant de continuer vers le paiement

+

Vérifiez vos billets et indiquez les noms des participants

@@ -42,30 +72,69 @@ <% 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 %> - - - - Continuer vers les détails - <% end %> -
<% end %>
- -
- <% 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 %> - - - - Retour à l'événement - <% end %> - <% end %> -
+ + <% if @tickets_needing_names.any? %> +
+
+
+
+ + + +
+

Informations des participants

+

Veuillez fournir les prénoms et noms des personnes qui utiliseront les billets.

+
+ + <%= form_with url: event_order_create_path(@event.slug, @event.id), method: :post, local: true, class: "space-y-8" do |form| %> +
+
+
+ + + +
+

Billets nécessitant une identification

+
+

Les billets suivants nécessitent que vous indiquiez le prénom et le nom de chaque participant.

+ + <% @tickets_needing_names.each_with_index do |ticket, index| %> +
+
+
+ + + +
+

<%= ticket[:ticket_type_name] %> #<%= index + 1 %>

+
+ +
+
+ <%= form.label "tickets_attributes[#{index}][first_name]", "Prénom", class: "block text-sm font-medium text-gray-700 mb-1" %> + <%= form.text_field "tickets_attributes[#{index}][first_name]", required: true, class: "w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-purple-500 transition-all duration-200 shadow-sm", placeholder: "Entrez le prénom" %> + <%= form.hidden_field "tickets_attributes[#{index}][ticket_type_id]", value: ticket[:ticket_type_id] %> +
+ +
+ <%= form.label "tickets_attributes[#{index}][last_name]", "Nom", class: "block text-sm font-medium text-gray-700 mb-1" %> + <%= form.text_field "tickets_attributes[#{index}][last_name]", required: true, class: "w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-purple-500 transition-all duration-200 shadow-sm", placeholder: "Entrez le nom" %> +
+
+
+ <% end %> +
+ +
+ <%= link_to "Retour", event_path(@event.slug, @event), class: "px-6 py-3 border border-gray-300 text-gray-700 rounded-xl hover:bg-gray-50 text-center font-medium transition-colors duration-200" %> + <%= form.submit "Procéder au paiement", class: "flex-1 bg-gradient-to-r from-purple-600 to-indigo-600 hover:from-purple-700 hover:to-indigo-700 text-white font-medium py-3 px-6 rounded-xl shadow-sm transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-purple-500 focus:ring-offset-2 transform hover:-translate-y-0.5" %> +
+ <% end %> +
+
+ <% end %> \ No newline at end of file