<%= @model.title_plural %>
<%= link_to(collection_model_link(@application, @model, :destroy_all), :class => "btn btn-danger btn-remove-all-selected") do %>
Excluir Selecionados
<% end if @model.my_admin.can?(:destroy, my_admin_user) %>
<%= link_to(new_model_link(@application, @model), :class => "btn btn-success") do %>
Adicionar
<%#= I18n.t('my_admin.titles.models.new', :model => @model.title) %>
<% end if @model.my_admin.can?(:create, my_admin_user) %>
<%= link_to(collection_model_link(@application, @model, :export, params.clone), :class => "btn btn-inverse") do %>
<%= I18n.t('my_admin.titles.models.export', :model => @model.title) %>
<% end if @model.my_admin.can?(:export, my_admin_user) %>
<%= select_tag :per_page, options_for_select([10,20,50,100].map { |i| ["#{i} por página", model_link(@application, @model, params.clone.update({:per_page => i}))]}, model_link(@application, @model, params.clone.update({:per_page => params[:per_page]}))), :class => 'chosen-select', "data-nosearch" => true %>
<% if @model.my_admin.can?(:destroy, my_admin_user) %>
|
<% end %>
<% @model.my_admin.list_display.each do |field| %>
<% order = (params[:order_by] == field.to_s && params[:order] == "asc") ? "desc" : "asc" %>
<% if field_can_order(@application, @model, field) %>
">
<%= link_to( field_title(@model, field), model_link(@application, @model, params.clone.update({:order => order, :order_by => field}))) %>
|
<% else %>
<%= field_title(@model, field) %>
|
<% end %>
<% end %>
<%= render model_template(@application, @model, 'actions_header') %>
<% unless @objects.blank? %>
<% @objects.each do |object| %>
<% if @model.my_admin.can?(:destroy, my_admin_user) %>
<%= check_box_tag :remove, object.id %>
|
<% end %>
<% @model.my_admin.list_display.each_with_index do |field, index| %>
<%= field_content(@application, @model, field, object) %>
|
<% end %>
<%= render model_template(@application, @model, 'actions'), object: object %>
<% end %>
<% end %>
<%= render model_template(@application, @model, 'paginate') %>