diff --git a/app/controllers/instructeurs/procedures_controller.rb b/app/controllers/instructeurs/procedures_controller.rb index 504cf671a..172891bc8 100644 --- a/app/controllers/instructeurs/procedures_controller.rb +++ b/app/controllers/instructeurs/procedures_controller.rb @@ -63,7 +63,7 @@ module Instructeurs @can_download_dossiers = (@counts[:tous] + @counts[:archives]) > 0 dossiers = Dossier.where(groupe_instructeur_id: groupe_instructeur_ids) - @dossiers_count = @counts[statut.underscore.to_sym] + dossiers_count = @counts[statut.underscore.to_sym] @followed_dossiers_id = current_instructeur .followed_dossiers @@ -76,10 +76,11 @@ module Instructeurs @has_termine_notifications = notifications[:termines].present? @not_archived_notifications_dossier_ids = notifications[:en_cours] + notifications[:termines] - filtered_sorted_ids = procedure_presentation.filtered_sorted_ids(dossiers, statut, count: @dossiers_count) + filtered_sorted_ids = procedure_presentation.filtered_sorted_ids(dossiers, statut, count: dossiers_count) page = params[:page].presence || 1 + @dossiers_count = filtered_sorted_ids.size @filtered_sorted_paginated_ids = Kaminari .paginate_array(filtered_sorted_ids) .page(page) diff --git a/app/views/instructeurs/procedures/show.html.haml b/app/views/instructeurs/procedures/show.html.haml index 213c33151..feae02087 100644 --- a/app/views/instructeurs/procedures/show.html.haml +++ b/app/views/instructeurs/procedures/show.html.haml @@ -58,8 +58,9 @@ .flex .flex-grow = render partial: "dossiers_filter", locals: { procedure: @procedure, procedure_presentation: @procedure_presentation, current_filters: @current_filters, statut: @statut, displayed_fields_options: @displayed_fields_options } - .dossiers-export - = render partial: "dossiers_export", locals: { procedure: @procedure, exports: @exports, statut: @statut, count: @dossiers_count } + - if @dossiers_count > 0 + .dossiers-export + = render partial: "dossiers_export", locals: { procedure: @procedure, exports: @exports, statut: @statut, count: @dossiers_count } %table.table.dossiers-table.hoverable %thead