Merge 76afd89f2b into 3bf8b2472d
This commit is contained in:
commit
eb7c04ea13
4 changed files with 25 additions and 1 deletions
4
Gemfile
4
Gemfile
|
|
@ -127,6 +127,10 @@ gem 'country_select'
|
||||||
# as PDF generator
|
# as PDF generator
|
||||||
gem 'prawn_rails'
|
gem 'prawn_rails'
|
||||||
|
|
||||||
|
# as QR code generator
|
||||||
|
gem 'rqrcode'
|
||||||
|
gem 'prawn-qrcode', '~> 0.2.2.1'
|
||||||
|
|
||||||
# to render XLS spreadsheets
|
# to render XLS spreadsheets
|
||||||
gem 'axlsx_rails'
|
gem 'axlsx_rails'
|
||||||
|
|
||||||
|
|
|
||||||
10
Gemfile.lock
10
Gemfile.lock
|
|
@ -111,6 +111,7 @@ GEM
|
||||||
chart-js-rails (0.0.6)
|
chart-js-rails (0.0.6)
|
||||||
railties (> 3.1)
|
railties (> 3.1)
|
||||||
chronic (0.10.2)
|
chronic (0.10.2)
|
||||||
|
chunky_png (1.3.8)
|
||||||
cliver (0.3.2)
|
cliver (0.3.2)
|
||||||
cloudinary (1.1.6)
|
cloudinary (1.1.6)
|
||||||
aws_cf_signer
|
aws_cf_signer
|
||||||
|
|
@ -331,6 +332,9 @@ GEM
|
||||||
prawn (1.0.0)
|
prawn (1.0.0)
|
||||||
pdf-core (~> 0.2.2)
|
pdf-core (~> 0.2.2)
|
||||||
ttfunk (~> 1.1.1)
|
ttfunk (~> 1.1.1)
|
||||||
|
prawn-qrcode (0.2.2.1)
|
||||||
|
prawn (>= 0.11.1)
|
||||||
|
rqrcode (>= 0.4.1)
|
||||||
prawn_rails (0.0.11)
|
prawn_rails (0.0.11)
|
||||||
prawn (>= 0.11.1)
|
prawn (>= 0.11.1)
|
||||||
railties (>= 3.0.0)
|
railties (>= 3.0.0)
|
||||||
|
|
@ -417,6 +421,8 @@ GEM
|
||||||
mime-types (>= 1.16, < 3.0)
|
mime-types (>= 1.16, < 3.0)
|
||||||
netrc (~> 0.7)
|
netrc (~> 0.7)
|
||||||
rolify (5.0.0)
|
rolify (5.0.0)
|
||||||
|
rqrcode (0.10.1)
|
||||||
|
chunky_png (~> 1.0)
|
||||||
rspec (3.0.0)
|
rspec (3.0.0)
|
||||||
rspec-core (~> 3.0.0)
|
rspec-core (~> 3.0.0)
|
||||||
rspec-expectations (~> 3.0.0)
|
rspec-expectations (~> 3.0.0)
|
||||||
|
|
@ -594,6 +600,7 @@ DEPENDENCIES
|
||||||
phantomjs
|
phantomjs
|
||||||
piwik_analytics (~> 1.0.1)
|
piwik_analytics (~> 1.0.1)
|
||||||
poltergeist
|
poltergeist
|
||||||
|
prawn-qrcode (~> 0.2.2.1)
|
||||||
prawn_rails
|
prawn_rails
|
||||||
rails (~> 4.2)
|
rails (~> 4.2)
|
||||||
rails-assets-bootstrap-markdown!
|
rails-assets-bootstrap-markdown!
|
||||||
|
|
@ -614,6 +621,7 @@ DEPENDENCIES
|
||||||
redcarpet
|
redcarpet
|
||||||
responders (~> 2.0)
|
responders (~> 2.0)
|
||||||
rolify
|
rolify
|
||||||
|
rqrcode
|
||||||
rspec-activemodel-mocks
|
rspec-activemodel-mocks
|
||||||
rspec-rails
|
rspec-rails
|
||||||
rubocop
|
rubocop
|
||||||
|
|
@ -635,4 +643,4 @@ DEPENDENCIES
|
||||||
whenever
|
whenever
|
||||||
|
|
||||||
BUNDLED WITH
|
BUNDLED WITH
|
||||||
1.12.5
|
1.13.7
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,8 @@ class ConferenceRegistrationsController < ApplicationController
|
||||||
@tickets = current_user.ticket_purchases.by_conference(@conference).paid
|
@tickets = current_user.ticket_purchases.by_conference(@conference).paid
|
||||||
@ticket_payments = @tickets.group_by(&:ticket_id)
|
@ticket_payments = @tickets.group_by(&:ticket_id)
|
||||||
@total_quantity = @tickets.group(:ticket_id).sum(:quantity)
|
@total_quantity = @tickets.group(:ticket_id).sum(:quantity)
|
||||||
|
@pdf_filename = "#{@conference.title}.pdf"
|
||||||
|
@user = current_user
|
||||||
end
|
end
|
||||||
|
|
||||||
def edit; end
|
def edit; end
|
||||||
|
|
|
||||||
10
app/views/conference_registrations/show.pdf.prawn
Normal file
10
app/views/conference_registrations/show.pdf.prawn
Normal 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
|
||||||
Loading…
Add table
Add a link
Reference in a new issue