mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-01 13:13:22 +08:00
Add IDs to pdf and docx reports [SCI-7200]
This commit is contained in:
parent
fdc8d8ef24
commit
8d97641110
8 changed files with 12 additions and 9 deletions
|
@ -1,4 +1,7 @@
|
|||
class Project < ApplicationRecord
|
||||
ID_PREFIX = 'PR'
|
||||
|
||||
include PrefixedIdModel
|
||||
include ArchivableModel
|
||||
include SearchableModel
|
||||
include SearchableByNameModel
|
||||
|
|
|
@ -16,7 +16,7 @@ module Reports::Docx::DrawMyModule
|
|||
end
|
||||
|
||||
@docx.p do
|
||||
text I18n.t('projects.reports.elements.module.user_time',
|
||||
text I18n.t('projects.reports.elements.module.user_time', code: my_module.code,
|
||||
timestamp: I18n.l(my_module.created_at, format: :full)), color: color[:gray]
|
||||
if my_module.archived?
|
||||
text ' | '
|
||||
|
|
|
@ -12,7 +12,7 @@ module Reports::Docx::DrawMyModuleProtocol
|
|||
end
|
||||
|
||||
if @settings.dig('task', 'protocol', 'description') && protocol.description.present?
|
||||
@docx.p I18n.t('projects.reports.elements.module.protocol.user_time',
|
||||
@docx.p I18n.t('projects.reports.elements.module.protocol.user_time', code: protocol.code,
|
||||
timestamp: I18n.l(protocol.created_at, format: :full)), color: @color[:gray]
|
||||
html = custom_auto_link(protocol.description, team: @report_team)
|
||||
Reports::HtmlToWordConverter.new(@docx, { scinote_url: @scinote_url,
|
||||
|
|
|
@ -16,7 +16,7 @@ module Reports::Docx::DrawProjectHeader
|
|||
end
|
||||
|
||||
@docx.p do
|
||||
text I18n.t('projects.reports.elements.project_header.user_time',
|
||||
text I18n.t('projects.reports.elements.project_header.user_time', code: project.code,
|
||||
timestamp: I18n.l(project.created_at, format: :full)), color: color[:gray]
|
||||
br
|
||||
br
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<% end %>
|
||||
</h4>
|
||||
<div class="user-time">
|
||||
<%= t('projects.reports.elements.module.user_time', timestamp: l(timestamp, format: :full)) %>
|
||||
<%= t('projects.reports.elements.module.user_time', code: my_module.code, timestamp: l(timestamp, format: :full)) %>
|
||||
</div>
|
||||
<p class="module-start-date">
|
||||
<% if my_module.started_on.present? %>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<% end %>
|
||||
</div>
|
||||
<div class="user-time">
|
||||
<%= t('projects.reports.elements.module.protocol.user_time', timestamp: l(protocol.created_at, format: :full)) %>
|
||||
<%= t('projects.reports.elements.module.protocol.user_time', code: protocol.code, timestamp: l(protocol.created_at, format: :full)) %>
|
||||
</div>
|
||||
<div class="row module-protocol-description">
|
||||
<% if @settings.dig('task', 'protocol', 'description') && protocol.description.present? %>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<% end %>
|
||||
</h2>
|
||||
<div class="user-time">
|
||||
<%= t('projects.reports.elements.project_header.user_time', timestamp: l(project.created_at, format: :full)) %>
|
||||
<%= t('projects.reports.elements.project_header.user_time', code: project.code, timestamp: l(project.created_at, format: :full)) %>
|
||||
</div>
|
||||
</div>
|
||||
<% if defined?(children) %>
|
||||
|
|
|
@ -721,10 +721,10 @@ en:
|
|||
remove: "Remove report element from the report"
|
||||
scinote_link: "SciNote link"
|
||||
project_header:
|
||||
user_time: "Project created on %{timestamp}."
|
||||
user_time: "Project %{code} created on %{timestamp}."
|
||||
title: "Report for project %{project}"
|
||||
module:
|
||||
user_time: "Task created on %{timestamp}."
|
||||
user_time: "Task %{code} created on %{timestamp}."
|
||||
started_on: "Start date: %{started_on}"
|
||||
status: "Status:"
|
||||
no_start_date: "No start date"
|
||||
|
@ -736,7 +736,7 @@ en:
|
|||
results: "Results"
|
||||
protocol:
|
||||
name: 'Protocol'
|
||||
user_time: "Protocol created on %{timestamp}."
|
||||
user_time: "Protocol %{code} created on %{timestamp}."
|
||||
experiment:
|
||||
user_time: "Experiment %{code} created on %{timestamp}."
|
||||
no_description: "No description"
|
||||
|
|
Loading…
Reference in a new issue