Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/helpers/gitlab/external_wiki_helper.rb')
-rw-r--r--app/helpers/gitlab/external_wiki_helper.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/app/helpers/gitlab/external_wiki_helper.rb b/app/helpers/gitlab/external_wiki_helper.rb
new file mode 100644
index 00000000000..710cdc727d0
--- /dev/null
+++ b/app/helpers/gitlab/external_wiki_helper.rb
@@ -0,0 +1,13 @@
+module Gitlab
+ module ExternalWikiHelper
+ def get_project_wiki_path(project)
+ external_wiki_service = project.services.
+ select { |service| service.to_param == 'external_wiki' }.first
+ if external_wiki_service.present? && external_wiki_service.active?
+ external_wiki_service.properties['external_wiki_url']
+ else
+ namespace_project_wiki_path(project.namespace, project, :home)
+ end
+ end
+ end
+end