finish customer report pdf
Some checks failed
/ Run tests (push) Successful in 1m58s
/ Run system tests (push) Failing after 2m23s
/ Build, push and deploy image (push) Successful in 1m36s

This commit is contained in:
david 2024-11-24 03:40:48 +01:00
parent 2082b20d5a
commit e1dfb14d4d

View file

@ -38,7 +38,7 @@ module PdfDocuments
move_down(10)
success_criteria.each.with_index(1) do |success_criterion, sc_index|
@pages[success_criterion.id] = @prawn_document.page_number
@pages[success_criterion] = @prawn_document.page_number
success_criterion_row(success_criterion, [ element_index, sc_index ])
end
end
@ -47,6 +47,7 @@ module PdfDocuments
heading1("Anhang: Richtlinien")
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" },
@ -71,14 +72,16 @@ module PdfDocuments
end
if check.links.any?
move_down 5
text("<b>Links</b>", inline_format: true)
move_down 5
check.links.group_by(&:link_category).each do |cat, links|
text(%Q(
rich_text(%Q(
<b>#{cat.name}</b>
<ul>
#{links.map{ "<li><link href=#{_1.url}>#{_1.text}</link></li>" }.join() }
#{links.map{ "<li><link href='#{_1.url}'>#{_1.text}</link></li>" }.join() }
</ul>
), inline_format: true)
))
end
end
@ -133,10 +136,15 @@ module PdfDocuments
x.report.export[:elements].each.with_index(1) do |(element, success_criteria), element_index|
section("#{element_index} #{element.title}") do
success_criteria.each.with_index(1) do |sc, sc_index|
page(title: "#{element_index}.#{sc_index} #{sc.title}", destination: p[sc.id])
page(title: "#{element_index}.#{sc_index} #{sc.title}", destination: p[sc])
end
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|
page(title: check.display_label, destination: p[check])
end
end
end
end