- Replace Prawn PDF generation with Grover (Chrome headless) for better compatibility - Add HTML-based ticket template with embedded CSS styling - Implement robust Grover loading with fallback to HTML download - Add QR code generation methods to Ticket model - Remove legacy TicketPdfGenerator service and tests - Update PDF generation in TicketsController with proper error handling The new implementation provides: - Better HTML/CSS rendering for ticket layouts - More reliable PDF generation using Chrome engine - Fallback mechanism for better user experience - Cleaner separation of template rendering and PDF conversion 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
141 lines
1.9 KiB
CSS
141 lines
1.9 KiB
CSS
/* PDF Styles for Ticket Generation */
|
|
|
|
body {
|
|
font-family: Helvetica, Arial, sans-serif;
|
|
font-size: 12px;
|
|
color: #000000;
|
|
margin: 0;
|
|
padding: 20px;
|
|
background-color: #ffffff;
|
|
}
|
|
|
|
.ticket-container {
|
|
max-width: 350px;
|
|
margin: 0 auto;
|
|
padding: 20px;
|
|
border: 1px solid #e5e7eb;
|
|
border-radius: 10px;
|
|
background-color: #ffffff;
|
|
}
|
|
|
|
/* Header */
|
|
.header {
|
|
text-align: center;
|
|
margin-bottom: 10px;
|
|
}
|
|
|
|
.header h1 {
|
|
color: #2D1B69;
|
|
font-size: 24px;
|
|
font-weight: bold;
|
|
margin: 0;
|
|
}
|
|
|
|
/* Event name */
|
|
.event-name {
|
|
text-align: center;
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
.event-name h2 {
|
|
color: #000000;
|
|
font-size: 18px;
|
|
font-weight: bold;
|
|
margin: 0;
|
|
}
|
|
|
|
/* Ticket info box */
|
|
.ticket-info-box {
|
|
background-color: #F9FAFB;
|
|
border: 1px solid #E5E7EB;
|
|
border-radius: 10px;
|
|
padding: 15px;
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
.info-row {
|
|
margin-bottom: 8px;
|
|
}
|
|
|
|
.info-row:last-child {
|
|
margin-bottom: 0;
|
|
}
|
|
|
|
.info-label {
|
|
font-weight: bold;
|
|
color: #000000;
|
|
display: inline-block;
|
|
width: 100px;
|
|
}
|
|
|
|
.info-value {
|
|
display: inline-block;
|
|
color: #000000;
|
|
}
|
|
|
|
/* Venue information */
|
|
.venue-info {
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
.venue-info h3 {
|
|
color: #374151;
|
|
font-size: 14px;
|
|
font-weight: bold;
|
|
margin: 0 0 8px 0;
|
|
}
|
|
|
|
.venue-details {
|
|
font-size: 11px;
|
|
}
|
|
|
|
.venue-name {
|
|
font-weight: bold;
|
|
margin-bottom: 4px;
|
|
}
|
|
|
|
.venue-address {
|
|
color: #000000;
|
|
}
|
|
|
|
/* QR Code */
|
|
.qr-code-section {
|
|
text-align: center;
|
|
margin-bottom: 15px;
|
|
}
|
|
|
|
.qr-code-section h3 {
|
|
color: #000000;
|
|
font-size: 14px;
|
|
font-weight: bold;
|
|
margin: 0 0 10px 0;
|
|
}
|
|
|
|
.qr-code-container {
|
|
text-align: center;
|
|
margin: 0 auto 10px auto;
|
|
width: 120px;
|
|
height: 120px;
|
|
}
|
|
|
|
.qr-code-text {
|
|
font-size: 8px;
|
|
color: #6B7280;
|
|
}
|
|
|
|
/* Footer */
|
|
.footer {
|
|
border-top: 1px solid #E5E7EB;
|
|
padding-top: 15px;
|
|
text-align: center;
|
|
font-size: 8px;
|
|
color: #6B7280;
|
|
}
|
|
|
|
.footer p {
|
|
margin: 0 0 5px 0;
|
|
}
|
|
|
|
.generated-date {
|
|
margin-top: 5px;
|
|
} |