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:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-07-14 21:09:55 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-07-14 21:09:55 +0300
commit18ffa5e88194d8f3fd63bee0221de5bc1fbdfe94 (patch)
tree02a3b1d84d0dbe876dc16dcf7de381af88d5e879 /app/helpers/wiki_helper.rb
parent66bd1f0fdcaf84fa3412c70d7962b49eb8a48fde (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/helpers/wiki_helper.rb')
-rw-r--r--app/helpers/wiki_helper.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/app/helpers/wiki_helper.rb b/app/helpers/wiki_helper.rb
index c51dfefc0de..cf2d2d178e1 100644
--- a/app/helpers/wiki_helper.rb
+++ b/app/helpers/wiki_helper.rb
@@ -95,10 +95,13 @@ module WikiHelper
def wiki_empty_state_messages(wiki)
case wiki.container
when Project
+ writable_body = s_("WikiEmpty|A wiki is where you can store all the details about your project. This can include why you've created it, its principles, how to use it, and so on.")
+ writable_body += s_("WikiEmpty| Have a Confluence wiki already? Use that instead.") if show_enable_confluence_integration?(wiki.container)
+
{
writable: {
title: s_('WikiEmpty|The wiki lets you write documentation for your project'),
- body: s_("WikiEmpty|A wiki is where you can store all the details about your project. This can include why you've created it, its principles, how to use it, and so on.")
+ body: writable_body
},
issuable: {
title: s_('WikiEmpty|This project has no wiki pages'),
@@ -137,4 +140,10 @@ module WikiHelper
'wiki-directory-nest-level' => page.path.scan('/').count
}
end
+
+ def show_enable_confluence_integration?(container)
+ container.is_a?(Project) &&
+ current_user&.can?(:admin_project, container) &&
+ !container.has_confluence?
+ end
end