Printable tickets for osem

This commit is contained in:
Siddhant Bajaj 2017-02-20 07:39:46 +05:30
parent 945b4aac60
commit 76afd89f2b
4 changed files with 25 additions and 1 deletions

View file

@ -32,6 +32,8 @@ class ConferenceRegistrationsController < ApplicationController
@tickets = current_user.ticket_purchases.by_conference(@conference).paid
@ticket_payments = @tickets.group_by(&:ticket_id)
@total_quantity = @tickets.group(:ticket_id).sum(:quantity)
@pdf_filename = "#{@conference.title}.pdf"
@user = current_user
end
def edit; end

View file

@ -0,0 +1,10 @@
prawn_document(force_download: true, filename: @pdf_filename, page_layout: :landscape) do |pdf|
pdf.text "Registration for #{@conference.title}", font_size: 25
pdf.text "at #{@conference.venue.name},#{@conference.venue.street},#{@conference.venue.city} / #{@conference.venue.country_name}.", font_size: 12
pdf.text "Ticket Type: #{}", font_size: 15
pdf.text "Date: #{}", font_size: 15
pdf.text "Username: #{@user.username}", font_size: 15
pdf.text "User Email: #{@user.email}", font_size: 15
pdf.text "Description: #{}", font_size: 15
pdf.print_qr_code(@user.username, :extent=>72)
end