Add screenshot image to pdf export
This commit is contained in:
parent
c36230b8ba
commit
fd11eaff33
2 changed files with 6 additions and 1 deletions
|
|
@ -98,7 +98,7 @@ module PdfDocuments
|
||||||
def safe_display(value, &block)
|
def safe_display(value, &block)
|
||||||
return if value.blank?
|
return if value.blank?
|
||||||
|
|
||||||
yield
|
yield(value)
|
||||||
end
|
end
|
||||||
|
|
||||||
def bold(text)
|
def bold(text)
|
||||||
|
|
@ -106,5 +106,9 @@ module PdfDocuments
|
||||||
@prawn_document.text text
|
@prawn_document.text text
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def image(attachable, **args)
|
||||||
|
@prawn_document.image ActiveStorage::Blob.service.path_for(attachable.key), **args
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ module PdfDocuments
|
||||||
bold("Pfad: #{element.page.path}")
|
bold("Pfad: #{element.page.path}")
|
||||||
move_down(5)
|
move_down(5)
|
||||||
rich_text element.description
|
rich_text element.description
|
||||||
|
safe_display(element.screenshot) { image(_1, height: 160) }
|
||||||
|
|
||||||
success_criteria.each.with_index(1) do |success_criterion, sc_index|
|
success_criteria.each.with_index(1) do |success_criterion, sc_index|
|
||||||
success_criterion_row(success_criterion, [element_index, sc_index])
|
success_criterion_row(success_criterion, [element_index, sc_index])
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue