mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-04 12:14:37 +08:00
Fix pdf report styling and bookmarks [SCI-6978] (#4274)
This commit is contained in:
parent
28ca1aaec6
commit
b9d953b3a4
7 changed files with 41 additions and 46 deletions
|
@ -411,7 +411,6 @@ label {
|
|||
.text-container {
|
||||
border-radius: 4px;
|
||||
padding: 5px;
|
||||
background-color: $color-concrete;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
<% export_all = defined?(export_all) && export_all %>
|
||||
<div class="report-element report-experiment-element">
|
||||
<div class="report-element-body" data-hook="report-experiment-element">
|
||||
<div class="experiment-name">
|
||||
<h3 class="experiment-name">
|
||||
<%= link_to experiment.name, canvas_experiment_url(experiment), target: :_blank %>
|
||||
<% if experiment.archived? %>
|
||||
<span class="label label-warning"><%= t('search.index.archived') %></span>
|
||||
<% end %>
|
||||
</div>
|
||||
</h3>
|
||||
<div class="user-time">
|
||||
<%= t('projects.reports.elements.experiment.user_time', code: experiment.code, timestamp: l(timestamp, format: :full)) %>
|
||||
</div>
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
<% export_all = defined?(export_all) && export_all %>
|
||||
<div class="report-element report-module-element">
|
||||
<div class="report-element-body">
|
||||
<div class="module-name">
|
||||
<h4 class="module-name">
|
||||
<%= link_to my_module.name, protocols_my_module_url(my_module), target: :_blank %>
|
||||
<% if my_module.archived? %>
|
||||
<span class="label label-warning"><%= t('search.index.archived') %></span>
|
||||
<% end %>
|
||||
</div>
|
||||
</h4>
|
||||
<div class="user-time">
|
||||
<%= t('projects.reports.elements.module.user_time', timestamp: l(timestamp, format: :full)) %>
|
||||
</div>
|
||||
|
@ -68,9 +68,10 @@
|
|||
<% end %>
|
||||
|
||||
|
||||
<div class="pull-left results-title-name">
|
||||
<div class="results-title-name">
|
||||
<%= t('projects.reports.elements.module.results') %>
|
||||
</div><br>
|
||||
|
||||
<% order_results_for_report(my_module.results, @settings.dig('task', 'result_order')).each do |result| %>
|
||||
<% if result.is_asset && @settings.dig('task', 'file_results') %>
|
||||
<%= render partial: 'reports/elements/my_module_result_asset_element.html.erb', locals: { result: result, report: report, export_all: export_all } %>
|
||||
|
@ -80,7 +81,7 @@
|
|||
<%= render partial: 'reports/elements/my_module_result_text_element.html.erb', locals: { result: result, export_all: export_all } %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div><br>
|
||||
|
||||
<% if defined?(children) %>
|
||||
<div class="report-element-children">
|
||||
|
|
|
@ -1,28 +1,28 @@
|
|||
<% result ||= report_element.result %>
|
||||
<% table = result.table %>
|
||||
<% timestamp = table.created_at %>
|
||||
<div class="report-element report-result-element report-result-table-element">
|
||||
<% name = result.name %>
|
||||
<% export_all = defined?(export_all) && export_all %>
|
||||
<div class="report-element report-result-element report-result-text-element">
|
||||
<div class="report-element-header">
|
||||
<div class="result-name-container">
|
||||
<div class="result-name">
|
||||
<%= result.name %>
|
||||
<% if result.archived? %>
|
||||
<span class="label label-warning"><%= t('search.index.archived') %></span>
|
||||
<% end %>
|
||||
</div>
|
||||
<% if defined? export_all and export_all %>
|
||||
<div class="table-name">
|
||||
<% file_link = @obj_filenames.dig(:tables, table.id, :file) %>
|
||||
<a href="<%= file_link %>">
|
||||
<em><%= file_link&.split('/')&.last %></em>
|
||||
</a>
|
||||
</div>
|
||||
<div class="result-name">
|
||||
<%= name %>
|
||||
<% if result.archived? %>
|
||||
<span class="label label-warning"><%= t('search.index.archived') %></span>
|
||||
<% end %>
|
||||
<div class="user-time">
|
||||
<%= t('projects.reports.elements.result_table.user_time', user: result.user.full_name , timestamp: l(timestamp, format: :full)) %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% if defined? export_all and export_all %>
|
||||
<div class="table-name">
|
||||
<% file_link = @obj_filenames.dig(:tables, table.id, :file) %>
|
||||
<a href="<%= file_link %>">
|
||||
<em><%= file_link&.split('/')&.last %></em>
|
||||
</a>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="user-time">
|
||||
<%= t('projects.reports.elements.result_table.user_time', user: result.user.full_name, timestamp: l(timestamp, format: :full)) %>
|
||||
</div>
|
||||
</div><br>
|
||||
<div class="report-element-body">
|
||||
<input type="hidden" class="hot-table-contents" value="<%= table.contents_utf_8 %>" />
|
||||
<div class="hot-table-container"></div>
|
||||
|
|
|
@ -14,14 +14,18 @@
|
|||
<div class="user-time">
|
||||
<%= t('projects.reports.elements.result_text.user_time', user: result.user.full_name, timestamp: l(timestamp, format: :full)) %>
|
||||
</div>
|
||||
</div>
|
||||
</div><br>
|
||||
<div class="report-element-body">
|
||||
<div class="text-container ql-editor">
|
||||
<%= custom_auto_link(result_text.prepare_for_report(:text, export_all),
|
||||
team: current_team,
|
||||
simple_format: false,
|
||||
tags: %w(img),
|
||||
base64_encoded_imgs: export_all) %>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="text-container ql-editor">
|
||||
<%= custom_auto_link(result_text.prepare_for_report(:text, export_all),
|
||||
team: current_team,
|
||||
simple_format: false,
|
||||
tags: %w(img),
|
||||
base64_encoded_imgs: export_all) %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="report-element-children">
|
||||
|
|
|
@ -6,22 +6,13 @@
|
|||
<% export_all = defined?(export_all) && export_all %>
|
||||
<div class="report-element report-step-element">
|
||||
<div class="report-element-body">
|
||||
<div class="step-name">
|
||||
<h5 class="step-name">
|
||||
<b><%= t('projects.reports.elements.step.step_pos', pos: (step.position_plus_one)) %></b> <%= step.name %>
|
||||
<%= step_status_label(step) %>
|
||||
</div>
|
||||
</h5>
|
||||
<div class="user-time">
|
||||
<%= t("projects.reports.elements.step.#{step_type_str}.user_time", user: user.full_name , timestamp: l(timestamp, format: :full)) %>
|
||||
</div>
|
||||
<div class="col-xs-12 ql-editor">
|
||||
<% if step.description.present? %>
|
||||
<%= custom_auto_link(step.prepare_for_report(:description, export_all),
|
||||
team: current_team,
|
||||
simple_format: false,
|
||||
tags: %w(img),
|
||||
base64_encoded_imgs: export_all) %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="report-element-children">
|
||||
<% step.step_orderable_elements.order(:position).each do |e| %>
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
<% project ||= report_element.project %>
|
||||
<div class="report-element report-project-header-element">
|
||||
<div class="report-element-body" data-hook="report-project-header-element">
|
||||
<div class=" project-name">
|
||||
<h2 class="project-name">
|
||||
<%= link_to t('projects.reports.elements.project_header.title', project: project.name), project_url(project), target: :_blank %>
|
||||
<% if project.archived? %>
|
||||
<span class="label label-warning"><%= t('search.index.archived') %></span>
|
||||
<% end %>
|
||||
</div>
|
||||
</h2>
|
||||
<div class="user-time">
|
||||
<%= t('projects.reports.elements.project_header.user_time', timestamp: l(project.created_at, format: :full)) %>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Reference in a new issue