- "QI ActsAsSorting V0.6"
-qi_ordered_table_model = object.class
-qi_ordered_table_name = qi_ordered_table_model.to_s.tableize

-big_key = qi_ordered_table_name.to_s+@inherit_key.to_s

-if !@qi_table_orders
  =render :partial => "qi/qi_ordered_table_head", :locals => {:qi_ordered_table_name => qi_ordered_table_name, :qi_ordered_table_model => qi_ordered_table_model}





-@qi_table_orders[big_key.to_sym].each do |key,value|
  -if tr[:"#{key}"]
    =raw tr[:"#{key}"]
  
  
  -elsif object.respond_to?("tr_"+key.to_s) or object.respond_to?(key.to_s)
    -if object.respond_to?("tr_"+key.to_s) 
      -v =object.send("tr_"+key.to_s)
    
    -elsif object.respond_to?(key.to_s)
      -v = object.send(key.to_s)
    
    
    
      -if value.instance_of? Hash and value[:member_label].to_s != ""
        %td
          -if value[:as] == :ref_link
            =eval "link_to object.#{key}.#{value[:member_label]}, [:admin, object.#{key}] if object.#{key}"
          -else
          
            =eval "object.#{key}.#{value[:member_label]} if object.#{key}"
      -else
        -if value.instance_of? Hash and (value[:format] or value[:as])
          -value[:as] = value[:format] if value[:format] and !value[:as]
          
          -if value[:as] == :date
            %td=l v, :format => :short_date
          -elsif value[:as] == :boolean
            %td="Oui" if v
    
          -elsif value[:as] == :state
            %td=state_helper v
            
          -elsif value[:as] == :currency
            %td.numeraire=number_to_currency v
    
          -else
            %td= v
        -else
          %td=v

  -else
    %td
      Err :
      =key

