2019-07-01 16:14:16 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module DrawStepTable
|
|
|
|
def draw_step_table(subject)
|
|
|
|
table = Table.find_by_id(subject['id']['table_id'])
|
|
|
|
return unless table
|
|
|
|
|
2019-07-08 18:51:26 +08:00
|
|
|
color = @color
|
2019-07-01 16:14:16 +08:00
|
|
|
timestamp = table.created_at
|
|
|
|
@docx.p
|
|
|
|
@docx.p do
|
2019-07-12 19:48:14 +08:00
|
|
|
text I18n.t('projects.reports.elements.step_table.table_name', name: table.name), italic: true
|
2019-07-01 16:14:16 +08:00
|
|
|
text ' '
|
|
|
|
text I18n.t('projects.reports.elements.step_table.user_time',
|
2019-07-08 18:51:26 +08:00
|
|
|
timestamp: I18n.l(timestamp, format: :full)), color: color[:gray]
|
2019-07-01 16:14:16 +08:00
|
|
|
end
|
2019-07-08 18:51:26 +08:00
|
|
|
@docx.table JSON.parse(table.contents_utf_8)['data'], border_size: Constants::REPORT_DOCX_TABLE_BORDER_SIZE
|
2019-07-01 16:14:16 +08:00
|
|
|
end
|
|
|
|
end
|