<% 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 %>
" type="search" value="<%= query %>" />
<% end %> <% 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 = (sort_reverse ? "headerSortUp" : "headerSortDown" if selected) %> <% 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"} : {})) %> <% end %> <% @history.each_with_index do |object, index| %> <% unless object.created_at.nil? %> <% end %> <% if @general %> <% if o = @abstract_model.get(object.item) %> <% label = o.send(@abstract_model.config.object_label_method) %> <% if show_action = action(:show, @abstract_model, o) %> <% else %> <% end %> <% else %> <% end %> <% end %> <% end %>
<%= column[:link_text] %>
<%= l(object.created_at, format: :long, default: l(object.created_at, format: :long)) %> <%= object.username %> <%= link_to(label, url_for(action: show_action.action_name, model_name: @abstract_model.to_param, id: o.id)) %> <%= label %> <%= "#{@abstract_model.config.label} ##{object.item}" %> <%= object.message.in?(['delete', 'new']) ? t("admin.actions.#{object.message}.done").capitalize : object.message %>
<% unless params[:all] || !@history.respond_to?(:current_page) %> <%= paginate(@history, theme: 'ra-twitter-bootstrap') %> <%= link_to(t("admin.misc.show_all"), send(path_method, params.merge(all: true)), class: "show-all btn btn-light") unless (tc = @history.total_count) <= @history.size || tc > 100 %> <% end %>