<div id="<%= active_scaffold_id -%>" class="active-scaffold active-scaffold-<%= controller_id %> <%= "#{params[:controller]}-view" %> <%= active_scaffold_config.theme %>-theme">
  <div class="active-scaffold-header">
    <%= render :partial => 'list_header' %>
  </div>
  <table cellpadding="0" cellspacing="0">
    <tbody class="before-header" id="<%= before_header_id -%>">
      <% if active_scaffold_config.list.always_show_search %>
        <tr>
          <td>
            <div class="active-scaffold show_search-view <%= "#{params[:controller]}-view" %> view">
              <%= render :partial => active_scaffold_config.list.search_partial %>
            </div> 
          </td> 
        </tr>
      <% else %>
      <tr><td></td></tr>
      <% end %>
      <% if params[:nested].nil? && active_scaffold_config.list.always_show_create %>
        <tr> 
          <td> 
            <div  class="active-scaffold create-view <%= "#{params[:controller]}-view" %> view">
              <%= render :partial => 'create_form_on_list' %>
            </div> 
          </td> 
        </tr>
      <% end %>
    </tbody>
  </table>
  <div id="<%= active_scaffold_content_id -%>">
    <%= render :partial => 'list' %>
  </div>
</div>

<script type="text/javascript">
//<![CDATA[
<% if active_scaffold_config.theme != :default -%>
Rico.Corner.round($$('#<%= active_scaffold_id %> div.active-scaffold-header').first(), {color: 'fromElement', bgColor: 'fromParent', corners: 'top', compact: true});
Rico.Corner.round($$('#<%= active_scaffold_id %> div.active-scaffold-footer').first(), {color: 'fromElement', bgColor: 'fromParent', corners: 'bottom', compact: true});
<% end -%>
new ActiveScaffold.Actions.Table($$('#<%= active_scaffold_id -%> div.active-scaffold-header a.action'), $('<%= before_header_id -%>'), $('<%= loading_indicator_id(:action => :table) -%>'))
ActiveScaffold.server_error_response = '<p class="error-message message">'
  + <%= as_(:internal_error).to_json %>
  + '<a href="#" onclick="Element.remove(this.parentNode); return false;">'
  + <%= as_(:close).to_json %>
  + '</a>'
  + '</p>';
//]]>
</script>
