- params = request.params.except(:action, :controller, :model_name) - query = params[:query] - filter = params[:filter] - sort = params[:sort] - sort_reverse = params[:sort_reverse] - path_method = params[:id] ? "history_show_path" : "history_index_path" = form_tag("", :method => "get", :class => "search form-inline") do .well %input{:name => "query", :type => "search", :value => query, :placeholder => "#{t("admin.misc.filter")}", :class => 'input-small'} %button.btn.btn-primary{:type => "submit", :'data-disable-with' => " ".html_safe + t("admin.misc.refresh")} %i.icon-white.icon-refresh = t("admin.misc.refresh") %table#history.table.table-striped.table-condensed %thead %tr - columns = [] - columns << { :property_name => "created_at", :css_class => "created_at",:link_text => t('admin.table_headers.created_at') } - columns << { :property_name => "username", :css_class => "username", :link_text => t('admin.table_headers.username') } - columns << { :property_name => "item", :css_class => "item", :link_text => t('admin.table_headers.item') } if @general - columns << { :property_name => "message", :css_class => "message", :link_text => t('admin.table_headers.message') } - columns.each do |column| - property_name = column[:property_name] - selected = (sort == property_name) - sort_direction = selected ? (sort_reverse ? "headerSortUp" : "headerSortDown") : nil - sort_location = send(path_method, params.except("sort_reverse").merge(:model_name => @abstract_model.to_param, :sort => property_name).merge(selected && sort_reverse != "true" ? {:sort_reverse => "true"} : {})) %th{:class => "header #{column[:css_class]} #{sort_direction if selected}", :'data-href' => sort_location}= column[:link_text] %tbody - @history.each_with_index do |object, index| %tr - unless object.created_at.nil? %td= l(object.created_at, :format => :long, :default => l(object.created_at, :format => :long, :locale => :en)) %td= object.username - if @general %td= object.item %td= object.message - unless params[:all] || !@history.respond_to?(:current_page) = paginate(@history, :theme => 'twitter-bootstrap') = link_to(t("admin.misc.show_all"), send(path_method, params.merge(:all => true)), :class => "show-all btn") unless (tc = @history.total_count) <= @history.size || tc > 100