diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-01-22 22:48:20 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-01-22 22:48:20 +0300 |
commit | 130663e7ad099f057c19df9a024e029e182501d8 (patch) | |
tree | 504027beb1cdbc96dc6b43cef72685fdd9756245 /app/views | |
parent | a5f1b67ed4d5c46d1c243260cbfe86733fee075e (diff) |
Show modal window with instructions if GH OAuth is not enables
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/projects/_github_import_modal.html.haml | 22 | ||||
-rw-r--r-- | app/views/projects/new.html.haml | 13 |
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 |