From 2737a8d52997f691d0341f24d80ec6b231a9202a Mon Sep 17 00:00:00 2001 From: Mathieu Magnin Date: Thu, 21 Sep 2017 16:47:43 +0200 Subject: [PATCH] Add pagination on dossiers list --- app/controllers/new_gestionnaire/procedures_controller.rb | 2 ++ app/views/new_gestionnaire/procedures/show.html.haml | 1 + 2 files changed, 3 insertions(+) diff --git a/app/controllers/new_gestionnaire/procedures_controller.rb b/app/controllers/new_gestionnaire/procedures_controller.rb index ab78a563b..6aa514c45 100644 --- a/app/controllers/new_gestionnaire/procedures_controller.rb +++ b/app/controllers/new_gestionnaire/procedures_controller.rb @@ -63,6 +63,8 @@ module NewGestionnaire when 'archives' @archived_dossiers end + + @dossiers = @dossiers.page([params[:page].to_i, 1].max) end private diff --git a/app/views/new_gestionnaire/procedures/show.html.haml b/app/views/new_gestionnaire/procedures/show.html.haml index 5bd179d12..f2498d451 100644 --- a/app/views/new_gestionnaire/procedures/show.html.haml +++ b/app/views/new_gestionnaire/procedures/show.html.haml @@ -73,5 +73,6 @@ = link_to(dossier_path(@procedure, dossier), class: 'cell-link') do = render partial: 'status', locals: { dossier: dossier } %td.follow-col= render partial: 'dossier_actions', locals: { procedure: @procedure, dossier: dossier, dossier_is_followed: @followed_dossiers_id.include?(dossier.id) } + = paginate @dossiers - else %h2.empty-text Aucun dossier