summaryrefslogtreecommitdiff
path: root/app/views/import
diff options
context:
space:
mode:
authorEric K Idema <eki@vying.org>2016-05-02 11:22:38 -0400
committerRémy Coutable <remy@rymai.me>2016-06-30 18:48:17 +0200
commit12aa1f898dbfea3aaeb2de351ac1cccef304717f (patch)
tree86a15a55b4bd1666e7994d702a684589afa8efa4 /app/views/import
parentc5d164d1df46eb34668a032b234484f142e1a881 (diff)
downloadgitlab-ce-12aa1f898dbfea3aaeb2de351ac1cccef304717f.tar.gz
Import from Github using Personal Access Tokens.
This stands as an alternative to using OAuth to access a user's Github repositories. This is setup in such a way that it can be used without OAuth configuration. From a UI perspective, the how to import modal has been replaced by a full page, which includes a form for posting a personal access token back to the Import::GithubController. If the user has logged in via GitHub, skip the Personal Access Token and go directly to Github for an access token via OAuth.
Diffstat (limited to 'app/views/import')
-rw-r--r--app/views/import/github/new.html.haml37
1 files changed, 37 insertions, 0 deletions
diff --git a/app/views/import/github/new.html.haml b/app/views/import/github/new.html.haml
new file mode 100644
index 00000000000..b071d2214c2
--- /dev/null
+++ b/app/views/import/github/new.html.haml
@@ -0,0 +1,37 @@
+- page_title "GitHub Import"
+- header_title "Projects", root_path
+
+%h3.page-title
+ = icon 'github', text: 'Import Projects from GitHub'
+
+%p.light
+ To import a project from GitHub, you can use a
+ = link_to 'Personal Access Token', 'https://github.com/settings/tokens'
+ to access your GitHub account. 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 for import.
+
+= form_tag personal_access_token_import_github_path, method: :post, class: 'form-inline' do
+ .form-group
+ = text_field_tag :personal_access_token, '', class: 'form-control', placeholder: "Personal Access Token", size: 40
+ = submit_tag 'List Repositories', class: 'btn btn-create'
+
+- if github_import_configured?
+ - unless logged_in_with_github?
+ %hr
+ %p.light
+ Note: If you go to
+ = link_to 'your profile', profile_account_path
+ and connect your account to GitHub, you can import projects without
+ generating a Personal Access Token.
+- else
+ %hr
+ %p.light
+ Note:
+ - if current_user.admin?
+ As an administrator you may like to configure
+ - else
+ Consider asking your GitLab administrator to configure
+ = link_to 'GitHub integration', help_page_path("integration", "github")
+ which will allow login via GitHub and allow importing projects without
+ generating a Personal Access Token.