commit
22fc20468f
4 changed files with 11 additions and 1 deletions
|
|
@ -100,3 +100,7 @@ p.comment-body {
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
float: left;
|
float: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.qr-image{
|
||||||
|
margin-left: 120px;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ class PhysicalTicketController < ApplicationController
|
||||||
@file_name = "ticket_for_#{@conference.short_title}"
|
@file_name = "ticket_for_#{@conference.short_title}"
|
||||||
@user = @physical_ticket.user
|
@user = @physical_ticket.user
|
||||||
@ticket_layout = @conference.ticket_layout.to_sym
|
@ticket_layout = @conference.ticket_layout.to_sym
|
||||||
|
@qrcode_image = RQRCode::QRCode.new(@physical_ticket.token).as_png(size: 180, border_modules: 0)
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html
|
format.html
|
||||||
format.pdf do
|
format.pdf do
|
||||||
|
|
|
||||||
|
|
@ -77,5 +77,9 @@ class TicketPdf < Prawn::Document
|
||||||
move_up 180
|
move_up 180
|
||||||
end
|
end
|
||||||
|
|
||||||
def draw_fourth_square; end
|
def draw_fourth_square
|
||||||
|
x = @mid_horizontal + (@right - @mid_horizontal - 180) / 2
|
||||||
|
y = cursor - (bounds.top - @mid_vertical - 180) / 2
|
||||||
|
print_qr_code(@physical_ticket.token, pos: [x, y], extent: 180, stroke: false)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -67,6 +67,7 @@
|
||||||
= @physical_ticket.ticket_purchase.id
|
= @physical_ticket.ticket_purchase.id
|
||||||
%br
|
%br
|
||||||
.col-md-5.col-md-offset-2.box.well
|
.col-md-5.col-md-offset-2.box.well
|
||||||
|
= image_tag(@qrcode_image.to_data_url, class: 'img-responsive qr-image')
|
||||||
.row
|
.row
|
||||||
.col-md-12
|
.col-md-12
|
||||||
%p.text-left
|
%p.text-left
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue