diff options
author | Igor <idrozdov@gitlab.com> | 2019-04-04 19:28:56 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2019-04-04 19:28:56 +0300 |
commit | 866b58a54e95415ad74b8f004db40abb4343c753 (patch) | |
tree | ed7436c916e4d3db48c255267255e9bbc4fbaa22 /app/controllers/projects/wikis_controller.rb | |
parent | 8647230fa509cbba8e1853aae500315bf1116005 (diff) |
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/projects/wikis_controller.rb')
-rw-r--r-- | app/controllers/projects/wikis_controller.rb | 5 |
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 |