develop #3

Merged
kbe merged 227 commits from develop into main 2025-09-16 14:35:23 +00:00
4 changed files with 48 additions and 34 deletions
Showing only changes of commit b8efa1e26d - Show all commits

View File

@@ -20,14 +20,14 @@ class TicketPdfGenerator
# Header # Header
pdf.fill_color "2D1B69" pdf.fill_color "2D1B69"
pdf.font "Helvetica", style: :bold, size: 24 pdf.font "Helvetica", style: :bold, size: 24
pdf.text "ApéroNight", align: :center pdf.text ENV.fetch("APP_NAME", "Aperonight"), align: :center
pdf.move_down 10 pdf.move_down 10
# Event name # Event name
pdf.fill_color "000000" pdf.fill_color "000000"
pdf.font "Helvetica", style: :bold, size: 18 pdf.font "Helvetica", style: :bold, size: 18
pdf.text ticket.event.name, align: :center pdf.text ticket.event.name, align: :center
pdf.move_down 20 pdf.move_down 10
# Ticket info box # Ticket info box
pdf.stroke_color "E5E7EB" pdf.stroke_color "E5E7EB"
@@ -40,21 +40,29 @@ class TicketPdfGenerator
pdf.font "Helvetica", size: 12 pdf.font "Helvetica", size: 12
# Customer name # Customer name
pdf.text "Ticket Holder:", style: :bold pdf.indent 10 do
pdf.text "#{ticket.first_name} #{ticket.last_name}" pdf.text "Ticket Holder:", style: :bold
pdf.text "#{ticket.first_name} #{ticket.last_name}"
end
pdf.move_down 8 pdf.move_down 8
# Ticket details # Ticket details
pdf.text "Ticket Type:", style: :bold pdf.indent 10 do
pdf.text ticket.ticket_type.name pdf.text "Ticket Type:", style: :bold
pdf.text ticket.ticket_type.name
end
pdf.move_down 8 pdf.move_down 8
pdf.text "Price:", style: :bold pdf.indent 10 do
pdf.text "#{ticket.price_euros}" pdf.text "Price:", style: :bold
pdf.text "#{ticket.price_euros}"
end
pdf.move_down 8 pdf.move_down 8
pdf.text "Date & Time:", style: :bold pdf.indent 10 do
pdf.text ticket.event.start_time.strftime("%B %d, %Y at %I:%M %p") pdf.text "Date & Time:", style: :bold
pdf.text ticket.event.start_time.strftime("%B %d, %Y at %I:%M %p")
end
pdf.move_down 20 pdf.move_down 20
# Venue information # Venue information
@@ -71,7 +79,7 @@ class TicketPdfGenerator
# QR Code # QR Code
pdf.fill_color "000000" pdf.fill_color "000000"
pdf.font "Helvetica", style: :bold, size: 14 pdf.font "Helvetica", style: :bold, size: 14
pdf.text "Ticket QR Code", align: :center pdf.text "QR Code", align: :center
pdf.move_down 10 pdf.move_down 10
# Ensure all required data is present before generating QR code # Ensure all required data is present before generating QR code
@@ -102,13 +110,19 @@ class TicketPdfGenerator
# QR code text # QR code text
pdf.font "Helvetica", size: 8 pdf.font "Helvetica", size: 8
pdf.fill_color "6B7280" pdf.fill_color "6B7280"
pdf.text "QR Code: #{ticket.qr_code[0..7]}...", align: :center pdf.text "#{ticket.qr_code}", align: :center
# Ticket ID
pdf.font "Helvetica", size: 8
pdf.fill_color "6B7280"
pdf.text "Ticket ID: #{ticket.id}", align: :center
# Footer # Footer
pdf.move_down 30 pdf.move_down 30
pdf.stroke_color "E5E7EB" pdf.stroke_color "E5E7EB"
pdf.horizontal_line 0, 310 pdf.horizontal_line 0, 310
pdf.move_down 10 pdf.move_down 6
pdf.font "Helvetica", size: 8 pdf.font "Helvetica", size: 8
pdf.fill_color "6B7280" pdf.fill_color "6B7280"

View File

@@ -84,7 +84,7 @@
</div> </div>
<div class="flex items-center space-x-2"> <div class="flex items-center space-x-2">
<%= link_to download_ticket_path(ticket, format: :pdf), <%= link_to ticket_download_path(ticket.qr_code, format: :pdf),
class: "inline-flex items-center px-4 py-2 bg-gradient-to-r from-purple-600 to-indigo-600 text-white rounded-lg hover:from-purple-700 hover:to-indigo-700 transition-all duration-200 text-sm font-medium shadow-sm" do %> class: "inline-flex items-center px-4 py-2 bg-gradient-to-r from-purple-600 to-indigo-600 text-white rounded-lg hover:from-purple-700 hover:to-indigo-700 transition-all duration-200 text-sm font-medium shadow-sm" do %>
<svg class="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <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="M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path>

View File

@@ -127,7 +127,7 @@
<p class="text-gray-600 text-sm mb-3">Gardez vos billets sur votre téléphone ou imprimez-les.</p> <p class="text-gray-600 text-sm mb-3">Gardez vos billets sur votre téléphone ou imprimez-les.</p>
<div class="space-y-2"> <div class="space-y-2">
<% @order.tickets.each do |ticket| %> <% @order.tickets.each do |ticket| %>
<%= link_to download_ticket_path(ticket), class: "inline-flex items-center px-3 py-2 border border-purple-300 rounded-md text-sm font-medium text-purple-700 bg-purple-50 hover:bg-purple-100 transition-colors mr-2 mb-2" do %> <%= link_to ticket_download_path(ticket.qr_code), class: "inline-flex items-center px-3 py-2 border border-purple-300 rounded-md text-sm font-medium text-purple-700 bg-purple-50 hover:bg-purple-100 transition-colors mr-2 mb-2" do %>
<svg class="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <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="M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"/> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"/>
</svg> </svg>

View File

@@ -84,7 +84,7 @@
</div> </div>
<div class="flex items-center space-x-2"> <div class="flex items-center space-x-2">
<%= link_to download_ticket_path(ticket, format: :pdf), <%= link_to ticket_download_path(ticket.qr_code, format: :pdf),
class: "inline-flex items-center px-4 py-2 bg-gradient-to-r from-purple-600 to-indigo-600 text-white rounded-lg hover:from-purple-700 hover:to-indigo-700 transition-all duration-200 text-sm font-medium shadow-sm" do %> class: "inline-flex items-center px-4 py-2 bg-gradient-to-r from-purple-600 to-indigo-600 text-white rounded-lg hover:from-purple-700 hover:to-indigo-700 transition-all duration-200 text-sm font-medium shadow-sm" do %>
<svg class="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <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="M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path>