Files
e-ticket/templates/account/billet_preview.html.twig

392 lines
15 KiB
Twig
Raw Normal View History

Add Billet entity, BilletDesign, ticket designer, CRUD billets, commissions - Create Billet entity: name, position, priceHT, quantity (nullable=unlimited), isGeneratedBillet, hasDefinedExit, notBuyable, type (billet/reservation_brocante/vote), stripeProductId, description, picture (VichUploader), category (ManyToOne CASCADE) - Create BilletDesign entity (OneToOne Event): accentColor, invitationTitle, invitationColor - Billet CRUD: add/edit/delete with access control, Stripe product sync on connected account - Billet reorder: drag & drop with position field, refactored sortable.js for both categories and billets - Ticket designer tab (custom offer only): accent color, invitation title/color, live iframe preview - A4 ticket preview: 4 zones (HG infos+billet, HD affiche, BG association, BD sortie+invitation), fake QR code SVG - Commission calculator JS: live breakdown of E-Ticket fee, Stripe fee (1.5%+0.25EUR), net amount - Sales recap on categories tab: qty sold, total HT, total commissions, total net - DisableProfilerSubscriber: disable web profiler toolbar on preview iframe - CSP: allow self in frame-src and frame-ancestors for preview iframe - Flysystem: dedicated billets.storage for billet images - Upload accept restricted to png/jpeg/webp/gif (no HEIC) - Makefile: add force_sql_dev command - CLAUDE.md: add rule to never modify existing migrations - Consolidate all migrations into single Version20260321111125 - Tests: BilletTest (20), BilletDesignTest (6), DisableProfilerSubscriberTest (5), billet-designer.test.js (7), commission-calculator.test.js (7), AccountControllerTest billet CRUD tests (11) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 12:19:46 +01:00
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
@page { size: A4; margin: 0; }
body {
width: 595px;
height: 842px;
font-family: 'Helvetica Neue', Arial, sans-serif;
background: {{ bg_color }};
color: {{ text_color }};
overflow: hidden;
}
.ticket {
width: 100%;
height: 100%;
display: grid;
grid-template-columns: 1fr 220px;
grid-template-rows: 1fr auto;
}
/* ====== HG : infos evenement + billet ====== */
.zone-hg {
padding: 28px 20px 20px 32px;
border-right: 3px solid {{ accent_color }};
border-bottom: 3px solid {{ accent_color }};
display: flex;
flex-direction: column;
}
.event-title {
font-size: 20px;
font-weight: 900;
text-transform: uppercase;
letter-spacing: -0.5px;
line-height: 1.15;
margin-bottom: 3px;
}
.event-badge {
font-size: 8px;
font-weight: 700;
color: {{ accent_color }};
text-transform: uppercase;
letter-spacing: 2px;
margin-bottom: 14px;
}
.info-row {
display: flex;
align-items: baseline;
padding: 4px 0;
border-bottom: 1px solid {{ text_color }}10;
}
.info-row:last-child { border-bottom: none; }
.info-label {
width: 65px;
flex-shrink: 0;
font-size: 7px;
font-weight: 900;
text-transform: uppercase;
letter-spacing: 1.5px;
opacity: 0.4;
}
.info-value {
font-size: 11px;
font-weight: 700;
}
.separator {
height: 3px;
background: {{ accent_color }};
margin: 12px 0;
}
.billet-name {
font-size: 15px;
font-weight: 900;
text-transform: uppercase;
margin-bottom: 2px;
}
.billet-price {
font-size: 20px;
font-weight: 900;
color: {{ accent_color }};
margin-bottom: 10px;
}
.meta-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 4px 16px;
}
.meta-label {
font-size: 7px;
font-weight: 900;
text-transform: uppercase;
letter-spacing: 1.5px;
opacity: 0.4;
}
.meta-value {
font-size: 10px;
font-weight: 700;
margin-bottom: 4px;
}
.billet-badges {
display: flex;
gap: 6px;
margin-top: 10px;
flex-wrap: wrap;
}
.exit-badge {
display: inline-block;
padding: 4px 8px;
font-size: 8px;
font-weight: 900;
text-transform: uppercase;
letter-spacing: 1px;
border: 2px solid;
}
.exit-definitive {
background: #fee2e2;
color: #991b1b;
border-color: #991b1b;
}
.exit-libre {
background: #dcfce7;
color: #166534;
border-color: #166534;
}
.invitation-badge {
display: inline-block;
padding: 4px 8px;
font-size: 8px;
font-weight: 900;
text-transform: uppercase;
letter-spacing: 2px;
color: #fff;
text-shadow: 0 1px 1px rgba(0,0,0,0.2);
}
.qr-section {
margin-top: auto;
display: flex;
align-items: flex-end;
justify-content: space-between;
padding-top: 10px;
border-top: 1px solid {{ text_color }}12;
}
.qr-box {
width: 120px;
height: 120px;
border: 2px solid {{ text_color }}18;
display: flex;
align-items: center;
justify-content: center;
background: #fff;
}
.qr-placeholder {
font-size: 7px;
font-weight: 900;
text-transform: uppercase;
letter-spacing: 1px;
text-align: center;
color: #999;
}
.ref-block { text-align: right; }
.ref-label {
font-size: 7px;
font-weight: 900;
text-transform: uppercase;
letter-spacing: 1.5px;
opacity: 0.35;
}
.ref-value {
font-size: 9px;
font-weight: 700;
font-family: monospace;
opacity: 0.55;
}
/* ====== HD : affiche ====== */
.zone-hd {
border-bottom: 3px solid {{ accent_color }};
display: flex;
align-items: center;
justify-content: center;
background: {{ text_color }}05;
overflow: hidden;
}
.zone-hd img {
width: 100%;
height: 100%;
object-fit: contain;
}
.poster-placeholder {
font-size: 9px;
font-weight: 900;
text-transform: uppercase;
letter-spacing: 1px;
opacity: 0.15;
text-align: center;
}
/* ====== BAS : infos association (pleine largeur) ====== */
.zone-bottom {
grid-column: 1 / -1;
padding: 16px 32px;
display: flex;
align-items: center;
gap: 14px;
background: {{ accent_color }};
color: #fff;
}
.org-logo {
width: 45px;
height: 45px;
object-fit: contain;
flex-shrink: 0;
}
.org-logo-placeholder {
width: 45px;
height: 45px;
border: 2px dashed rgba(255,255,255,0.3);
display: flex;
align-items: center;
justify-content: center;
font-size: 6px;
font-weight: 900;
text-transform: uppercase;
opacity: 0.4;
flex-shrink: 0;
}
.org-info { flex: 1; min-width: 0; }
.org-name {
font-size: 11px;
font-weight: 900;
text-transform: uppercase;
letter-spacing: 1.5px;
}
.org-details {
font-size: 8px;
font-weight: 600;
opacity: 0.7;
margin-top: 2px;
}
.org-contact {
font-size: 8px;
font-weight: 600;
opacity: 0.5;
margin-top: 1px;
}
.powered {
font-size: 6px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 1px;
opacity: 0.4;
text-align: right;
flex-shrink: 0;
}
</style>
</head>
<body>
<div class="ticket">
<!-- HG : infos evenement + billet -->
<div class="zone-hg">
<div class="event-title">{{ event.title }}</div>
<div class="event-badge">Billet d'entree</div>
<div class="info-row">
<div class="info-label">Date</div>
<div class="info-value">{{ event.startAt|date('d/m/Y') }}</div>
</div>
<div class="info-row">
<div class="info-label">Horaires</div>
<div class="info-value">{{ event.startAt|date('H:i') }}{{ event.endAt|date('H:i') }}</div>
</div>
<div class="info-row">
<div class="info-label">Lieu</div>
<div class="info-value">{{ event.address }}</div>
</div>
<div class="info-row">
<div class="info-label">Ville</div>
<div class="info-value">{{ event.zipcode }} {{ event.city }}</div>
</div>
<div class="separator"></div>
<div class="billet-name">Nom du billet</div>
<div class="billet-price">00,00 &euro; HT</div>
<div class="meta-grid">
<div>
<div class="meta-label">Categorie</div>
<div class="meta-value">Categorie</div>
</div>
<div>
<div class="meta-label">Date d'achat</div>
<div class="meta-value">{{ "now"|date('d/m/Y H:i') }}</div>
</div>
<div>
<div class="meta-label">Acheteur</div>
<div class="meta-value">Prenom Nom</div>
</div>
<div>
<div class="meta-label">E-mail</div>
<div class="meta-value">email@exemple.fr</div>
</div>
</div>
<div class="billet-badges">
<div class="exit-badge exit-definitive">Sortie definitive</div>
{% if show_invitation %}
<div class="invitation-badge" style="background: {{ invitation_color }};">{{ invitation_title }}</div>
{% endif %}
</div>
<div class="qr-section">
<div class="qr-box">
<svg viewBox="0 0 21 21" width="110" height="110" xmlns="http://www.w3.org/2000/svg">
<rect width="21" height="21" fill="#fff"/>
<g fill="#111">
<rect x="0" y="0" width="7" height="1"/><rect x="0" y="1" width="1" height="5"/><rect x="6" y="1" width="1" height="5"/><rect x="0" y="6" width="7" height="1"/>
<rect x="2" y="2" width="3" height="3"/>
<rect x="14" y="0" width="7" height="1"/><rect x="14" y="1" width="1" height="5"/><rect x="20" y="1" width="1" height="5"/><rect x="14" y="6" width="7" height="1"/>
<rect x="16" y="2" width="3" height="3"/>
<rect x="0" y="14" width="7" height="1"/><rect x="0" y="15" width="1" height="5"/><rect x="6" y="15" width="1" height="5"/><rect x="0" y="20" width="7" height="1"/>
<rect x="2" y="16" width="3" height="3"/>
<rect x="8" y="0" width="1" height="1"/><rect x="10" y="0" width="1" height="1"/><rect x="12" y="0" width="1" height="1"/>
<rect x="8" y="2" width="1" height="1"/><rect x="10" y="2" width="2" height="1"/>
<rect x="9" y="4" width="1" height="1"/><rect x="11" y="4" width="2" height="1"/>
<rect x="8" y="6" width="1" height="1"/><rect x="11" y="6" width="1" height="1"/>
<rect x="8" y="8" width="1" height="1"/><rect x="10" y="8" width="1" height="1"/><rect x="12" y="8" width="1" height="1"/><rect x="14" y="8" width="1" height="1"/><rect x="16" y="8" width="1" height="1"/><rect x="18" y="8" width="1" height="1"/><rect x="20" y="8" width="1" height="1"/>
<rect x="0" y="8" width="1" height="1"/><rect x="2" y="8" width="1" height="1"/><rect x="4" y="8" width="1" height="1"/><rect x="6" y="8" width="1" height="1"/>
<rect x="9" y="9" width="1" height="1"/><rect x="11" y="9" width="1" height="1"/><rect x="15" y="9" width="1" height="1"/><rect x="17" y="9" width="1" height="1"/><rect x="19" y="9" width="1" height="1"/>
<rect x="8" y="10" width="1" height="1"/><rect x="10" y="10" width="1" height="1"/><rect x="13" y="10" width="1" height="1"/><rect x="16" y="10" width="1" height="1"/><rect x="20" y="10" width="1" height="1"/>
<rect x="9" y="11" width="2" height="1"/><rect x="12" y="11" width="1" height="1"/><rect x="14" y="11" width="1" height="1"/><rect x="17" y="11" width="1" height="1"/><rect x="19" y="11" width="1" height="1"/>
<rect x="8" y="12" width="1" height="1"/><rect x="11" y="12" width="1" height="1"/><rect x="13" y="12" width="1" height="1"/><rect x="15" y="12" width="1" height="1"/><rect x="18" y="12" width="1" height="1"/><rect x="20" y="12" width="1" height="1"/>
<rect x="9" y="14" width="1" height="1"/><rect x="12" y="14" width="1" height="1"/><rect x="15" y="14" width="1" height="1"/><rect x="17" y="14" width="1" height="1"/><rect x="19" y="14" width="1" height="1"/>
<rect x="8" y="15" width="1" height="1"/><rect x="10" y="15" width="1" height="1"/><rect x="14" y="15" width="1" height="1"/><rect x="16" y="15" width="1" height="1"/><rect x="20" y="15" width="1" height="1"/>
<rect x="9" y="16" width="1" height="1"/><rect x="11" y="16" width="2" height="1"/><rect x="15" y="16" width="1" height="1"/><rect x="18" y="16" width="1" height="1"/>
<rect x="8" y="17" width="1" height="1"/><rect x="10" y="17" width="1" height="1"/><rect x="14" y="17" width="1" height="1"/><rect x="17" y="17" width="1" height="1"/><rect x="19" y="17" width="1" height="1"/>
<rect x="9" y="18" width="1" height="1"/><rect x="12" y="18" width="1" height="1"/><rect x="16" y="18" width="1" height="1"/><rect x="20" y="18" width="1" height="1"/>
<rect x="8" y="20" width="1" height="1"/><rect x="11" y="20" width="1" height="1"/><rect x="13" y="20" width="1" height="1"/><rect x="15" y="20" width="1" height="1"/><rect x="18" y="20" width="1" height="1"/>
</g>
</svg>
</div>
<div class="ref-block">
<div class="ref-label">Reference</div>
<div class="ref-value">ETICKET-XXXX-XXXX-XXXX</div>
</div>
</div>
</div>
<!-- HD : affiche -->
<div class="zone-hd">
{% if event.eventMainPictureName %}
<img src="{{ ('/uploads/events/' ~ event.eventMainPictureName) | imagine_filter('large') }}" alt="{{ event.title }}">
{% else %}
<div class="poster-placeholder">Affiche<br>evenement</div>
{% endif %}
</div>
<!-- BAS : infos association (pleine largeur) -->
<div class="zone-bottom">
{% if show_logo and user.logoName %}
<img src="{{ ('/uploads/logos/' ~ user.logoName) | imagine_filter('organizer_logo') }}" alt="Logo" class="org-logo">
{% elseif show_logo %}
<div class="org-logo-placeholder">Logo</div>
{% endif %}
<div class="org-info">
<div class="org-name">{{ user.companyName ?? (user.firstName ~ ' ' ~ user.lastName) }}</div>
{% if user.address %}
<div class="org-details">{{ user.address }}{% if user.postalCode %}, {{ user.postalCode }}{% endif %}{% if user.city %} {{ user.city }}{% endif %}</div>
{% endif %}
{% if user.phone or user.website %}
<div class="org-contact">
{% if user.phone %}{{ user.phone }}{% endif %}
{% if user.phone and user.website %}{% endif %}
{% if user.website %}{{ user.website }}{% endif %}
</div>
{% endif %}
</div>
<div class="powered">E-Ticket<br>by E-Cosplay</div>
</div>
</div>
</body>
</html>