diff --git a/app/assets/stylesheets/print_protocol.scss b/app/assets/stylesheets/print_protocol.scss index 7e0330d49..e555fc68f 100644 --- a/app/assets/stylesheets/print_protocol.scss +++ b/app/assets/stylesheets/print_protocol.scss @@ -6,6 +6,11 @@ margin: 8mm; } +.page-break { + clear: both; + page-break-after: always; +} + body { font-family: Lato, "Open Sans", Arial, Helvetica, sans-serif; font-size: 16px; @@ -89,7 +94,7 @@ hr { } } -.print-table { +table { border-collapse: collapse; text-align: center; width: 100%; @@ -122,8 +127,20 @@ hr { } &.thumbnail { - float: left; - padding: 1em; + align-items: flex-end; + display: flex; + justify-content: center; + padding: 1em 1em 0; + text-align: center; + width: 15%; + + img { + max-width: 100%; + } + + .print-asset-image { + flex-basis: .25; + } } &.thumbnail, @@ -146,8 +163,10 @@ hr { } .print-thumbnails { - clear: both; - overflow: hidden; + align-items: stretch; + display: flex; + flex-wrap: wrap; + justify-content: left; } .print-asset-icon { @@ -189,3 +208,18 @@ hr { font-size: .8em; text-align: right; } + +.global-avatar-container.smart-annotation { + img { + margin-right: .2em; + vertical-align: middle; + width: 1.2em; + } +} + +.ht_clone_top, +.ht_clone_bottom, +.ht_clone_left, +.ht_clone_top_left_corner { + display: none; +} diff --git a/app/views/layouts/protocols/print.html.erb b/app/views/layouts/protocols/print.html.erb index 1e6f38d0c..8abc34352 100644 --- a/app/views/layouts/protocols/print.html.erb +++ b/app/views/layouts/protocols/print.html.erb @@ -3,10 +3,37 @@ <%= t("protocols.print.title") %> + <%= javascript_include_tag 'application' %> + <%= javascript_include_tag "handsontable.full" %> + <%= render 'shared/formulas_libraries' %> <%= stylesheet_link_tag 'print_protocol', media: 'print, screen' %> <%= yield %> diff --git a/app/views/my_modules/protocols/_print_protocol_button.html.erb b/app/views/my_modules/protocols/_print_protocol_button.html.erb index 766342a87..72cc51b6d 100644 --- a/app/views/my_modules/protocols/_print_protocol_button.html.erb +++ b/app/views/my_modules/protocols/_print_protocol_button.html.erb @@ -26,7 +26,7 @@ diff --git a/app/views/protocols/print.html.erb b/app/views/protocols/print.html.erb index 073700253..0338702ce 100644 --- a/app/views/protocols/print.html.erb +++ b/app/views/protocols/print.html.erb @@ -6,8 +6,17 @@ <%= t('.header.print_info', datetime: l(DateTime.current, format: :full), full_name: current_user.full_name) %>

-

<%= @protocol.name || @protocol.my_module.name %>

-
<%= @protocol.description.html_safe %>
+

<%= @protocol.linked? ? protocol_name(@protocol.parent) : @protocol.name || @protocol.my_module.name %>

+
+ <% if @protocol.description.present? %> + <%= custom_auto_link(@protocol.tinymce_render(:description), + simple_format: false, + tags: %w(img), + team: current_team) %> + <% else %> + <%= t('my_modules.protocols.protocol_status_bar.no_description') %> + <% end %> +
<% @protocol.steps.order(position: :asc).each do |step| %> <%= step.position + 1 %>. <%= step.name %> -
<%= step.description.html_safe %>
+
+ <% if step.description.blank? %> + <%= t('protocols.steps.no_description') %> + <% else %> +
+ <%= custom_auto_link(step.tinymce_render(:description), + simple_format: false, + tags: %w(img), + team: current_team) %> +
+ <% end %> +
<% step.checklists.each do |checklist| %> <% end %> <% step.tables.each do |table| %> - <% table_data = JSON.parse(table.contents)["data"] %> -

<%= table.name %>

- - - - - <% col = "A" %> - <% table_data[0].length.times do %> - - <% col.succ! %> - <% end %> - - - - <% table_data.each_with_index do |tr, row| %> - - - <% tr.each do |td| %> - - <% end %> - - <% end %> - - + + <%= auto_link(simple_format(table.name), + link: :urls, + html: { target: '_blank' }) %> + + <% end %> <% step.assets.where(view_mode: "inline").each do |asset| %> +
<% end %> <% step.assets.where(view_mode: "list").each do |asset| %> <% end %>