Remove PDF generation and make HTML one printable
This commit is contained in:
2
Gemfile
2
Gemfile
@@ -77,5 +77,3 @@ group :test do
|
|||||||
end
|
end
|
||||||
|
|
||||||
gem "pundit", "~> 2.5"
|
gem "pundit", "~> 2.5"
|
||||||
|
|
||||||
gem "ferrum_pdf", "~> 3.0"
|
|
||||||
|
|||||||
11
Gemfile.lock
11
Gemfile.lock
@@ -128,15 +128,6 @@ GEM
|
|||||||
railties (>= 6.1.0)
|
railties (>= 6.1.0)
|
||||||
faker (3.5.2)
|
faker (3.5.2)
|
||||||
i18n (>= 1.8.11, < 2)
|
i18n (>= 1.8.11, < 2)
|
||||||
ferrum (0.17.1)
|
|
||||||
addressable (~> 2.5)
|
|
||||||
base64 (~> 0.2)
|
|
||||||
concurrent-ruby (~> 1.1)
|
|
||||||
webrick (~> 1.7)
|
|
||||||
websocket-driver (~> 0.7)
|
|
||||||
ferrum_pdf (3.0.1)
|
|
||||||
actionpack (>= 6.0.0)
|
|
||||||
ferrum (~> 0.15)
|
|
||||||
friendly_id (5.5.1)
|
friendly_id (5.5.1)
|
||||||
activerecord (>= 4.0.0)
|
activerecord (>= 4.0.0)
|
||||||
fugit (1.12.1)
|
fugit (1.12.1)
|
||||||
@@ -429,7 +420,6 @@ GEM
|
|||||||
activemodel (>= 6.0.0)
|
activemodel (>= 6.0.0)
|
||||||
bindex (>= 0.4.0)
|
bindex (>= 0.4.0)
|
||||||
railties (>= 6.0.0)
|
railties (>= 6.0.0)
|
||||||
webrick (1.9.1)
|
|
||||||
websocket (1.2.11)
|
websocket (1.2.11)
|
||||||
websocket-driver (0.8.0)
|
websocket-driver (0.8.0)
|
||||||
base64
|
base64
|
||||||
@@ -462,7 +452,6 @@ DEPENDENCIES
|
|||||||
debug
|
debug
|
||||||
factory_bot_rails
|
factory_bot_rails
|
||||||
faker
|
faker
|
||||||
ferrum_pdf (~> 3.0)
|
|
||||||
friendly_id (~> 5.5.0)
|
friendly_id (~> 5.5.0)
|
||||||
importmap-rails
|
importmap-rails
|
||||||
jbuilder
|
jbuilder
|
||||||
|
|||||||
@@ -131,13 +131,8 @@ class ContestantsController < ApplicationController
|
|||||||
@contestants = @contest.contestants.sort_by { |contestant| contestant.name }
|
@contestants = @contest.contestants.sort_by { |contestant| contestant.name }
|
||||||
@nonav = true
|
@nonav = true
|
||||||
|
|
||||||
FerrumPdf.configure do |config|
|
|
||||||
config.process_timeout = 20
|
|
||||||
end
|
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html
|
format.html { render layout: "blank" }
|
||||||
format.pdf { render ferrum_pdf: {}, disposition: :inline, filename: "#{@contest.friendly_id}_qrcodes.pdf", layout: "blank" }
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -5,8 +5,8 @@
|
|||||||
.alert.alert-info
|
.alert.alert-info
|
||||||
= t("contestants.generate_qrcodes.note")
|
= 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"
|
a.mt-3.mb-3.btn.btn-primary href="#{contest_generate_qrcodes_pdf_path(@contest)}" target="_blank" style="margin-top: -3px"
|
||||||
= t("helpers.buttons.download_pdf")
|
= t("helpers.buttons.open_raw")
|
||||||
|
|
||||||
.col.d-flex.flex-column style="height: calc(100% - 200px)"
|
.col.d-flex.flex-column style="height: calc(100% - 200px)"
|
||||||
.d-flex.flex-column style="overflow-y: auto;"
|
.d-flex.flex-column style="overflow-y: auto;"
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
h1.text-center.mb-5 = @contest.name
|
h1.text-center.mt-4.mb-4 = @contest.name
|
||||||
|
|
||||||
- for row in 0..((@contestants.length - 1) / 5)
|
.d-flex.flex-column.align-items-center
|
||||||
|
- for row in 0..((@contestants.length - 1) / 5)
|
||||||
.mt-4.d-flex.flex-row
|
.mt-4.d-flex.flex-row
|
||||||
- for col in 0..3
|
- for col in 0..3
|
||||||
- if row * 4 + col < @contestants.length
|
- if row * 4 + col < @contestants.length
|
||||||
.d-flex.flex-column.ms-5 style="align-items: center"
|
.d-flex.flex-column.ms-4.me-4 style="align-items: center"
|
||||||
- if @contestants[row * 4 + col].qrcode.present?
|
- if @contestants[row * 4 + col].qrcode.present?
|
||||||
.mt-1 style="width: 128px; height: 120px;"
|
.mt-1 style="width: 128px; height: 120px;"
|
||||||
= @contestants[row * 4 + col].qrcode.html_safe
|
= @contestants[row * 4 + col].qrcode.html_safe
|
||||||
|
|||||||
@@ -271,6 +271,7 @@ en:
|
|||||||
generate_qrcodes: Generate QR codes
|
generate_qrcodes: Generate QR codes
|
||||||
import: CSV Import
|
import: CSV Import
|
||||||
open: Open
|
open: Open
|
||||||
|
open_raw: Open in a raw page
|
||||||
refresh: Refresh
|
refresh: Refresh
|
||||||
settings: Settings
|
settings: Settings
|
||||||
sign_in: Sign in
|
sign_in: Sign in
|
||||||
|
|||||||
@@ -242,6 +242,7 @@ fr:
|
|||||||
generate_qrcodes: Générer des QR codes
|
generate_qrcodes: Générer des QR codes
|
||||||
import: Importer un CSV
|
import: Importer un CSV
|
||||||
open: Détails
|
open: Détails
|
||||||
|
open_raw: Ouvrir dans un format imprimable
|
||||||
refresh: Rafraîchir
|
refresh: Rafraîchir
|
||||||
settings: Paramètres
|
settings: Paramètres
|
||||||
sign_in: Se connecter
|
sign_in: Se connecter
|
||||||
|
|||||||
Reference in New Issue
Block a user