summaryrefslogtreecommitdiff
path: root/app/helpers/projects_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/helpers/projects_helper.rb')
-rw-r--r--app/helpers/projects_helper.rb21
1 files changed, 14 insertions, 7 deletions
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb
index 6098ef63ec3..8a75f545a32 100644
--- a/app/helpers/projects_helper.rb
+++ b/app/helpers/projects_helper.rb
@@ -160,7 +160,7 @@ module ProjectsHelper
end
def link_to_autodeploy_doc
- link_to _('About auto deploy'), help_page_path('topics/autodevops/stages.md', anchor: 'auto-deploy'), target: '_blank'
+ link_to _('About auto deploy'), help_page_path('topics/autodevops/stages.md', anchor: 'auto-deploy'), target: '_blank', rel: 'noopener'
end
def autodeploy_flash_notice(branch_name)
@@ -431,19 +431,26 @@ module ProjectsHelper
end
def import_from_bitbucket_message
- link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: help_page_path("integration/bitbucket") }
+ configure_oauth_import_message('Bitbucket', help_page_path("integration/bitbucket"))
+ end
+
+ def import_from_gitlab_message
+ configure_oauth_import_message('GitLab.com', help_page_path("integration/gitlab"))
+ end
+ private
+
+ def configure_oauth_import_message(provider, help_url)
str = if current_user.admin?
- 'ImportProjects|To enable importing projects from Bitbucket, as administrator you need to configure %{link_start}OAuth integration%{link_end}'
+ 'ImportProjects|To enable importing projects from %{provider}, as administrator you need to configure %{link_start}OAuth integration%{link_end}'
else
- 'ImportProjects|To enable importing projects from Bitbucket, ask your GitLab administrator to configure %{link_start}OAuth integration%{link_end}'
+ 'ImportProjects|To enable importing projects from %{provider}, ask your GitLab administrator to configure %{link_start}OAuth integration%{link_end}'
end
- s_(str).html_safe % { link_start: link_start, link_end: '</a>'.html_safe }
+ link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: help_url }
+ s_(str).html_safe % { provider: provider, link_start: link_start, link_end: '</a>'.html_safe }
end
- private
-
def tab_ability_map
{
cycle_analytics: :read_cycle_analytics,