From afc1b2d8b69ba6a7e499975689dda6099e71fd32 Mon Sep 17 00:00:00 2001 From: Martin Artnik Date: Fri, 18 Jun 2021 14:11:54 +0200 Subject: [PATCH] Added experiment code to PDF and DOCX [SCI-5830] --- app/services/reports/docx/draw_experiment.rb | 2 +- app/views/reports/elements/_experiment_element.html.erb | 2 +- config/locales/en.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/services/reports/docx/draw_experiment.rb b/app/services/reports/docx/draw_experiment.rb index de91d5c3a..cc9a671b5 100644 --- a/app/services/reports/docx/draw_experiment.rb +++ b/app/services/reports/docx/draw_experiment.rb @@ -11,7 +11,7 @@ module Reports::Docx::DrawExperiment @docx.h2 experiment.name, size: Constants::REPORT_DOCX_EXPERIMENT_TITLE_SIZE @docx.p do text I18n.t('projects.reports.elements.experiment.user_time', - timestamp: I18n.l(experiment.created_at, format: :full)), color: color[:gray] + code: experiment.code, timestamp: I18n.l(experiment.created_at, format: :full)), color: color[:gray] if experiment.archived? text ' | ' text I18n.t('search.index.archived'), color: color[:gray] diff --git a/app/views/reports/elements/_experiment_element.html.erb b/app/views/reports/elements/_experiment_element.html.erb index f75635068..dc90adf49 100644 --- a/app/views/reports/elements/_experiment_element.html.erb +++ b/app/views/reports/elements/_experiment_element.html.erb @@ -5,7 +5,7 @@
- <%= t('projects.reports.elements.experiment.user_time', timestamp: l(timestamp, format: :full)) %> + <%= t('projects.reports.elements.experiment.user_time', code: experiment.code, timestamp: l(timestamp, format: :full)) %> <%= link_to t('projects.reports.elements.all.scinote_link'),canvas_experiment_url(experiment), target: :_blank %>
diff --git a/config/locales/en.yml b/config/locales/en.yml index c3cd176d8..3b6214450 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -677,7 +677,7 @@ en: protocol: user_time: "Protocol created on %{timestamp}." experiment: - user_time: "Experiment created on %{timestamp}." + user_time: "Experiment %{code} created on %{timestamp}." no_description: "No description" no_tags: "No tags" module_activity: