From 934023e9d8742bcc1855b74497679444df14b022 Mon Sep 17 00:00:00 2001 From: artoscinote <85488244+artoscinote@users.noreply.github.com> Date: Fri, 10 Jun 2022 10:41:57 +0200 Subject: [PATCH] Update print template to fit with new steps [SCI-6871] (#4153) --- app/views/protocols/print.html.erb | 80 +++++++++++++++--------------- 1 file changed, 41 insertions(+), 39 deletions(-) diff --git a/app/views/protocols/print.html.erb b/app/views/protocols/print.html.erb index be80123a5..5845bb01c 100644 --- a/app/views/protocols/print.html.erb +++ b/app/views/protocols/print.html.erb @@ -27,52 +27,54 @@ <% end %> <%= step.position + 1 %>. <%= step.name %> -
- <% if step.description.blank? %> - <%= t('protocols.steps.no_description') %> - <% else %> -
- <%= custom_auto_link(step.tinymce_render(:description), + + <% step.step_orderable_elements.order(position: :asc).each do |step_element| %> + <% case step_element.orderable_type %> + <% when 'StepText' %> + <% step_text = step_element.orderable %> + - - <% step.checklists.each do |checklist| %> - - <% end %> - - <% step.tables.each do |table| %> - + <% when 'StepTable' %> + <% table = step_element.orderable.table %> + + <% when 'Checklist' %> + <% checklist = step_element.orderable %> + + <% end %> <% end %> + <% step.assets.where(view_mode: "inline").each do |asset| %>