chore(rubocop): enable on .prawn files
This commit is contained in:
parent
d30f51af79
commit
b1e9dffbc6
5 changed files with 28 additions and 23 deletions
|
@ -6,10 +6,16 @@ require:
|
|||
- ./lib/cops/application_name.rb
|
||||
- ./lib/cops/unscoped.rb
|
||||
|
||||
inherit_mode:
|
||||
merge:
|
||||
- Include
|
||||
|
||||
AllCops:
|
||||
TargetRubyVersion: 3.0
|
||||
DisabledByDefault: true
|
||||
SuggestExtensions: false
|
||||
Include:
|
||||
- "app/**/*.prawn"
|
||||
Exclude:
|
||||
- "db/schema.rb"
|
||||
- "db/migrate/20190730153555_recreate_structure.rb"
|
||||
|
|
|
@ -2,7 +2,7 @@ require 'prawn/measurement_extensions'
|
|||
|
||||
#----- A4 page size
|
||||
page_size = 'A4'
|
||||
page_height = 842
|
||||
# page_height = 842
|
||||
page_width = 595
|
||||
|
||||
#----- margins
|
||||
|
|
|
@ -186,7 +186,7 @@ def add_champs(pdf, champs)
|
|||
champs.each do |champ|
|
||||
if champ.type == 'Champs::RepetitionChamp'
|
||||
add_libelle(pdf, champ)
|
||||
(1..3).each do
|
||||
3.times do
|
||||
champ.rows.each do |row|
|
||||
row.each do |inner_champ|
|
||||
render_single_champ(pdf, inner_champ)
|
||||
|
@ -203,7 +203,7 @@ prawn_document(page_size: "A4") do |pdf|
|
|||
pdf.font_families.update('marianne' => {
|
||||
normal: Rails.root.join('lib/prawn/fonts/marianne/marianne-regular.ttf'),
|
||||
bold: Rails.root.join('lib/prawn/fonts/marianne/marianne-bold.ttf'),
|
||||
italic: Rails.root.join('lib/prawn/fonts/marianne/marianne-thin.ttf' ),
|
||||
italic: Rails.root.join('lib/prawn/fonts/marianne/marianne-thin.ttf')
|
||||
})
|
||||
pdf.font 'marianne'
|
||||
pdf.image DOSSIER_PDF_EXPORT_LOGO_SRC, width: 300, position: :center
|
||||
|
|
|
@ -213,7 +213,7 @@ end
|
|||
prawn_document(page_size: "A4") do |pdf|
|
||||
pdf.font_families.update('marianne' => {
|
||||
normal: Rails.root.join('lib/prawn/fonts/marianne/marianne-regular.ttf'),
|
||||
bold: Rails.root.join('lib/prawn/fonts/marianne/marianne-bold.ttf' ),
|
||||
bold: Rails.root.join('lib/prawn/fonts/marianne/marianne-bold.ttf')
|
||||
})
|
||||
pdf.font 'marianne'
|
||||
|
||||
|
|
|
@ -10,7 +10,6 @@ right_margin = 20
|
|||
bottom_margin = 20
|
||||
left_margin = 20
|
||||
|
||||
header_width = page_width - left_margin - right_margin
|
||||
body_width = 400
|
||||
|
||||
body_left_margin = (page_width - body_width - left_margin - right_margin) / 2
|
||||
|
@ -66,7 +65,7 @@ prawn_document(margin: [top_margin, right_margin, bottom_margin, left_margin], p
|
|||
|
||||
pdf.fill_color grey
|
||||
pdf.pad_top(7) do
|
||||
pdf.text "#{Dossier.human_attribute_name(:id)} : #{@dossier.id.to_s}", size: 10, character_spacing: -0.2, align: :justify
|
||||
pdf.text "#{Dossier.human_attribute_name(:id)} : #{@dossier.id}", size: 10, character_spacing: -0.2, align: :justify
|
||||
pdf.text t('.file_submitted_at') + ' : ' + l(@dossier.depose_at, format: '%e %B %Y'), size: 10, character_spacing: -0.2, align: :justify
|
||||
pdf.text t('.dossier_state') + ' : ' + papertrail_dossier_state(@dossier), size: 10, character_spacing: -0.2, align: :justify
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue