Manuel Bustillo f3c9d82074
All checks were successful
Run unit tests / copyright_notice (pull_request) Successful in 33s
Run unit tests / rubocop (pull_request) Successful in 2m14s
Run unit tests / check-licenses (pull_request) Successful in 2m25s
Run unit tests / unit_tests (pull_request) Successful in 3m42s
Run unit tests / build-static-assets (pull_request) Successful in 40m28s
Extend the invitations index endpoint to return a PDF file with QRs for invitations
2025-07-01 00:12:56 +02:00

32 lines
1.1 KiB
Plaintext

<% invitations.each_slice(4) do |invitation_group| %>
<table style="width: 100%; border-collapse: separate; border-spacing: 0 20px; margin-bottom: 40px;">
<% invitation_group.each do |invitation| %>
<tr>
<td style="width: 270px; height: 270px; text-align: center; vertical-align: middle; padding: 10px;">
<%= image_tag(RQRCode::QRCode.new(invitation.url).as_png(
bit_depth: 1,
border_modules: 4,
color_mode: ChunkyPNG::COLOR_GRAYSCALE,
color: "black",
file: nil,
fill: "white",
module_px_size: 6,
resize_exactly_to: false,
resize_gte_to: false,
size: 250
).to_data_url)
%>
</td>
<td style="vertical-align: middle; padding: 10px;">
<ul style="margin: 0; padding-left: 20px;">
<% invitation.guests.each do |guest| %>
<%= content_tag(:li, guest.name) %>
<% end %>
</ul>
</td>
</tr>
<% end %>
</table>
<div style="page-break-after: always;"></div>
<% end %>