%table.table.table-hover#assets_datatable
  %thead
    %tr
      - SystemConfig.transam_module_names.each do |mod|
        - if lookup_context.template_exists?("#{mod}_asset_dt_head", 'assets', true)
          = render :partial => "assets/#{mod}_asset_dt_head"

      %th.sorting_disabled.icon-column Flags
      %th.sorting_disabled.icon-column

  %tbody
    - assets.includes(:organization, :asset_subtype).each do |a|
      %tr{:data => {:action_path => inventory_path(a)}}
        - SystemConfig.transam_module_names.each do |mod|
          - if lookup_context.template_exists?("#{mod}_asset_dt_columns", "assets")
            = render :partial => "assets/#{mod}_asset_dt_columns", :locals => {:a => a }

        %td.center.icon-column.nowrap
          = format_as_boolean(a.needs_attention?, 'fa-flag', 'text-warning')
          = format_as_boolean((a.documents.count > 0), 'fa-files-o')
          = format_as_boolean((a.comments.count > 0), 'fa-comments')
        %td.center.icon-column
          = render :partial => 'assets/asset_info_detail_popup', :locals => {:asset => a}

= render :partial => 'shared/datatable_javascript', :locals => {:id => 'assets_datatable'}

%table.table.table-hover#assets_datatable
  %thead
    %tr
      - SystemConfig.transam_module_names.each do |mod|
        - if lookup_context.template_exists?("#{mod}_asset_dt_head", 'assets', true)
          = render :partial => "assets/#{mod}_asset_dt_head"

      %th.sorting_disabled.icon-column Flags
      %th.sorting_disabled.icon-column

  %tbody
    - assets.includes(:organization, :asset_subtype).each do |a|
      %tr{:data => {:action_path => inventory_path(a)}}
        - SystemConfig.transam_module_names.each do |mod|
          - if lookup_context.template_exists?("#{mod}_asset_dt_columns", "assets", true)
            = render :partial => "assets/#{mod}_asset_dt_columns", :locals => {:a => a }

        %td.center.icon-column.nowrap
          = format_as_boolean(a.needs_attention?, 'fa-flag', 'text-warning')
          = format_as_boolean((a.documents.count > 0), 'fa-files-o')
          = format_as_boolean((a.comments.count > 0), 'fa-comments')
        %td.center.icon-column
          = render :partial => 'assets/asset_info_detail_popup', :locals => {:asset => a}

= render :partial => 'shared/datatable_javascript', :locals => {:id => 'assets_datatable'}

Fix template_exists? call to correctly find partials
Fix template_exists? call to correctly find partials
