Update PDF report layout [SCI-6856]

This commit is contained in:
Anton 2022-05-31 14:40:25 +02:00
parent 3c63d9a3eb
commit b684841718
20 changed files with 244 additions and 352 deletions

View file

@ -210,25 +210,14 @@ label {
width: 100%;
margin-bottom: 15px;
.report-element-header {
border-bottom: 2px solid $color-black;
.user-time {
color: $color-emperor;
margin-left: 15px;
white-space: nowrap;
}
.controls {
margin-right: 15px;
font-size: $font-size-h6;
opacity: 0.05;
}
.user-time {
color: $color-silver-chalice;
white-space: nowrap;
}
.report-element-body {
padding-top: 10px;
padding-left: 15px;
padding-right: 15px;
.report-export-img {
max-height: 300px;
@ -237,7 +226,6 @@ label {
}
.report-element-children {
padding-left: 45px;
padding-top: 15px;
}
@ -256,14 +244,14 @@ label {
/* Project header element style */
.report-project-header-element {
margin-bottom: 60px;
margin-bottom: 20px;
.report-element-header {
border-bottom: none;
}
.report-element-body {
.project-name {
border-bottom: 4px solid $color-black;
@include font-h2;
}
}
@ -272,6 +260,21 @@ label {
}
}
// Experiment element style
.report-experiment-element {
.experiment-name {
@include font-main;
}
}
// Protocol element style
.report-module-protocol-element {
.protcol-name {
@include font-small;
font-weight: bold;
}
}
/* Module element style */
.report-module-element {
margin-top: 15px;
@ -279,7 +282,8 @@ label {
.report-element-body {
.module-name {
margin-left: 15px;
@include font-button;
font-weight: bold;
}
.module-start-date,
@ -338,12 +342,12 @@ label {
.result-icon {
display: inline-block;
margin-left: 15px;
}
.result-name {
@include font-small;
display: inline-block;
margin-left: 5px;
font-weight: bold;
}
.user-time {
@ -366,7 +370,8 @@ label {
.report-result-asset-element {
.report-element-header {
.file-name {
margin-left: 15px;
font-size: 10px;
font-weight: bold;
}
.image-icon.report {
@ -383,7 +388,8 @@ label {
.report-result-table-element {
.report-element-header {
.table-name {
margin-left: 15px;
font-size: 10px;
font-weight: bold;
}
}
@ -405,6 +411,11 @@ label {
/** Step element style */
.report-step-element {
.step-name {
font-size: 11px;
font-weight: bold;
}
&:hover > .report-element-body .step-name {
color: $brand-primary;
}
@ -450,13 +461,15 @@ label {
.report-step-table-element {
.report-element-header {
.table-name {
margin-left: 5px;
font-size: 10px;
font-weight: bold;
}
}
&:hover > .report-element-header {
.table-name {
color: $brand-primary;
}
}
}
@ -465,7 +478,8 @@ label {
.report-step-asset-element {
.report-element-header {
.file-name {
margin-left: 5px;
font-size: 10px;
font-weight: bold;
white-space: nowrap;
}
@ -483,7 +497,8 @@ label {
.report-step-checklist-element {
.report-element-header {
.checklist-name {
margin-left: 5px;
font-size: 10px;
font-weight: bold;
}
}
@ -510,8 +525,9 @@ label {
}
.comments-name {
margin-left: 5px;
color: $color-emperor;
font-size: 10px;
font-weight: bold;
}
}
@ -519,7 +535,6 @@ label {
.comments-container {
border-radius: 4px;
padding: 5px;
background-color: $color-alabaster;
.comment {
margin: 3px 2px;
@ -556,11 +571,8 @@ label {
border-bottom: 0;
.repository-name {
margin-left: 5px;
}
.table-name {
margin-left: 15px;
@include font-small;
font-weight: bold;
}
}
@ -584,7 +596,8 @@ label {
border-bottom: none;
.activity-name {
margin-left: 5px;
@include font-small;
font-weight: bold;
}
}
@ -592,7 +605,6 @@ label {
.activity-container {
border-radius: 4px;
padding: 5px;
background-color: $color-alabaster;
.activity {
margin: 3px 2px;

View file

@ -453,7 +453,7 @@
}
.experiment-name {
@include font-h1;
@include font-main;
display: inline-block;
overflow: hidden;
text-overflow: ellipsis;

View file

@ -2,35 +2,19 @@
<% timestamp = experiment.created_at %>
<% export_all = defined?(export_all) && export_all %>
<div class="report-element report-experiment-element">
<div class="report-element-header">
<div class="row">
<div class="pull-left user-time">
<%= t('projects.reports.elements.experiment.user_time', code: experiment.code, timestamp: l(timestamp, format: :full)) %>
<b><%= link_to t('projects.reports.elements.all.scinote_link'),canvas_experiment_url(experiment), target: :_blank %></b>
</div>
</div>
</div>
<div class="report-element-body" data-hook="report-experiment-element">
<div class="row">
<div class="pull-left experiment-name">
<h4>
<i class="fas fa-flask"></i>
<%= experiment.name %>
<% if experiment.archived? %>
<span class="label label-warning"><%= t('search.index.archived') %></span>
<% end %>
</h4>
</div>
<div 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>
<div class="row">
<div class="col-xs-12">
<% if experiment.description.present? %>
<%= custom_auto_link(experiment.description, team: current_team, base64_encoded_imgs: export_all) %>
<% else %>
<em><%= t('projects.reports.elements.experiment.no_description') %></em>
<% end %>
</div>
<div class="user-time">
<%= t('projects.reports.elements.experiment.user_time', code: experiment.code, timestamp: l(timestamp, format: :full)) %>
</div>
<% if experiment.description.present? %>
<%= custom_auto_link(experiment.description, team: current_team, base64_encoded_imgs: export_all) %>
<% end %>
</div>
<% if defined?(children) %>
<div class="report-element-children">

View file

@ -1,20 +1,15 @@
<% my_module ||= report_element.my_module %>
<% activities = ActivitiesService.my_module_activities(my_module).order(created_at: :desc) %>
<div class="report-element report-module-activity-element">
<div class="report-element-header">
<div class="row">
<div class="pull-left activity-icon">
<span class="fas fa-list"></span>
</div>
<div class="pull-left activity-name">
<%= t('projects.reports.elements.module_activity.name', my_module: my_module.name) %>
<% if activities.present? %>
<div class="report-element report-module-activity-element">
<div class="report-element-header">
<div class="activity-name">
<%= t('projects.reports.elements.module_activity.name') %>
</div>
</div>
</div>
<div class="report-element-body">
<div class="row">
<div class="col-xs-12 activity-container">
<% if activities.present? %>
<div class="report-element-body">
<div class="row">
<div class="col-xs-12 activity-container">
<ul class="no-style activity-list">
<% activities.each do |activity| %>
<li class="activity">
@ -32,15 +27,13 @@
</li>
<% end %>
</ul>
<% else %>
<em><%= t('projects.reports.elements.module_activity.no_activity') %></em>
<% end %>
</div>
</div>
</div>
<% if defined?(children) %>
<div class="report-element-children">
<%= children %>
</div>
<% end %>
</div>
<% if defined?(children) %>
<div class="report-element-children">
<%= children %>
</div>
<% end %>
</div>
<% end %>

View file

@ -2,38 +2,24 @@
<% timestamp = my_module.created_at %>
<% export_all = defined?(export_all) && export_all %>
<div class="report-element report-module-element">
<div class="report-element-header">
<div class="row">
<div class="pull-left user-time">
<%= t('projects.reports.elements.module.user_time', timestamp: l(timestamp, format: :full)) %>
<b><%= link_to t('projects.reports.elements.all.scinote_link'), protocols_my_module_url(my_module), target: :_blank %></b>
</div>
</div>
</div>
<div class="report-element-body">
<div class="row">
<div class="pull-left module-name">
<h4>
<span class="fas fa-credit-card"></span>
<%= my_module.name %>
<% if my_module.archived? %>
<span class="label label-warning"><%= t('search.index.archived') %></span>
<% end %>
</h4>
</div>
<div 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>
<div class="user-time">
<%= t('projects.reports.elements.module.user_time', timestamp: l(timestamp, format: :full)) %>
</div>
<p class="module-start-date">
<% if my_module.started_on.present? %>
<%= t('projects.reports.elements.module.started_on', started_on: l(my_module.started_on, format: :full)) %>
<% else %>
<em><%= t('projects.reports.elements.module.no_start_date') %></em>
<% end %>
</p>
<p class="module-due-date">
<% if my_module.due_date.present? %>
<%= t('projects.reports.elements.module.due_date', due_date: l(my_module.due_date, format: :full)) %>
<% else %>
<em><%= t('projects.reports.elements.module.no_due_date') %></em>
<% end %>
</p>
<p class="module-status">
@ -59,10 +45,6 @@
<%= tag.name %>
</div>
<% end %>
<% else %>
<div class="pull-left module-no-tag">
<em><%= t('projects.reports.elements.module.no_tags') %></em>
</div>
<% end %>
</div>
<div class="row">
@ -72,8 +54,6 @@
team: current_team,
simple_format: false,
base64_encoded_imgs: export_all) %>
<% else %>
<em><%= t('projects.reports.elements.module.no_description') %></em>
<% end %>
</div>
</div>

View file

@ -1,27 +1,19 @@
<% protocol ||= report_element.my_module.protocol %>
<% export_all = defined?(export_all) && export_all %>
<div class="report-element report-module-protocol-element">
<div class="report-element-header">
<div class="row">
<div class="pull-left user-time">
<%= t('projects.reports.elements.module.protocol.user_time', timestamp: l(protocol.created_at, format: :full)) %>
</div>
</div>
</div>
<div class="report-element-body">
<div class="pull-left protocol-name">
<h4>
<%= protocol.name %>
</h4>
</div>
<div class="protocol-name">
<%= protocol.name || t('projects.reports.elements.module.protocol.name') %>
</div>
<div class="user-time">
<%= t('projects.reports.elements.module.protocol.user_time', timestamp: l(protocol.created_at, format: :full)) %>
</div>
<div class="row module-protocol-description">
<% if protocol.description.present? %>
<%= custom_auto_link(protocol.prepare_for_report(:description, export_all),
team: current_team,
simple_format: false,
base64_encoded_imgs: export_all) %>
<% else %>
<em><%= t('my_modules.protocols.protocol_status_bar.no_description') %></em>
<% end %>
</div>
</div>

View file

@ -5,23 +5,18 @@
<% rows_json = my_module.repository_json_hot(repository, :desc) %>
<div class="report-element report-module-repository-element">
<div class="report-element-header">
<div class="row">
<div class="pull-left repository-icon">
<i class="fas fa-list-alt"></i>
</div>
<div class="pull-left repository-name">
<%= t('projects.reports.elements.module_repository.name', repository: repository.name, my_module: my_module.name) %>
<i><%= t('projects.reports.index.deleted') if repository.is_a?(RepositorySnapshot) && !repository.original_repository %></i>
</div>
<% if defined?(export_all) && export_all %>
<div class="pull-left table-name">
<% file_link = @obj_filenames.dig(:repositories, repository.id, :file) %>
<a href="<%= file_link %>">
<em><%= t('projects.reports.elements.module_repository.table_name', name: file_link&.split('/')&.last) %></em>
</a>
</div>
<% end %>
<div class="pull-left repository-name">
<%= repository.name %>
<i><%= t('projects.reports.index.deleted') if repository.is_a?(RepositorySnapshot) && !repository.original_repository %></i>
</div>
<% if defined?(export_all) && export_all %>
<div class="pull-left table-name">
<% file_link = @obj_filenames.dig(:repositories, repository.id, :file) %>
<a href="<%= file_link %>">
<em><%= t('projects.reports.elements.module_repository.table_name', name: file_link&.split('/')&.last) %></em>
</a>
</div>
<% end %>
</div>
<div class="report-element-body">
<% if rows_json[:data].count > 0 %>

View file

@ -4,16 +4,16 @@
<div class="report-element report-result-element report-result-asset-element">
<div class="report-element-header">
<div class="row">
<div class="pull-left result-icon">
<div class="result-icon">
<%= file_extension_icon_html(asset, true) %>
</div>
<div class="pull-left result-name">
<div class="result-name">
<%= result.name %>
<% if result.archived? %>
<span class="label label-warning"><%= t('search.index.archived') %></span>
<% end %>
</div>
<div class="pull-left file-name">
<div class="file-name">
<% if defined? export_all and export_all %>
<% if @obj_filenames.dig(:assets, asset.id, :bio_eddie) %>
<% file_link = @obj_filenames.dig(:assets, asset.id, :bio_eddie) %>
@ -21,23 +21,23 @@
<% file_link = @obj_filenames.dig(:assets, asset.id, :file) %>
<% end %>
<a href="<%= file_link %>" class="export-all-link" >
<em><%= t("projects.reports.elements.result_asset.file_name", file: file_link&.split('/')&.last) %></em>
<em><%= file_link&.split('/')&.last %></em>
</a>
<% else %>
<em>
<% if asset.file.metadata[:asset_type] == 'bio_eddie' %>
<%= t("projects.reports.elements.result_asset.file_name", file: truncate("#{asset.file.metadata[:name]}.helm", length: Constants::FILENAME_TRUNCATION_LENGTH)) %>
<%= truncate("#{asset.file.metadata[:name]}.helm", length: Constants::FILENAME_TRUNCATION_LENGTH) %>
<a class="btn btn-light file-download-link" href="data:text/plain;charset=utf-8,<%= asset.file.metadata[:description] %>" download="<%= asset.file.metadata[:name] %>.helm" data-turbolinks="false">
<span class="fas fa-download"></span> <%= t('Download')%>
</a>
<% else %>
<%= t("projects.reports.elements.result_asset.file_name", file: truncate(asset.file_name, length: Constants::FILENAME_TRUNCATION_LENGTH)) %>
<%= truncate(asset.file_name, length: Constants::FILENAME_TRUNCATION_LENGTH) %>
<%= link_to t('projects.reports.elements.download'), asset_download_url(asset, disposition: 'attachment'), class: 'download-link', target: :_blank %>
<% end %>
</em>
<% end %>
</div>
<div class="pull-left user-time">
<div class="user-time">
<%= t("projects.reports.elements.result_asset.user_time", user: result.user.full_name, timestamp: l(timestamp, format: :full)) %>
<% if report.settings.dig(:task, :file_results_previews) %>
<%= t('projects.reports.elements.result_asset.full_preview_attached') %>

View file

@ -3,28 +3,23 @@
<% timestamp = table.created_at %>
<div class="report-element report-result-element report-result-table-element">
<div class="report-element-header">
<div class="row">
<div class="pull-left result-name-container">
<div class="pull-left result-icon">
<span class="fas fa-table"></span>
</div>
<div class="pull-left 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="pull-left table-name">
<% file_link = @obj_filenames.dig(:tables, table.id, :file) %>
<a href="<%= file_link %>">
<em><%=t "projects.reports.elements.result_table.table_name", name: file_link&.split('/')&.last %></em>
</a>
</div>
<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 class="pull-left user-time">
<%= t('projects.reports.elements.result_table.user_time', user: result.user.full_name , timestamp: l(timestamp, format: :full)) %>
</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>
</div>

View file

@ -5,30 +5,23 @@
<% 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="row">
<div class="pull-left result-icon">
<span class="fas fa-asterisk"></span>
</div>
<div class="pull-left result-name">
<%= name %>
<% if result.archived? %>
<span class="label label-warning"><%= t('search.index.archived') %></span>
<% end %>
</div>
<div class="pull-left user-time">
<%= t('projects.reports.elements.result_text.user_time', user: result.user.full_name, timestamp: l(timestamp, format: :full)) %>
</div>
<div class="result-name">
<%= name %>
<% if result.archived? %>
<span class="label label-warning"><%= t('search.index.archived') %></span>
<% end %>
</div>
<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 class="report-element-body">
<div class="row">
<div class="col-xs-12 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 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 class="report-element-children">

View file

@ -5,35 +5,22 @@
<% assets = step.assets %>
<% export_all = defined?(export_all) && export_all %>
<div class="report-element report-step-element">
<div class="report-element-header">
<div class="row">
<div class="pull-left user-time">
<%= t("projects.reports.elements.step.#{step_type_str}.user_time", user: user.full_name , timestamp: l(timestamp, format: :full)) %>
</div>
</div>
</div>
<div class="report-element-body">
<div class="row">
<div class="pull-left step-name">
<h5>
<span class="fas fa-arrow-circle-right"></span>
<b><%= t('projects.reports.elements.step.step_pos', pos: (step.position_plus_one)) %></b>&nbsp;<%= step.name %>
<%= step_status_label(step) %>
</h5>
</div>
<div class="step-name">
<b><%= t('projects.reports.elements.step.step_pos', pos: (step.position_plus_one)) %></b>&nbsp;<%= step.name %>
<%= step_status_label(step) %>
</div>
<div class="row">
<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) %>
<% else %>
<em><%= t('projects.reports.elements.step.no_description') %></em>
<% end %>
</div>
<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">

View file

@ -1,22 +1,14 @@
<% project ||= report_element.project %>
<div class="report-element report-project-header-element">
<div class="report-element-header">
<div class="row">
<div class="pull-left user-time">
<%= t('projects.reports.elements.project_header.user_time', timestamp: l(project.created_at, format: :full)) %>
</div>
</div>
</div>
<div class="report-element-body" data-hook="report-project-header-element">
<div class="row">
<div class="col-xs-12 project-name">
<h2>
<%= t('projects.reports.elements.project_header.title', project: project.name) %>
<% if project.archived? %>
<span class="label label-warning"><%= t('search.index.archived') %></span>
<% end %>
</h2>
</div>
<div 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>
<div class="user-time">
<%= t('projects.reports.elements.project_header.user_time', timestamp: l(project.created_at, format: :full)) %>
</div>
</div>
<% if defined?(children) %>

View file

@ -1,36 +1,31 @@
<% result ||= report_element.result %>
<% comments = result.result_comments.order(created_at: :desc) %>
<% export_all = defined?(export_all) && export_all %>
<div class="report-element report-comments-element report-result-comments-element">
<div class="report-element-header">
<div class="row">
<div class="pull-left comments-icon">
<span class="fas fa-comment"></span>
</div>
<div class="pull-left comments-name">
<%= t('projects.reports.elements.result_comments.name', result: result.name) %>
<% if comments.present? %>
<div class="report-element report-comments-element report-result-comments-element">
<div class="report-element-header">
<div class="row">
<div class="pull-left comments-name">
<%= t('projects.reports.elements.result_comments.name', result: result.name) %>
</div>
</div>
</div>
</div>
<div class="report-element-body">
<div class="row">
<div class="col-xs-12 comments-container simple">
<% if comments.present? %>
<div class="report-element-body">
<div class="row">
<div class="col-xs-12 comments-container simple">
<ul class="no-style content-comments">
<% comments.each do |comment| %>
<%= render partial: 'shared/comments/item.html.erb',
locals: { comment: comment, readonly: true, report: true, export_all: export_all } %>
locals: { comment: comment, readonly: true, report: true, export_all: export_all } %>
<% end %>
</ul>
<% else %>
<em><%= t('projects.reports.elements.result_comments.no_comments') %></em>
<% end %>
</div>
</div>
</div>
<% if defined?(children) %>
<div class="report-element-children">
<%= children %>
</div>
<% end %>
</div>
<% if defined?(children) %>
<div class="report-element-children">
<%= children %>
</div>
<% end %>
</div>
<% end %>

View file

@ -2,37 +2,35 @@
<% timestamp = asset.created_at %>
<div class="report-element report-step-attachment-element report-step-asset-element">
<div class="report-element-header">
<div class="row">
<div class="pull-left attachment-icon <%= defined?(export_all) && export_all ? 'export-all-icons' : '' %>">
<%= file_extension_icon_html(asset, true) %>
</div>
<div class="pull-left file-name">
<% if defined? export_all and export_all %>
<% if @obj_filenames.dig(:assets, asset.id, :bio_eddie) %>
<% file_link = @obj_filenames.dig(:assets, asset.id, :bio_eddie) %>
<% else %>
<% file_link = @obj_filenames.dig(:assets, asset.id, :file) %>
<% end %>
<a href="<%= file_link %>" class="export-all-link">
<em><%= t('projects.reports.elements.step_asset.file_name', file: file_link&.split('/')&.last) %></em>
</a>
<div class="pull-left attachment-icon <%= defined?(export_all) && export_all ? 'export-all-icons' : '' %>">
<%= file_extension_icon_html(asset, true) %>
</div>
<div class="pull-left file-name">
<% if defined? export_all and export_all %>
<% if @obj_filenames.dig(:assets, asset.id, :bio_eddie) %>
<% file_link = @obj_filenames.dig(:assets, asset.id, :bio_eddie) %>
<% else %>
<em>
<% if asset.file.metadata[:asset_type] == 'bio_eddie' %>
<%= t('projects.reports.elements.step_asset.file_name', file: truncate("#{asset.file.metadata[:name]}.helm", length: Constants::FILENAME_TRUNCATION_LENGTH)) %>
<a class="btn btn-light file-download-link" href="data:text/plain;charset=utf-8,<%= asset.file.metadata[:description] %>" download="<%= asset.file.metadata[:name] %>.helm" data-turbolinks="false">
<span class="fas fa-download"></span> <%= t('Download')%>
</a>
<% else %>
<%= t('projects.reports.elements.step_asset.file_name', file: truncate(asset.file_name, length: Constants::FILENAME_TRUNCATION_LENGTH)) %>
<%= link_to t('projects.reports.elements.download'), asset_download_url(asset, disposition: 'attachment'), class: 'download-link', target: :_blank %>
<% end %>
</em>
<% file_link = @obj_filenames.dig(:assets, asset.id, :file) %>
<% end %>
</div>
<div class="pull-left user-time">
<%= t('projects.reports.elements.step_asset.user_time', timestamp: l(timestamp, format: :full)) %>
</div>
<a href="<%= file_link %>" class="export-all-link">
<em><%= file_link&.split('/')&.last %></em>
</a>
<% else %>
<em>
<% if asset.file.metadata[:asset_type] == 'bio_eddie' %>
<%= truncate("#{asset.file.metadata[:name]}.helm", length: Constants::FILENAME_TRUNCATION_LENGTH) %>
<a class="btn btn-light file-download-link" href="data:text/plain;charset=utf-8,<%= asset.file.metadata[:description] %>" download="<%= asset.file.metadata[:name] %>.helm" data-turbolinks="false">
<span class="fas fa-download"></span> <%= t('Download')%>
</a>
<% else %>
<%= truncate(asset.file_name, length: Constants::FILENAME_TRUNCATION_LENGTH) %>
<%= link_to t('projects.reports.elements.download'), asset_download_url(asset, disposition: 'attachment'), class: 'download-link', target: :_blank %>
<% end %>
</em>
<% end %>
</div>
<div class="user-time">
<%= t('projects.reports.elements.step_asset.user_time', timestamp: l(timestamp, format: :full)) %>
</div>
</div>
<div class="report-element-body">

View file

@ -4,19 +4,13 @@
<% export_all = defined?(export_all) && export_all %>
<div class="report-element report-step-attachment-element report-step-checklist-element">
<div class="report-element-header">
<div class="row">
<div class="pull-left attachment-icon">
<span class="fas fa-tasks"></span>
</div>
<div class="pull-left checklist-name">
<%= custom_auto_link(t('projects.reports.elements.step_checklist.checklist_name',
name: checklist.name),
team: current_team,
base64_encoded_imgs: export_all) %>
</div>
<div class="pull-left user-time">
<%= t('projects.reports.elements.step_checklist.user_time', timestamp: l(timestamp, format: :full)) %>
</div>
<div class="checklist-name">
<%= custom_auto_link(name: checklist.name,
team: current_team,
base64_encoded_imgs: export_all) %>
</div>
<div class="user-time">
<%= t('projects.reports.elements.step_checklist.user_time', timestamp: l(timestamp, format: :full)) %>
</div>
</div>
<div class="report-element-body">

View file

@ -1,36 +1,29 @@
<% step ||= report_element.step %>
<% comments = step.step_comments.order(created_at: :desc) %>
<% export_all = defined?(export_all) && export_all %>
<div class="report-element report-comments-element report-step-comments-element">
<div class="report-element-header">
<div class="row">
<div class="pull-left comments-icon">
<span class="fas fa-comment"></span>
</div>
<% if comments.present? %>
<div class="report-element report-comments-element report-step-comments-element">
<div class="report-element-header">
<div class="pull-left comments-name">
<%= t('projects.reports.elements.step_comments.name', step: step.name) %>
<%= t('projects.reports.elements.step_comments.name') %>
</div>
</div>
</div>
<div class="report-element-body">
<div class="row">
<div class="col-xs-12 comments-container simple">
<% if comments.present? %>
<div class="report-element-body">
<div class="row">
<div class="col-xs-12 comments-container simple">
<ul class="no-style content-comments">
<% comments.each do |comment| %>
<%= render partial: 'shared/comments/item.html.erb',
locals: { comment: comment, readonly: true, report: true, export_all: export_all } %>
locals: { comment: comment, readonly: true, report: true, export_all: export_all } %>
<% end %>
</ul>
<% else %>
<em><%= t('projects.reports.elements.step_comments.no_comments') %></em>
<% end %>
</div>
</div>
</div>
<% if defined?(children) %>
<div class="report-element-children">
<%= children %>
</div>
<% end %>
</div>
<% if defined?(children) %>
<div class="report-element-children">
<%= children %>
</div>
<% end %>
</div>
<% end %>

View file

@ -2,29 +2,24 @@
<% timestamp = table.created_at %>
<div class="report-element report-step-attachment-element report-step-table-element">
<div class="report-element-header">
<div class="row">
<div class="pull-left attachment-icon">
<span class="fas fa-table"></span>
</div>
<div class="pull-left table-name">
<% if defined? export_all and export_all %>
<% file_link = @obj_filenames.dig(:tables, table.id, :file) %>
<a href="<%= file_link %>">
<em>
<%= t('projects.reports.elements.step_table.table_name', name: file_link&.split('/')&.last) %>
</em>
</a>
<% else %>
<% if table.try(:name) %>
<em>
<%= t('projects.reports.elements.step_table.table_name', name: truncate(table.name, length: Constants::FILENAME_TRUNCATION_LENGTH)) %>
</em>
<% end %>
<div class="table-name">
<% if defined? export_all and export_all %>
<% file_link = @obj_filenames.dig(:tables, table.id, :file) %>
<a href="<%= file_link %>">
<em>
<%= file_link&.split('/')&.last %>
</em>
</a>
<% else %>
<% if table.try(:name) %>
<em>
<%= truncate(table.name, length: Constants::FILENAME_TRUNCATION_LENGTH) %>
</em>
<% end %>
</div>
<div class="pull-left user-time">
<%= t('projects.reports.elements.step_table.user_time', timestamp: l(timestamp, format: :full)) %>
</div>
<% end %>
</div>
<div class="user-time">
<%= t('projects.reports.elements.step_table.user_time', timestamp: l(timestamp, format: :full)) %>
</div>
</div>
<div class="report-element-body">

View file

@ -1,7 +1,6 @@
<style>
.print-footer {
line-height: 50px;
margin-right: 30px;
text-align: right;
}

View file

@ -1,5 +1,6 @@
<style>
.print-header {
border-bottom: 2px solid #a0a0a8;
line-height: 50px;
}

View file

@ -711,25 +711,22 @@ en:
tags_header: "Task tags:"
no_tags: "No tags"
protocol:
name: 'Protocol'
user_time: "Protocol created on %{timestamp}."
experiment:
user_time: "Experiment %{code} created on %{timestamp}."
no_description: "No description"
no_tags: "No tags"
module_activity:
name: "Activity of task %{my_module}"
name: "Task activity"
sidebar_name: "Activity"
no_activity: "No activities"
module_repository:
name: "%{repository} of task %{my_module}"
table_name: "[ %{name} ]"
no_items: "No items"
result_asset:
file_name: "[ %{file} ]"
user_time: "Uploaded by %{user} on %{timestamp}."
full_preview_attached: "[full document attached to report]"
result_table:
table_name: "[ %{name} ]"
user_time: "Created by %{user} on %{timestamp}."
result_text:
user_time: "Created by %{user} on %{timestamp}."
@ -742,24 +739,21 @@ en:
uncompleted:
user_time: "Created by %{user} on %{timestamp}."
step_table:
table_name: "[ %{name} ]"
user_time: "Table created on %{timestamp}."
step_asset:
sidebar_name: "File %{file}"
file_name: "[ %{file} ]"
user_time: "File uploaded on %{timestamp}."
step_checklist:
checklist_name: "[ %{name} ]"
user_time: "Checklist created on %{timestamp}."
checked: "checked"
result_comments:
sidebar_name: "Comments"
name: "Comments for result %{result}"
name: "Result comments"
no_comments: "No comments"
comment_prefix: "%{user} on %{date} at %{time}:"
step_comments:
sidebar_name: "Comments"
name: "Comments for step %{step}"
name: "Step comments"
no_comments: "No comments"
comment_prefix: "%{user} on %{date} at %{time}:"
experiment_archive: