diff options
Diffstat (limited to 'app/helpers/import_helper.rb')
-rw-r--r-- | app/helpers/import_helper.rb | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/app/helpers/import_helper.rb b/app/helpers/import_helper.rb index b484a868f92..9149d79ecb8 100644 --- a/app/helpers/import_helper.rb +++ b/app/helpers/import_helper.rb @@ -36,6 +36,42 @@ module ImportHelper _('Please wait while we import the repository for you. Refresh at will.') end + def import_github_title + _('Import repositories from GitHub') + end + + def import_github_authorize_message + _('To import GitHub repositories, you first need to authorize GitLab to access the list of your GitHub repositories:') + end + + def import_github_personal_access_token_message + personal_access_token_link = link_to _('Personal Access Token'), 'https://github.com/settings/tokens' + + if github_import_configured? + _('Alternatively, you can use a %{personal_access_token_link}. When you create your Personal Access Token, you will need to select the <code>repo</code> scope, so we can display a list of your public and private repositories which are available to import.').html_safe % { personal_access_token_link: personal_access_token_link } + else + _('To import GitHub repositories, you can use a %{personal_access_token_link}. When you create your Personal Access Token, you will need to select the <code>repo</code> scope, so we can display a list of your public and private repositories which are available to import.').html_safe % { personal_access_token_link: personal_access_token_link } + end + end + + def import_configure_github_admin_message + github_integration_link = link_to 'GitHub integration', help_page_path('integration/github') + + if current_user.admin? + _('Note: As an administrator you may like to configure %{github_integration_link}, which will allow login via GitHub and allow importing repositories without generating a Personal Access Token.').html_safe % { github_integration_link: github_integration_link } + else + _('Note: Consider asking your GitLab administrator to configure %{github_integration_link}, which will allow login via GitHub and allow importing repositories without generating a Personal Access Token.').html_safe % { github_integration_link: github_integration_link } + end + end + + def import_githubish_choose_repository_message + _('Choose which repositories you want to import.') + end + + def import_all_githubish_repositories_button_label + _('Import all repositories') + end + private def github_project_url(full_path) |