-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTicket.razor
More file actions
156 lines (140 loc) · 6.31 KB
/
Ticket.razor
File metadata and controls
156 lines (140 loc) · 6.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
@using Evently.Server.Common.Domains.Entities
@using Evently.Server.Features.Emails.Views.Components
@inject NavigationManager Navigator
@inject IWebHostEnvironment Env
<html lang="en" dir="ltr">
<head>
<title>Evently</title>
<style>
@@media print {
.print-ticket {
width: 360px;
margin-top: 10rem;
border: 1px solid #0d6efd !important;
box-shadow: none !important;
}
.print-ticket-header {
background: none !important;
color: black !important;
border: 1px solid #0d6efd !important;
}
}
</style>
</head>
<body
style="font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; margin: 0; padding: 20px; background-color: #f8f9fa;">
<Container
Style="max-width: 400px; margin: 0 auto; background: white; border-radius: 12px; box-shadow: 0 8px 32px rgba(13, 110, 253, 0.15); overflow: hidden;">
<!-- Confirmation Message -->
<div
style="padding: 20px; text-align: center; background: linear-gradient(135deg, #e3f2fd, #f0f8ff); border-bottom: 1px solid #e9ecef;">
<p style="margin: 0; color: #2c5aa0; font-weight: 600; font-size: 16px;">Your booking has been
confirmed!</p>
</div>
<!-- Ticket Header -->
<Table
Style="width: 100%; text-align: center; border: none; background: linear-gradient(135deg, #0d6efd, #0056b3);
color: white; margin: 0; border-spacing: 0;"
class="print-ticket-header">
<tr>
<td style="padding: 15px 20px;">
<div style="display: inline-flex; align-items: center; gap: 8px;">
<span style="font-size: 16px; font-weight: 600; letter-spacing: 0.5px;">REGULAR TICKET</span>
</div>
</td>
</tr>
</Table>
<!-- Ticket Content -->
<Table Style="width: 100%; border: none; margin: 0; border-spacing: 0; background: white;">
<!-- Event Name -->
<tr>
<td style="padding: 20px 20px 10px; text-align: center;">
<a href="@_baseUri/gatherings/@Gathering.GatheringId"
style="color: #0d6efd; font-size: 20px; font-weight: 700;
display: block; line-height: 1.3; padding-bottom: 5px; text-decoration: underline;">
@Gathering.Name
</a>
</td>
</tr>
<!-- Date and Time -->
<tr>
<td style="padding: 10px 20px; text-align: center;">
<div
style="background: #f8f9fa; border-radius: 8px; padding: 12px; border-left: 4px solid #0d6efd;">
<div style="color: #6c757d; font-size: 12px; font-weight: 500; margin-bottom: 4px;">DATE &
TIME
</div>
<div style="color: #495057; font-size: 16px; font-weight: 600;">@StartDate - @EndDate</div>
</div>
</td>
</tr>
<!-- Location -->
<tr>
<td style="padding: 10px 20px; text-align: center;">
<div
style="background: #f8f9fa; border-radius: 8px; padding: 12px; border-left: 4px solid #28a745;">
<div style="color: #6c757d; font-size: 12px; font-weight: 500; margin-bottom: 4px;">LOCATION
</div>
<div style="color: #495057; font-size: 14px; font-weight: 500;">@Gathering.Location</div>
</div>
</td>
</tr>
<!-- Attendee Name -->
<tr>
<td style="padding: 20px 20px 10px; text-align: center;">
<div
style="background: linear-gradient(135deg, #fff3cd, #ffeaa7); border-radius: 10px; padding: 16px; border: 2px dashed #ffc107;">
<div style="color: #856404; font-size: 12px; font-weight: 600; margin-bottom: 8px;">ATTENDEE
</div>
<div
style="color: #212529; font-size: 24px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;">
@Account.UserName
</div>
</div>
</td>
</tr>
<!-- QR Code -->
<tr>
<td style="padding: 20px; text-align: center;">
<div
style="background: white; border: 3px solid #e9ecef; border-radius: 12px; padding: 15px; display: inline-block;">
<img alt="QR Code for ticket verification" src="@QrCodeUrl"
style="width: 180px; height: 180px; display: block;"/>
</div>
</td>
</tr>
<!-- Booking ID -->
<tr>
<td style="padding: 0 20px 20px; text-align: center;">
<div style="background: #f8f9fa; border-radius: 6px; padding: 8px 12px; display: inline-block;">
<span style="color: #6c757d; font-size: 11px; font-weight: 500;">BOOKING ID: </span>
<span
style="color: #495057; font-size: 12px; font-weight: 600; font-family: 'Courier New', monospace;">@Booking.BookingId</span>
</div>
</td>
</tr>
</Table>
<!-- Footer -->
<div style="background: #f8f9fa; padding: 15px 20px; text-align: center; border-top: 1px solid #e9ecef;">
<p style="margin: 0; color: #6c757d; font-size: 12px;">
Please present this ticket at the event entrance
</p>
</div>
</Container>
</body>
</html>
@code {
[Parameter] [EditorRequired] public Booking Booking { get; set; } = new();
[Parameter] [EditorRequired] public string QrCodeUrl { get; set; } = string.Empty;
[Parameter] public string Classes { get; set; } = string.Empty;
protected override void OnAfterRender(bool firstRender) {
if (firstRender) {
_baseUri = (Env.IsDevelopment() ? "https://localhost:5000/" : Navigator.BaseUri).TrimEnd('/');
}
}
private string StartDate => Gathering.Start.ToString("ddd, d MMM yyyy, HH:mm");
private string EndDate => Gathering.End.ToString("d MMM yyyy, HH:mm");
private string _baseUri = string.Empty;
private Gathering Gathering => Booking.Gathering ?? new Gathering();
private Account Account => Booking.Account ?? new Account();
}