summaryrefslogtreecommitdiff
path: root/app/controllers/projects/wikis_controller.rb
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2017-11-17 14:47:42 +0000
committerFilipa Lacerda <filipa@gitlab.com>2017-11-17 14:47:48 +0000
commit2686626dbf0479bd829f9f89114ec53704fc5444 (patch)
tree618d3434c3a9f3ceda9a2e4eb865712299bb9ed1 /app/controllers/projects/wikis_controller.rb
parent9a826fcd31430fcaec95cd31755a5712a9504833 (diff)
parente68ee8af4d981cb7b83fae76c0a94059add495fb (diff)
downloadgitlab-ce-36400-trigger-job.tar.gz
[ci skip] Merge branch 'master' into 36400-trigger-job36400-trigger-job
* master: (21 commits) Changing OAuth lookup to be case insensitive Delete orphaned fork networks in a migration Delete the fork network when removing the last membership Resolve "Performance issues when loading large number of wiki pages" Exports a couple of project related code as es6 modules Fix go-import meta data when enabled_git_access_protocol is a blank string Add dropdowns documentation Convert migration to populate latest merge request ID into a background migration Set 0.69.0 instead of latest for codeclimate image Fix hashed storage with project transfers to another namespace De-duplicate background migration matchers defined in spec/support/migrations_helpers.rb Update database_debugging.md Update database_debugging.md Move installation of apps higher Change to Google Kubernetes Cluster and add internal links Add Ingress description from official docs Add info on creating your own k8s cluster from the cluster page Add info about the installed apps in the Cluster docs Update HA README.md to clarify GitLab support does not troubleshoot DRBD. Optimise getting the pipeline status of commits ...
Diffstat (limited to 'app/controllers/projects/wikis_controller.rb')
-rw-r--r--app/controllers/projects/wikis_controller.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/controllers/projects/wikis_controller.rb b/app/controllers/projects/wikis_controller.rb
index f7a9c98629d..b51261a49e0 100644
--- a/app/controllers/projects/wikis_controller.rb
+++ b/app/controllers/projects/wikis_controller.rb
@@ -74,7 +74,11 @@ class Projects::WikisController < Projects::ApplicationController
def history
@page = @project_wiki.find_page(params[:id])
- unless @page
+ if @page
+ @page_versions = Kaminari.paginate_array(@page.versions(page: params[:page]),
+ total_count: @page.count_versions)
+ .page(params[:page])
+ else
redirect_to(
project_wiki_path(@project, :home),
notice: "Page not found"
@@ -101,7 +105,7 @@ class Projects::WikisController < Projects::ApplicationController
# Call #wiki to make sure the Wiki Repo is initialized
@project_wiki.wiki
- @sidebar_wiki_entries = WikiPage.group_by_directory(@project_wiki.pages.first(15))
+ @sidebar_wiki_entries = WikiPage.group_by_directory(@project_wiki.pages(limit: 15))
rescue ProjectWiki::CouldNotCreateWikiError
flash[:notice] = "Could not create Wiki Repository at this time. Please try again later."
redirect_to project_path(@project)