<% @title = current_resource.human %>

<%= @title %>

<% if respond_to? :will_paginate %> <%= will_paginate @records, :url => current_resource.index_path(:page => '') %> <% end %>
<% if @records.empty? %>

Sorry, but there is no records in <%= current_resource.human %>

<% else %> <% index_fields.each do |field| -%> <% end -%> <% @records.each do |record| -%> <% index_fields.each do |field| -%> <% end -%> <% end -%>
<%= render_head field %>Actions
<%= render_field record, field %> <%= link_to 'show', current_resource.path(record), :class => 'show_entry' if controller.show_fields || resource_children.present? %> <%= link_to 'edit', current_resource.edit_path(record), :class => 'edit_entry' if controller.update_fields || controller.form_fields %> <%= link_to 'destroy', current_resource.path(record), :confirm => "Are you sure?", :method => :delete, :class => 'remove_entry' if current_config.destroy %> <% current_resource.children(:post_id => record.id).each do |child| %> <% if child.plural? %>

<%= link_to "#{child.human}(#{child.collection.size})", child.index_path %>

<% else %>

<%= link_to "#{child.member ? 'Edit' : 'Add'} #{child.human}", child.index_path %>

<% end %> <% end %>
<% end %>
Search
<%= form_tag current_resource.index_path, {:method => :get} do %> <%= text_field_tag :query, resource_session[:query] %> <%= submit_tag 'Search' %> <% if resource_session[:query].present? %> <%= link_to 'clear', current_resource.index_path(:query => '') %> <% end %> <% end %>
<% index_fields.boolean.each do |field| %>
<%= field.label %>
    <% [['All', nil], ['Yes', '1'], ['No', '0'], ['Not set', 'nil']].each do |option| %>
  • <%= link_to_unless resource_session[:boolean][field.query_column] == option[1], option[0], current_resource.index_path(:boolean => { field.query_column => option[1]}) %>
  • <% end %>
<% end %>
<% if respond_to? :will_paginate %> <%= will_paginate @records, :url => current_resource.index_path(:page => '') %> <% end %> <% content_for :additional_navigation do %> <% end %>