app/helpers/admin_helper.rb
#
# Pass in a set of root FeatureNames (having the same parent)
# to build a ul list
# "completed" is used only by this method
#
Pass in a set of root FeatureNames (having the same parent)
to build a ul list
"completed" is used only by this method
Pass in a set of root FeatureNames ( having the same parent ) to build a ul list " completed " is used only by this method
def feature_name_tr(feature, root_names=nil, completed=[])
    root_names = feature.names.roots.order('position') if feature
    root_names = root_names.sort_by{ |i| i[:position] }
    html=''
    root_names.each do |name|
      next if completed.include? name
      completed << name
    	html += '<tr id="feature_name_'+name.id.to_s+'"><td class="centerText">';
    	if @locating_relation
    	  html += form_tag new_admin_feature_name_feature_name_relation_path(feature), {:method=>:get}
    		html += hidden_field_tag :target_id, name.id
    		html += submit_tag 'Select'
    	  html += '</form>'
    	else
    	  html += list_actions_for_item(name,
    				{
    				  :delete_path => admin_feature_feature_name_path(name.feature, name),
    				  :edit_path   => edit_admin_feature_feature_name_path(name.feature, name),
    				  :manage_path => admin_feature_feature_name_path(name.feature, name),
    				  :hide_view   => true
    			  }
    			)
    	end
    	html +=	'</td>'
    	padding = name.all_parents.size * 25
    	html +=	'<td style="padding-left: ' + padding.to_s + 'px">'
    	html += (name.name) + '</td>'
    	html += '<td>' + def_if_blank(name, :class).to_s + '</td>'
    	html += '<td>' + def_if_blank(name, :language).to_s + '</td>'
    	html += '<td>' + def_if_blank(name, :writing_system).to_s + '</td>'
    	html += '<td>' + fn_relationship(name).to_s + '</td>'
    	html += '<td>' + name.position.to_s + '</td>'
    	html += '<td>' + note_link_list_for(name) + '</td>'
    	html += '<td>' + new_note_link_for(name) + '</td>'
    	html += '<td>' + time_unit_link_list_for(name) + '</td>'
    	html += '<td>' + new_time_unit_link_for(name) + '</td>'
      html += '</tr>'
      html += feature_name_tr(nil, name.children, completed).to_s
    end
    (html.blank? ? '' : "<ul style='margin:0;'>#{html}</ul>").html_safe
  end
def feature_name_tr ( feature , root_names = nil , completed = [ ] ) root_names = feature . names . roots . order ( 'position' ) if feature root_names = root_names . sort_by { | i | i [ :position ] } html = '' root_names . each do | name | next if completed . include? name completed << name html += '<tr id="feature_name_' + name . id . to_s + '"><td class="centerText">' ; if @locating_relation html += form_tag new_admin_feature_name_feature_name_relation_path ( feature ) , { :method => :get } html += hidden_field_tag :target_id , name . id html += submit_tag 'Select' html += '</form>' else html += list_actions_for_item ( name , { :delete_path => admin_feature_feature_name_path ( name . feature , name ) , :edit_path => edit_admin_feature_feature_name_path ( name . feature , name ) , :manage_path => admin_feature_feature_name_path ( name . feature , name ) , :hide_view => true } ) end html += '</td>' padding = name . all_parents . size * 25 html += '<td style="padding-left: ' + padding . to_s + 'px">' html += ( name . name ) + '</td>' html += '<td>' + def_if_blank ( name , :class ) . to_s + '</td>' html += '<td>' + def_if_blank ( name , :language ) . to_s + '</td>' html += '<td>' + def_if_blank ( name , :writing_system ) . to_s + '</td>' html += '<td>' + fn_relationship ( name ) . to_s + '</td>' html += '<td>' + name . position . to_s + '</td>' html += '<td>' + note_link_list_for ( name ) + '</td>' html += '<td>' + new_note_link_for ( name ) + '</td>' html += '<td>' + time_unit_link_list_for ( name ) + '</td>' html += '<td>' + new_time_unit_link_for ( name ) + '</td>' html += '</tr>' html += feature_name_tr ( nil , name . children , completed ) . to_s end ( html . blank? ? '' : "<ul style='margin:0;'>#{html}</ul>" ) . html_safe end
Pass in a set of root FeatureNames (having the same parent)
to build a ul list
"completed" is used only by this method
Pass in a set of root FeatureNames ( having the same parent ) to build a ul list " completed " is used only by this method
feature
<not_specific>
root_names
<not_specific>
completed
<not_specific>