SCI-4108 check if there are any checklist items before rendering the checklist

This commit is contained in:
Miha Mencin 2019-11-25 11:55:02 +01:00
parent 759b3acfe9
commit 72c158d3e2

View file

@ -21,11 +21,13 @@ module Reports::Docx::DrawStepChecklist
text I18n.t('projects.reports.elements.step_checklist.user_time',
timestamp: I18n.l(timestamp, format: :full)), color: color[:gray]
end
@docx.ul do
items.each do |item|
li do
text SmartAnnotations::TagToText.new(user, team, item.text).text
text " (#{I18n.t('projects.reports.elements.step_checklist.checked')})", color: '2dbe61' if item.checked
if items.any?
@docx.ul do
items.each do |item|
li do
text SmartAnnotations::TagToText.new(user, team, item.text).text
text " (#{I18n.t('projects.reports.elements.step_checklist.checked')})", color: '2dbe61' if item.checked
end
end
end
end