chore: On tickets#show add back link to order#show

Instead of going back to dashboard, user now goes to order
details.
This commit is contained in:
kbe
2025-09-07 00:21:36 +02:00
parent 7694e50fa0
commit ceb5a13297
3 changed files with 6 additions and 4 deletions

View File

@@ -58,7 +58,10 @@ class TicketsController < ApplicationController
redirect_to dashboard_path, alert: "Billet non trouvé" redirect_to dashboard_path, alert: "Billet non trouvé"
return return
end end
@event = @ticket.event @event = @ticket.event
@order = @ticket.order
rescue ActiveRecord::RecordNotFound rescue ActiveRecord::RecordNotFound
redirect_to dashboard_path, alert: "Billet non trouvé" redirect_to dashboard_path, alert: "Billet non trouvé"
end end

View File

@@ -27,7 +27,7 @@
<div class="bg-gradient-to-r from-purple-600 to-indigo-600 px-8 py-6"> <div class="bg-gradient-to-r from-purple-600 to-indigo-600 px-8 py-6">
<div class="flex items-center justify-between"> <div class="flex items-center justify-between">
<div> <div>
<h1 class="text-2xl md:text-3xl font-bold text-white mb-2">Billet Électronique</h1> <h1 class="text-2xl md:text-3xl font-bold text-white mb-2">Billet électronique</h1>
<p class="text-purple-100">ID: #<%= @ticket.id %></p> <p class="text-purple-100">ID: #<%= @ticket.id %></p>
</div> </div>
<div class="text-right"> <div class="text-right">
@@ -150,12 +150,12 @@
<!-- Actions --> <!-- Actions -->
<div class="mt-8 pt-6 border-t border-gray-200"> <div class="mt-8 pt-6 border-t border-gray-200">
<div class="flex flex-col sm:flex-row gap-4"> <div class="flex flex-col sm:flex-row gap-4">
<%= link_to dashboard_path, <%= link_to order_path(@order),
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" do %> 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" do %>
<svg class="w-4 h-4 inline-block mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <svg class="w-4 h-4 inline-block mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 16l-4-4m0 0l4-4m-4 4h18"/> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 16l-4-4m0 0l4-4m-4 4h18"/>
</svg> </svg>
Retour au tableau de bord Retour aux informations de commande
<% end %> <% end %>
<% if @ticket.status == 'active' %> <% if @ticket.status == 'active' %>

View File

@@ -60,7 +60,6 @@ Rails.application.routes.draw do
get "payments/cancel", to: "tickets#payment_cancel", as: "payment_cancel" get "payments/cancel", to: "tickets#payment_cancel", as: "payment_cancel"
# === Tickets === # === Tickets ===
# Support both ticket_id and qr_code for backward compatibility
get "tickets/:qr_code", to: "tickets#show", as: "ticket" get "tickets/:qr_code", to: "tickets#show", as: "ticket"
get "tickets/:qr_code/download", to: "tickets#download", as: "ticket_download" get "tickets/:qr_code/download", to: "tickets#download", as: "ticket_download"