mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-09-20 23:16:15 +08:00
Merge pull request #2949 from aignatov-bio/ai-sci-5166-add-download-links-to-reports
Add download link to reports [SCI-5166]
This commit is contained in:
commit
9aba66cd33
|
@ -458,6 +458,7 @@ label {
|
|||
.report-element-header {
|
||||
.file-name {
|
||||
margin-left: 5px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -7,10 +7,15 @@ module Reports::Docx::DrawResultAsset
|
|||
|
||||
asset = result.asset
|
||||
timestamp = asset.created_at
|
||||
asset_url = Rails.application.routes.url_helpers.asset_download_url(asset)
|
||||
color = @color
|
||||
@docx.p
|
||||
@docx.p do
|
||||
text result.name, italic: true
|
||||
text ' '
|
||||
link I18n.t('projects.reports.elements.download'), asset_url do
|
||||
italic true
|
||||
end
|
||||
text ' ' + I18n.t('search.index.archived'), color: color[:gray] if result.archived?
|
||||
text ' ' + I18n.t('projects.reports.elements.result_asset.file_name', file: asset.file_name)
|
||||
text ' ' + I18n.t('projects.reports.elements.result_asset.user_time',
|
||||
|
|
|
@ -6,11 +6,16 @@ module Reports::Docx::DrawStepAsset
|
|||
return unless asset
|
||||
|
||||
timestamp = asset.created_at
|
||||
asset_url = Rails.application.routes.url_helpers.asset_download_url(asset)
|
||||
color = @color
|
||||
@docx.p
|
||||
@docx.p do
|
||||
text (I18n.t 'projects.reports.elements.step_asset.file_name', file: asset.file_name), italic: true
|
||||
text ' '
|
||||
link I18n.t('projects.reports.elements.download'), asset_url do
|
||||
italic true
|
||||
end
|
||||
text ' '
|
||||
text I18n.t('projects.reports.elements.step_asset.user_time',
|
||||
timestamp: I18n.l(timestamp, format: :full)), color: color[:gray]
|
||||
end
|
||||
|
|
|
@ -28,8 +28,13 @@
|
|||
<em><%= t("projects.reports.elements.result_asset.file_name", file: filename) %></em>
|
||||
</a>
|
||||
<% else %>
|
||||
<em><%= t("projects.reports.elements.result_asset.file_name",
|
||||
file: truncate(asset.file_name, length: Constants::FILENAME_TRUNCATION_LENGTH)) %></em>
|
||||
<em>
|
||||
<%= t("projects.reports.elements.result_asset.file_name",
|
||||
file: truncate(asset.file_name, length: Constants::FILENAME_TRUNCATION_LENGTH)) %>
|
||||
<a href="<%= asset_download_url(asset) %>" class="download-link">
|
||||
<%= t('projects.reports.elements.download') %>
|
||||
</a>
|
||||
</em>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="pull-left user-time">
|
||||
|
|
|
@ -10,13 +10,17 @@
|
|||
<div class="pull-left file-name">
|
||||
<% if defined? export_all and export_all %>
|
||||
<a href="<%= path %>">
|
||||
<em><%=t 'projects.reports.elements.step_asset.file_name',
|
||||
file: filename %></em>
|
||||
<em><%= t('projects.reports.elements.step_asset.file_name', file: filename) %></em>
|
||||
</a>
|
||||
<% else %>
|
||||
<em><%=t 'projects.reports.elements.step_asset.file_name',
|
||||
file: truncate(asset.file_name,
|
||||
length: Constants::FILENAME_TRUNCATION_LENGTH) %></em>
|
||||
<em>
|
||||
<%= t('projects.reports.elements.step_asset.file_name',
|
||||
file: truncate(asset.file_name, length: Constants::FILENAME_TRUNCATION_LENGTH)) %>
|
||||
<a href="<%= asset_download_url(asset) %>" class="download-link">
|
||||
<%= t('projects.reports.elements.download') %>
|
||||
</a>
|
||||
</em>
|
||||
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="pull-left user-time">
|
||||
|
|
|
@ -444,6 +444,7 @@ en:
|
|||
appended_image: "Appended image - %{name}"
|
||||
appended_table: "Appended table"
|
||||
elements:
|
||||
download: "[Download]"
|
||||
modals:
|
||||
project_contents:
|
||||
head_title: "Add contents to report"
|
||||
|
|
Loading…
Reference in a new issue