summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorIgor <idrozdov@gitlab.com>2019-04-04 16:28:56 +0000
committerDouwe Maan <douwe@gitlab.com>2019-04-04 16:28:56 +0000
commit866b58a54e95415ad74b8f004db40abb4343c753 (patch)
treeed7436c916e4d3db48c255267255e9bbc4fbaa22 /app/controllers
parent8647230fa509cbba8e1853aae500315bf1116005 (diff)
downloadgitlab-ce-866b58a54e95415ad74b8f004db40abb4343c753.tar.gz
Allow to sort wiki pages by date and title
- Add controls for sorting by title and date - Execute Gitaly call which now accepts sorting params for wikis
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/projects/wikis_controller.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/controllers/projects/wikis_controller.rb b/app/controllers/projects/wikis_controller.rb
index da2420633ef..88910c91763 100644
--- a/app/controllers/projects/wikis_controller.rb
+++ b/app/controllers/projects/wikis_controller.rb
@@ -16,7 +16,10 @@ class Projects::WikisController < Projects::ApplicationController
end
def pages
- @wiki_pages = Kaminari.paginate_array(@project_wiki.pages).page(params[:page])
+ @wiki_pages = Kaminari.paginate_array(
+ @project_wiki.pages(sort: params[:sort], direction: params[:direction])
+ ).page(params[:page])
+
@wiki_entries = WikiPage.group_by_directory(@wiki_pages)
end