a11yist/app/models/pdf_documents/customer_report.rb
david 63fc206c27
Some checks failed
/ Run tests (push) Successful in 8m56s
/ Run system tests (push) Failing after 1h0m48s
/ Build, push and deploy image (push) Successful in 7m47s
A lot :)
2024-09-05 22:54:38 +02:00

30 lines
1,009 B
Ruby

# frozen_string_literal: true
module PdfDocuments
class CustomerReport < Base
private
def generate
logo
@prawn_document.formatted_text_box [ {
text: "Dieses Dokument wurd am #{Time.current.strftime('%d %B %Y')} um #{Time.current.strftime('%H:%M:%S')} erstellt.", size: 8, align: :right
} ], align: :right
heading1 params.report.name
rich_text params.report.comment_html
params.report.elements.each.with_index(1) do |element, element_index|
heading2 "#{element_index} #{element.title}"
formatted_text [ { text: element.path, styles: %i[bold italic underline] } ]
move_down(5)
rich_text element.description_html
element.success_criteria.each.with_index(1) do |success_criterion, sc_index|
heading3 "#{element_index}.#{sc_index} #{success_criterion.title}"
rich_text success_criterion.description_html
rich_text success_criterion.comment_html
end
end
end
end
end