scinote-web/app/services/reports/docx/draw_my_module_protocol.rb
aignatov-bio 2793777463
Features/docx report (#1873)
* Initial setup for docx report

* Add render for project, experiment, my_module

* Implement converter for RTE fields

* Add all report elements

* fix markup

* Change headers, remove empty blocks, refactored repository draw

* Add smart annotations support

* Fix justify fields

* Prepare for addons integration

* Fix markup

* Add comments to GemFile

* Fix TinyMCE error

* Change UI for new report download selector

* Fix file error in inventory cell for docx

* Fix i18n object for header
2019-07-01 10:14:16 +02:00

20 lines
580 B
Ruby

# frozen_string_literal: true
module DrawMyModuleProtocol
def draw_my_module_protocol(subject)
my_module = MyModule.find_by_id(subject['id']['my_module_id'])
return unless my_module
protocol = my_module.protocol
return false unless protocol.description.present?
@docx.p I18n.t 'projects.reports.elements.module.protocol.user_time',
timestamp: I18n.l(protocol.created_at, format: :full)
@docx.hr
html = custom_auto_link(protocol.description, team: @report_team)
html_to_word_converter(html)
@docx.p
@docx.p
end
end