summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-01-22 11:48:20 -0800
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-01-22 19:00:31 -0800
commit4e7de9492fcc73f3c9db013a382bd3785ab9fd38 (patch)
treec1af5ca716fb3e57694bcfc7b398e8a5e60ea681
parentc04f11dab5b8890278f9fe3b47729353cded1c54 (diff)
downloadgitlab-ce-4e7de9492fcc73f3c9db013a382bd3785ab9fd38.tar.gz
Show modal window with instructions if GH OAuth is not enables
-rw-r--r--app/views/projects/_github_import_modal.html.haml22
-rw-r--r--app/views/projects/new.html.haml13
2 files changed, 31 insertions, 4 deletions
diff --git a/app/views/projects/_github_import_modal.html.haml b/app/views/projects/_github_import_modal.html.haml
new file mode 100644
index 00000000000..02c9ef45f2b
--- /dev/null
+++ b/app/views/projects/_github_import_modal.html.haml
@@ -0,0 +1,22 @@
+%div#github_import_modal.modal.hide
+ .modal-dialog
+ .modal-content
+ .modal-header
+ %a.close{href: "#", "data-dismiss" => "modal"} ×
+ %h3 GitHub OAuth import
+ .modal-body
+ You need to setup integration with GitHub first.
+ = link_to 'How to setup integration with GitHub', 'https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/integration/github.md'
+
+
+:javascript
+ $(function(){
+ var import_modal = $('#github_import_modal').modal({modal: true, show:false});
+ $('.how_to_import_link').bind("click", function(e){
+ e.preventDefault();
+ import_modal.show();
+ });
+ $('.modal-header .close').bind("click", function(){
+ import_modal.hide();
+ })
+ })
diff --git a/app/views/projects/new.html.haml b/app/views/projects/new.html.haml
index ccd02acd761..3e0f9cbd80b 100644
--- a/app/views/projects/new.html.haml
+++ b/app/views/projects/new.html.haml
@@ -40,13 +40,18 @@
The import will time out after 4 minutes. For big repositories, use a clone/push combination.
For SVN repositories, check #{link_to "this migrating from SVN doc.", "http://doc.gitlab.com/ce/workflow/migrating_from_svn.html"}
- - if github_import_enabled?
- .project-import.form-group
- .col-sm-2
- .col-sm-10
+ .project-import.form-group
+ .col-sm-2
+ .col-sm-10
+ - if github_import_enabled?
= link_to status_github_import_path do
%i.fa.fa-github
Import projects from GitHub
+ - else
+ = link_to '#', class: 'how_to_import_link light' do
+ %i.fa.fa-github
+ Import projects from GitHub
+ = render 'github_import_modal'
%hr.prepend-botton-10