<% params = request.params.except(:action, :controller, :model_name) query = params[:query] filter = params[:filter] sort = params[:sort] sort_reverse = params[:sort_reverse] filters_exist = !@properties.select{|property| property[:type] == :boolean}.empty? %>
" id="changelist">
<% if filters_exist %>

Filter

<% @properties.each do |property| %> <% property_type = property[:type] %> <% property_name = property[:name] %> <% property_pretty_name = property[:pretty_name] %> <% if property_type == :boolean %>

By <%= property_pretty_name %>

  • "> <%= link_to("All", "?" + Merb::Parse.params_to_query_string(params.merge(:filter => (filter || {}).reject{|key, value| key.to_sym == property_name}))) %>
  • "> <%= link_to("Yes", "?" + Merb::Parse.params_to_query_string(params.merge(:filter => (filter || {}).merge({property_name => "true"})))) %>
  • "> <%= link_to("No", "?" + Merb::Parse.params_to_query_string(params.merge(:filter => (filter || {}).merge({property_name => "false"})))) %>
<% end %> <% end %>
<% end %> <% @properties.each do |property| %> <% property_name = property[:name] %> <% property_pretty_name = property[:pretty_name] %> <% end %> <% @objects.each_with_index do |object, index| %> "> <% @properties.each do |property| %> <% end %> <% end %>
"> <%= link_to(property_pretty_name, "?" + Merb::Parse.params_to_query_string(params.merge(:sort => property_name).reject{|key, value| key.to_sym == :sort_reverse}.merge(sort == property_name.to_s && sort_reverse != "true" ? {:sort_reverse => "true"} : {}))) %>
<%= link_to(object_property(object, property), url(:merb_admin_edit, :model_name => @abstract_model.to_param, :id => object.id)) %>

<% if @page_count.to_i > 1 %> <%= paginate(@current_page, @page_count, :url => "?" + Merb::Parse.params_to_query_string(params)) %> <% end %> <%= @record_count %> <%= @record_count == 1 ? @abstract_model.pretty_name.downcase : @abstract_model.pretty_name.downcase.pluralize %> <% if @page_count.to_i == 2 %> <%= link_to("Show all", "?" + Merb::Parse.params_to_query_string(params.merge(:all => true)), :class => "showall") %> <% end %>