From 84ecc6aed37bf51dbeebb1976e9729bcf7f8484f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Gaya?= <sebastien.gaya@gmail.com>
Date: Mon, 2 May 2022 16:31:01 +0200
Subject: [PATCH] fix

---
 .../admin/communication/website/posts_controller.rb          | 4 ++--
 app/views/admin/communication/website/posts/index.html.erb   | 5 +++++
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/app/controllers/admin/communication/website/posts_controller.rb b/app/controllers/admin/communication/website/posts_controller.rb
index f8c2cad42..ed0dc79e1 100644
--- a/app/controllers/admin/communication/website/posts_controller.rb
+++ b/app/controllers/admin/communication/website/posts_controller.rb
@@ -12,9 +12,9 @@ class Admin::Communication::Website::PostsController < Admin::Communication::Web
 
   def index
     @posts = apply_scopes(@posts).ordered.page params[:page]
-    @authors =  apply_scopes(@website.authors.accessible_by(current_ability))
+    @authors =  @website.authors.accessible_by(current_ability)
                                 .ordered
-                                .page(params[:page])
+                                .page(params[:authors_page])
     @root_categories = @website.categories.root.ordered
     breadcrumb
   end
diff --git a/app/views/admin/communication/website/posts/index.html.erb b/app/views/admin/communication/website/posts/index.html.erb
index 5688ab124..bdfc24a22 100644
--- a/app/views/admin/communication/website/posts/index.html.erb
+++ b/app/views/admin/communication/website/posts/index.html.erb
@@ -57,6 +57,11 @@
             <h2 class="card-title"><%= t('communication.authors', count: 2) %></h2>
           </div>
           <%= render 'admin/communication/website/authors/list', authors: @authors %>
+          <% if @authors.total_pages > 1 %>
+            <div class="card-footer">
+              <%= paginate @authors, theme: 'bootstrap-5', param_name: :authors_page %>
+            </div>
+          <% end %>
         </div>
       </div>
   </div>
-- 
GitLab