<%# # Collection This partial is used on the `index` and `show` pages to display a collection of resources in an HTML table. ## Local variables: - `collection_presenter`: An instance of [Administrate::Page::Collection][1]. The table presenter uses `ResourceDashboard::COLLECTION_ATTRIBUTES` to determine the columns displayed in the table - `resources`: An ActiveModel::Relation collection of resources to be displayed in the table. By default, the number of resources is limited by pagination or by a hard limit to prevent excessive page load times [1]: http://www.rubydoc.info/gems/administrate/Administrate/Page/Collection %>
<%= form_with(url: manager_outdated_procedures_path, method: :get) do |f| %>

Nombre de démarches sans auto archivage des dossiers: <%= @records_per_page %>

Nombre de dossiers archivable parmis ces démarches: <%= resources.sum(&:dossiers_close_to_expiration) %>

<%= f.select :records_per_page, options_for_select([["10", "10"], ["100", "100"], ["1000", "1000"]], @records_per_page) %> <%= f.submit "Mettre a jour le nombre de démarche a archiver", class: 'button button--nav' %> <% end %>
<%= form_with(url: bulk_update_manager_outdated_procedures_path, method: :patch) do |f| %> <% collection_presenter.attribute_types.each do |attr_name, attr_type| %> <% end %> <% [valid_action?(:edit, collection_presenter.resource_name), valid_action?(:destroy, collection_presenter.resource_name)].count(true).times do %> <% end %> <% resources.each do |resource| %> <%= %(tabindex=0 role=link data-url=#{polymorphic_path([namespace, resource])}) %> <% end %> > <% collection_presenter.attributes_for(resource).each do |attribute| %> <% end %> <% if valid_action? :edit, collection_presenter.resource_name %> <% end %> <% if valid_action? :destroy, collection_presenter.resource_name %> <% end %> <% end %>
<%= link_to(sanitized_order_params(page, collection_field_name).merge( collection_presenter.order_params_for(attr_name, key: collection_field_name) )) do %> <%= t( "helpers.label.#{collection_presenter.resource_name}.#{attr_name}", default: resource_class.human_attribute_name(attr_name), ).titleize %> <% if collection_presenter.ordered_by?(attr_name) %> <% end %> <% end %>
<%= f.check_box "procedure[ids][#{resource.id}]", checked: false %> <% if show_action? :show, resource -%> <%= render_field attribute %> <% else %> <%= render_field attribute %> <% end -%> <%= link_to( t("administrate.actions.edit"), [:edit, namespace, resource], class: "action-edit", ) if show_action? :edit, resource%><%= link_to( t("administrate.actions.destroy"), [namespace, resource], class: "text-color-red", method: :delete, data: { confirm: t("administrate.actions.confirm") } ) if show_action? :destroy, resource %>
<%= f.submit "Activer l'archivage automatique des démarches sélectionnée" %> <% end %>