Remove PDF generation and make HTML one printable
This commit is contained in:
@@ -131,13 +131,8 @@ class ContestantsController < ApplicationController
|
||||
@contestants = @contest.contestants.sort_by { |contestant| contestant.name }
|
||||
@nonav = true
|
||||
|
||||
FerrumPdf.configure do |config|
|
||||
config.process_timeout = 20
|
||||
end
|
||||
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.pdf { render ferrum_pdf: {}, disposition: :inline, filename: "#{@contest.friendly_id}_qrcodes.pdf", layout: "blank" }
|
||||
format.html { render layout: "blank" }
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
.alert.alert-info
|
||||
= t("contestants.generate_qrcodes.note")
|
||||
|
||||
a.mt-3.mb-3.btn.btn-primary href="#{contest_generate_qrcodes_pdf_path(@contest)}.pdf" target="_blank" style="margin-top: -3px"
|
||||
= t("helpers.buttons.download_pdf")
|
||||
a.mt-3.mb-3.btn.btn-primary href="#{contest_generate_qrcodes_pdf_path(@contest)}" target="_blank" style="margin-top: -3px"
|
||||
= t("helpers.buttons.open_raw")
|
||||
|
||||
.col.d-flex.flex-column style="height: calc(100% - 200px)"
|
||||
.d-flex.flex-column style="overflow-y: auto;"
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
h1.text-center.mb-5 = @contest.name
|
||||
h1.text-center.mt-4.mb-4 = @contest.name
|
||||
|
||||
- for row in 0..((@contestants.length - 1) / 5)
|
||||
.mt-4.d-flex.flex-row
|
||||
- for col in 0..3
|
||||
- if row * 4 + col < @contestants.length
|
||||
.d-flex.flex-column.ms-5 style="align-items: center"
|
||||
- if @contestants[row * 4 + col].qrcode.present?
|
||||
.mt-1 style="width: 128px; height: 120px;"
|
||||
= @contestants[row * 4 + col].qrcode.html_safe
|
||||
.name.text-center.mt-3 style="font-size: 0.7rem; max-width: 128px; height: 30px;"
|
||||
= @contestants[row * 4 + col].name
|
||||
.d-flex.flex-column.align-items-center
|
||||
- for row in 0..((@contestants.length - 1) / 5)
|
||||
.mt-4.d-flex.flex-row
|
||||
- for col in 0..3
|
||||
- if row * 4 + col < @contestants.length
|
||||
.d-flex.flex-column.ms-4.me-4 style="align-items: center"
|
||||
- if @contestants[row * 4 + col].qrcode.present?
|
||||
.mt-1 style="width: 128px; height: 120px;"
|
||||
= @contestants[row * 4 + col].qrcode.html_safe
|
||||
.name.text-center.mt-3 style="font-size: 0.7rem; max-width: 128px; height: 30px;"
|
||||
= @contestants[row * 4 + col].name
|
||||
Reference in New Issue
Block a user