Split up work package attributes helper method by responsibility

pull/802/head
Till Breuer 11 years ago
parent 06bbab0aaf
commit b04146685e
  1. 10
      app/helpers/work_packages_helper.rb

@ -330,19 +330,25 @@ module WorkPackagesHelper
].compact
end
def work_package_show_attributes(work_package)
def work_package_show_attribute_list(work_package)
main_attributes = work_package_show_main_attributes(work_package)
custom_field_attributes = work_package_show_custom_fields(work_package)
hook_attributes = YAML::load(call_hook(:view_work_packages_show_details_bottom, :issue => work_package))
attribute_list = (main_attributes | custom_field_attributes | (hook_attributes || [])).compact
(main_attributes | custom_field_attributes | (hook_attributes || [])).compact
end
def group_work_package_attributes(attribute_list)
attributes = {}
attributes[:left], attributes[:right] = attribute_list.each_slice((attribute_list.count+1) / 2).to_a
attributes
end
def work_package_show_attributes(work_package)
group_work_package_attributes work_package_show_attribute_list(work_package)
end
def work_package_show_table_row(attribute, klass = nil, &block)
klass = attribute.to_s.dasherize if klass.nil?

Loading…
Cancel
Save