mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-26 16:53:12 +08:00
Fix for show date value
This commit is contained in:
parent
dc0c629798
commit
73dd6678ee
1 changed files with 6 additions and 8 deletions
|
@ -64,13 +64,7 @@ module GlobalActivitiesHelper
|
||||||
|
|
||||||
path = obj.archived? ? archive_my_module_path(obj.my_module) : results_my_module_path(obj.my_module)
|
path = obj.archived? ? archive_my_module_path(obj.my_module) : results_my_module_path(obj.my_module)
|
||||||
when Step
|
when Step
|
||||||
if obj.protocol.in_repository?
|
return current_value
|
||||||
path = protocols_path
|
|
||||||
elsif obj.protocol.my_module.navigable?
|
|
||||||
path = protocols_my_module_path(obj.my_module)
|
|
||||||
else
|
|
||||||
return current_value
|
|
||||||
end
|
|
||||||
when Report
|
when Report
|
||||||
path = reports_path
|
path = reports_path
|
||||||
else
|
else
|
||||||
|
@ -83,8 +77,12 @@ module GlobalActivitiesHelper
|
||||||
obj = message_item[:type].constantize.find_by_id(message_item[:id])
|
obj = message_item[:type].constantize.find_by_id(message_item[:id])
|
||||||
return message_item[:value] unless obj
|
return message_item[:value] unless obj
|
||||||
|
|
||||||
value = obj.public_send(message_item[:getter] || 'name')
|
value = obj.public_send(message_item[:value_for] || 'name')
|
||||||
value = t('global_activities.index.no_name') if value.blank?
|
value = t('global_activities.index.no_name') if value.blank?
|
||||||
|
|
||||||
|
# format if is datetime format
|
||||||
|
value = l(value, format: :full_date) if value.methods.include? :strftime
|
||||||
|
|
||||||
value
|
value
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue