- abstractor_abstraction ||= @abstractor_abstraction - abstraction_schema = abstractor_abstraction.abstractor_subject.abstractor_abstraction_schema .abstractor_abstraction_edit = form_for abstractor_abstraction, url: Abstractor::UserInterface.abstractor_relative_path(abstractor.abstractor_abstraction_path(abstractor_abstraction)), method: :put, :remote => true do |f| .column-3 .abstraction_schema_name = abstraction_schema.display_name .column-7 - case abstraction_schema.abstractor_object_type.value - when 'date' = f.text_field :value, class: 'abstractor_datepicker' - when 'string' = f.text_field :value - when 'number' = f.number_field :value - when 'radio button list' - values = abstraction_schema.abstractor_object_values.sort_by(&:value) - values.each do |value| = f.radio_button :value, value.value = f.label :value, value.value, value: value.value = f.radio_button :value, '', {:style => 'display:none;' }   - when 'list' - values = abstraction_schema.abstractor_object_values.sort_by(&:value) = f.select :value, values.map{|s| [s.value, s.value]}, {:include_blank => true}, :class => "combobox" - when 'dynamic list' - values = abstractor_abstraction.about.send(abstractor_abstraction.abstractor_subject.dynamic_list_method).sort_by { |l| l[:value] } = f.select :value, values.map{|s| [s[:value], s[:id]]}, {:include_blank => true}, :class => "combobox" - when 'boolean' - ['true', 'false'].each do |value| = f.radio_button :value, value = f.label :value, value = f.radio_button :value, '', {:style => 'display:none;'}   - else = f.text_field :value %br = f.check_box :not_applicable = f.label :not_applicable, 'not applicable'   = f.check_box :unknown = f.label :unknown, 'unknown' .column-3 - abstractor_abstraction = f.object - abstraction_sources = abstractor_abstraction.abstractor_subject.abstractor_abstraction_sources.select { |s| s.abstractor_abstraction_source_type.name != 'indirect' } - abstraction_sources.each do |abstraction_source| - abstraction_source.normalize_from_method_to_sources(abstractor_abstraction.about).each do |source| - dom_id = "#{abstraction_source.id}_#{source[:source_type]}_#{source[:source_id]}_#{source[:source_method]}" %span{ :class => 'abstractor_abstraction_source_tooltip_img label', :rel =>"#abstraction_text_#{dom_id}", :title => "#{source[:source_type].to_s} #{source[:source_method]}"} = image_tag('abstractor/page.png', :id => "abstraction_text_link_#{dom_id}") %br %div{ :id => "abstraction_text_#{dom_id}", :class => 'tooltip'} = simple_format(source[:source_type].find(source[:source_id]).send(source[:source_method])) .column-4 = f.submit 'Save', :class => 'button positive' = link_to 'Cancel', abstractor_abstraction, :class => 'button negative', :remote => true .clear .indirect_sources - abstraction_sources = abstractor_abstraction.abstractor_subject.abstractor_abstraction_sources.select { |s| s.abstractor_abstraction_source_type.name == 'indirect' } = f.fields_for :abstractor_indirect_sources, f.object.abstractor_indirect_sources do |abstractor_indirect_source_form| .indirect_source - abstraction_source = abstraction_sources.select { |abstraction_source| abstraction_source.id == abstractor_indirect_source_form.object.abstractor_abstraction_source_id }.first - source_setup = abstractor_abstraction.about.send(abstraction_source.from_method) - sources = source_setup[:sources].all %label Indirect Source: = source_setup[:source_type].tableize.humanize %br = abstractor_indirect_source_form.select :source_id, sources.map{ |s| [s.send(source_setup[:source_name_method]), s.id] }, { :include_blank => 'None' }, :size => "#{sources.size + 1}", class: 'indirect_source_list', rel: "#{source_setup[:source_type]}" - sources.each do |source| - hidden = abstractor_indirect_source_form.object.source_id == source.id ? '' : 'hidden' %div{ class: "indirect_source_text #{hidden} #{source_setup[:source_type]}_#{source.id}"} = simple_format(source.send(source_setup[:source_method]))