Added projects
This commit is contained in:
parent
0964187f22
commit
8b4ffb83ec
37 changed files with 470 additions and 1935 deletions
|
|
@ -13,13 +13,13 @@ module PdfDocuments
|
|||
move_down 20
|
||||
@prawn_document.text "#{I18n.l params.report.updated_at.to_date, format: :long}"
|
||||
move_down 40
|
||||
safe_display(params.report.comment) do
|
||||
safe_display(params.report.comment) do
|
||||
rich_text _1
|
||||
move_down 30
|
||||
end
|
||||
|
||||
@prawn_document.font_size(8) do
|
||||
@prawn_document.draw_text("Dokument erstellt am #{Time.current.strftime('%d %B %Y')} um #{Time.current.strftime('%H:%M:%S')}", at: [0, 0])
|
||||
@prawn_document.draw_text("Dokument erstellt am #{Time.current.strftime('%d %B %Y')} um #{Time.current.strftime('%H:%M:%S')}", at: [ 0, 0 ])
|
||||
end
|
||||
@prawn_document.start_new_page
|
||||
@pages = {}
|
||||
|
|
@ -29,9 +29,9 @@ module PdfDocuments
|
|||
without_page_break do
|
||||
heading2 "#{element_index} #{element.title}"
|
||||
@prawn_document.text("<b>Pfad:</b> #{element.page.path}", inline_format: true)
|
||||
safe_display(element.screenshot) do
|
||||
image(_1.variant(:thumbnail), height: 160)
|
||||
move_down(15)
|
||||
safe_display(element.screenshot) do
|
||||
image(_1.variant(:thumbnail), height: 160)
|
||||
move_down(15)
|
||||
end
|
||||
end
|
||||
rich_text element.description
|
||||
|
|
@ -45,10 +45,10 @@ module PdfDocuments
|
|||
|
||||
@prawn_document.start_new_page
|
||||
heading1("Anhang: Richtlinien")
|
||||
params.report.export[:success_criteria].group_by(&:check).sort_by{ |c, _scs| c.external_number }.each do |check, criteria|
|
||||
params.report.export[:success_criteria].group_by(&:check).sort_by { |c, _scs| c.external_number }.each do |check, criteria|
|
||||
heading2(check.display_label)
|
||||
@pages[check] = @prawn_document.page_number
|
||||
{
|
||||
{
|
||||
external_number: { label: "WCAG Nummer" },
|
||||
external_url: { label: "WCAG Link" },
|
||||
conformity_level: { label: "Konformität" },
|
||||
|
|
@ -61,12 +61,12 @@ module PdfDocuments
|
|||
annotation_de: { label: "Anmerkung", rich: true }
|
||||
}.each do |attribute, options|
|
||||
v = check.send(attribute)
|
||||
safe_display(v) do
|
||||
safe_display(v) do
|
||||
text("<b>#{options[:label]}</b>", inline_format: true)
|
||||
if options[:rich]
|
||||
rich_text(_1)
|
||||
else
|
||||
text(_1)
|
||||
else
|
||||
text(_1)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -79,7 +79,7 @@ module PdfDocuments
|
|||
rich_text(%Q(
|
||||
<span>#{cat.name}</span>
|
||||
<ul>
|
||||
#{links.map{ "<li><a href='#{_1.url}'>#{_1.text}</a></li>" }.join() }
|
||||
#{links.map { "<li><a href='#{_1.url}'>#{_1.text}</a></li>" }.join() }
|
||||
</ul>
|
||||
))
|
||||
end
|
||||
|
|
@ -101,10 +101,10 @@ module PdfDocuments
|
|||
|
||||
@prawn_document.repeat(2..) do
|
||||
@prawn_document.text_box "<b>#{params.report.name}</b>", at: [ 50, 777 ], inline_format: true, width: 300
|
||||
@prawn_document.bounding_box([0, 766], width: 532) do
|
||||
@prawn_document.bounding_box([ 0, 766 ], width: 532) do
|
||||
hr
|
||||
end
|
||||
@prawn_document.bounding_box([0, 796], width: 200, height: 200) do
|
||||
@prawn_document.bounding_box([ 0, 796 ], width: 200, height: 200) do
|
||||
logo
|
||||
end
|
||||
end
|
||||
|
|
@ -120,7 +120,7 @@ module PdfDocuments
|
|||
end
|
||||
end
|
||||
section("Anhang: Richtlinien") do
|
||||
x.report.export[:success_criteria].group_by(&:check).sort_by{ |c, _scs| c.external_number }.each do |check, _criteria|
|
||||
x.report.export[:success_criteria].group_by(&:check).sort_by { |c, _scs| c.external_number }.each do |check, _criteria|
|
||||
page(title: check.display_label, destination: p[check])
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue