From 5a72c19e5dee8a775e5d79edf6e7a79590502342 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 26 Oct 2019 07:09:52 +0000 Subject: [PATCH] Don't paginate the board view for now (#29482). Subprojects may appear as root projects if their parents are on a previous page. git-svn-id: http://svn.redmine.org/redmine/trunk@18866 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/projects_controller.rb | 11 ++++++++--- app/views/projects/_list.html.erb | 1 + app/views/projects/index.html.erb | 1 - 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 2e4fc5303..c5c98d6fd 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -52,9 +52,14 @@ class ProjectsController < ApplicationController respond_to do |format| format.html { - @entry_count = scope.count - @entry_pages = Paginator.new @entry_count, per_page_option, params['page'] - @entries = scope.offset(@entry_pages.offset).limit(@entry_pages.per_page).to_a + # TODO: see what to do with the board view and pagination + if @query.display_type == 'board' + @entries = scope.to_a + else + @entry_count = scope.count + @entry_pages = Paginator.new @entry_count, per_page_option, params['page'] + @entries = scope.offset(@entry_pages.offset).limit(@entry_pages.per_page).to_a + end } format.api { @offset, @limit = api_offset_and_limit diff --git a/app/views/projects/_list.html.erb b/app/views/projects/_list.html.erb index 8a1efc204..298ec8ca7 100644 --- a/app/views/projects/_list.html.erb +++ b/app/views/projects/_list.html.erb @@ -33,3 +33,4 @@ +<%= pagination_links_full @entry_pages, @entry_count %> diff --git a/app/views/projects/index.html.erb b/app/views/projects/index.html.erb index 067c9bdee..59fc4e6e2 100644 --- a/app/views/projects/index.html.erb +++ b/app/views/projects/index.html.erb @@ -15,7 +15,6 @@

<%= l(:label_no_data) %>

<% else %> <%= render :partial => @query.display_type, :locals => { :entries => @entries }%> - <%= pagination_links_full @entry_pages, @entry_count %> <% end %> <% end %> -- 2.39.5