remove unused kaminari stuff

This commit is contained in:
simon lehericey 2021-04-25 21:29:31 +02:00
parent db23a853a9
commit 22811e1cc2
2 changed files with 5 additions and 31 deletions

View file

@ -101,18 +101,12 @@ module Instructeurs
page = params[:page].presence || 1
filtered_sorted_paginated_ids = Kaminari
@filtered_sorted_paginated_ids = Kaminari
.paginate_array(filtered_sorted_ids)
.page(page)
.per(ITEMS_PER_PAGE)
@dossiers = @dossiers.where(id: filtered_sorted_paginated_ids)
@dossiers = @dossiers.sort_by { |d| filtered_sorted_paginated_ids.index(d.id) }
@projected_dossiers = DossierProjectionService.project(filtered_sorted_paginated_ids, procedure_presentation.displayed_fields)
kaminarize(page, filtered_sorted_ids.count)
@projected_dossiers = DossierProjectionService.project(@filtered_sorted_paginated_ids, procedure_presentation.displayed_fields)
assign_exports
end
@ -286,25 +280,5 @@ module Instructeurs
def current_filters
@current_filters ||= procedure_presentation.filters[statut]
end
def kaminarize(current_page, total)
@dossiers.instance_eval <<-EVAL
def current_page
#{current_page}
end
def total_pages
(#{total} / #{ITEMS_PER_PAGE}.to_f).ceil
end
def limit_value
#{ITEMS_PER_PAGE}
end
def first_page?
current_page == 1
end
def last_page?
current_page == total_pages
end
EVAL
end
end
end

View file

@ -75,8 +75,8 @@
%span.icon.delete
Afficher les dossiers supprimés
- if @dossiers.present? || @current_filters.count > 0
= paginate @dossiers
- if @filtered_sorted_paginated_ids.present? || @current_filters.count > 0
= paginate @filtered_sorted_paginated_ids
%span.dropdown
%button.button.dropdown-button{ 'aria-expanded' => 'false', 'aria-controls' => 'filter-menu' }
Filtrer
@ -151,6 +151,6 @@
%a.cell-link{ href: path }= status_badge(dossier.state)
%td.action-col.follow-col= render partial: 'dossier_actions', locals: { procedure: @procedure, dossier: dossier, dossier_is_followed: @followed_dossiers_id.include?(dossier.id) }
= paginate @dossiers
= paginate @filtered_sorted_paginated_ids
- else
%h2.empty-text Aucun dossier