diff options
author | Douwe Maan <douwe@gitlab.com> | 2016-03-10 17:40:15 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2016-03-10 17:40:15 +0000 |
commit | 8ecdc0a7de05d81247f2892c7d7e2850ea5f811d (patch) | |
tree | 00f28c5180b30bdf0ad4bdb6a3a50267e97324e8 | |
parent | 34bbd7109c016edf5e8773baf83c381213ddca1a (diff) | |
parent | 449954ecc2ad0c1796b2949b79b56329c6ce2447 (diff) | |
download | gitlab-ce-8ecdc0a7de05d81247f2892c7d7e2850ea5f811d.tar.gz |
Merge branch 'fix-filtered-pagination' into 'master'
Allow filtered explore results to be paged. Fixes #14104
See merge request !3149
-rw-r--r-- | CHANGELOG | 1 | ||||
-rw-r--r-- | app/controllers/dashboard/projects_controller.rb | 4 | ||||
-rw-r--r-- | app/controllers/explore/projects_controller.rb | 6 |
3 files changed, 6 insertions, 5 deletions
diff --git a/CHANGELOG b/CHANGELOG index 1c27c3388cf..f8d86a643c5 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -25,6 +25,7 @@ v 8.6.0 (unreleased) - Show labels in dashboard and group milestone views - Add main language of a project in the list of projects (Tiago Botelho) - Add ability to show archived projects on dashboard, explore and group pages + - Fix pagination for filtered dashboard and explore pages v 8.5.5 - Ensure removing a project removes associated Todo entries. diff --git a/app/controllers/dashboard/projects_controller.rb b/app/controllers/dashboard/projects_controller.rb index fc51c3241af..0e8b63872ca 100644 --- a/app/controllers/dashboard/projects_controller.rb +++ b/app/controllers/dashboard/projects_controller.rb @@ -8,7 +8,7 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController @projects = filter_projects(@projects) @projects = @projects.includes(:namespace) @projects = @projects.sort(@sort = params[:sort]) - @projects = @projects.page(params[:page]).per(PER_PAGE) if params[:filter_projects].blank? + @projects = @projects.page(params[:page]).per(PER_PAGE) @last_push = current_user.recent_push @@ -32,7 +32,7 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController @projects = filter_projects(@projects) @projects = @projects.includes(:namespace, :forked_from_project, :tags) @projects = @projects.sort(@sort = params[:sort]) - @projects = @projects.page(params[:page]).per(PER_PAGE) if params[:filter_projects].blank? + @projects = @projects.page(params[:page]).per(PER_PAGE) @last_push = current_user.recent_push @groups = [] diff --git a/app/controllers/explore/projects_controller.rb b/app/controllers/explore/projects_controller.rb index 5b811db3068..8271ca87436 100644 --- a/app/controllers/explore/projects_controller.rb +++ b/app/controllers/explore/projects_controller.rb @@ -8,7 +8,7 @@ class Explore::ProjectsController < Explore::ApplicationController @projects = @projects.where(visibility_level: params[:visibility_level]) if params[:visibility_level].present? @projects = filter_projects(@projects) @projects = @projects.sort(@sort = params[:sort]) - @projects = @projects.includes(:namespace).page(params[:page]).per(PER_PAGE) if params[:filter_projects].blank? + @projects = @projects.includes(:namespace).page(params[:page]).per(PER_PAGE) respond_to do |format| format.html @@ -23,7 +23,7 @@ class Explore::ProjectsController < Explore::ApplicationController def trending @projects = TrendingProjectsFinder.new.execute(current_user) @projects = filter_projects(@projects) - @projects = @projects.page(params[:page]).per(PER_PAGE) if params[:filter_projects].blank? + @projects = @projects.page(params[:page]).per(PER_PAGE) respond_to do |format| format.html @@ -39,7 +39,7 @@ class Explore::ProjectsController < Explore::ApplicationController @projects = ProjectsFinder.new.execute(current_user) @projects = filter_projects(@projects) @projects = @projects.reorder('star_count DESC') - @projects = @projects.page(params[:page]).per(PER_PAGE) if params[:filter_projects].blank? + @projects = @projects.page(params[:page]).per(PER_PAGE) respond_to do |format| format.html |