2019-07-01 16:14:16 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module DrawStepAsset
|
|
|
|
def draw_step_asset(subject)
|
|
|
|
asset = Asset.find_by_id(subject['id']['asset_id'])
|
|
|
|
return unless asset
|
|
|
|
|
|
|
|
is_image = asset.is_image?
|
|
|
|
timestamp = asset.created_at
|
2019-07-08 18:51:26 +08:00
|
|
|
color = @color
|
2019-07-01 16:14:16 +08:00
|
|
|
@docx.p
|
|
|
|
@docx.p do
|
2019-08-09 20:56:00 +08:00
|
|
|
text (I18n.t 'projects.reports.elements.step_asset.file_name', file: asset.file_name), italic: true
|
2019-07-01 16:14:16 +08:00
|
|
|
text ' '
|
|
|
|
text I18n.t('projects.reports.elements.step_asset.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
|
|
|
|
|
|
|
|
asset_image_preparing(asset) if is_image
|
|
|
|
end
|
|
|
|
end
|