diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-02-17 16:59:50 +0100 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-02-24 15:07:24 +0100 |
commit | ad6d6232342558705c54ba70a94f9d7ddbd00f8c (patch) | |
tree | 2114eb91b0ddf6273909c364c1786747cd3d4827 /app/views | |
parent | 7561b1c2a486ae57e9fbebadadbe1269bfdba6a0 (diff) | |
download | gitlab-ce-ad6d6232342558705c54ba70a94f9d7ddbd00f8c.tar.gz |
Add Bitbucket importer.
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/import/base/create.js.haml | 7 | ||||
-rw-r--r-- | app/views/import/bitbucket/status.html.haml | 44 | ||||
-rw-r--r-- | app/views/import/github/status.html.haml | 2 | ||||
-rw-r--r-- | app/views/import/gitlab/status.html.haml | 2 | ||||
-rw-r--r-- | app/views/projects/_bitbucket_import_modal.html.haml | 9 | ||||
-rw-r--r-- | app/views/projects/new.html.haml | 13 |
6 files changed, 75 insertions, 2 deletions
diff --git a/app/views/import/base/create.js.haml b/app/views/import/base/create.js.haml index cd4c9fbf360..8ebdf4f1a20 100644 --- a/app/views/import/base/create.js.haml +++ b/app/views/import/base/create.js.haml @@ -10,9 +10,16 @@ target_field.append("/" + project_name) target_field.data("project_name", project_name) target_field.find('input').prop("value", origin_namespace) +- elsif @access_denied + :plain + job = $("tr#repo_#{@repo_id}") + job.find(".import-actions").html("<p class='alert alert-danger'>Access denied! Please verify you can add deploy keys to this repository.</p>"") - else :plain job = $("tr#repo_#{@repo_id}") job.attr("id", "project_#{@project.id}") + target_field = job.find(".import-target") + target_field.empty() + target_field.append('<strong>#{link_to @project.path_with_namespace, @project}</strong>') $("table.import-jobs tbody").prepend(job) job.addClass("active").find(".import-actions").html("<i class='fa fa-spinner fa-spin'></i> started") diff --git a/app/views/import/bitbucket/status.html.haml b/app/views/import/bitbucket/status.html.haml new file mode 100644 index 00000000000..7a2613e4b03 --- /dev/null +++ b/app/views/import/bitbucket/status.html.haml @@ -0,0 +1,44 @@ +%h3.page-title + %i.fa.fa-bitbucket + Import repositories from Bitbucket + +%p.light + Select projects you want to import. +%hr +%p + = button_tag 'Import all projects', class: "btn btn-success js-import-all" + +%table.table.import-jobs + %thead + %tr + %th From Bitbucket + %th To GitLab + %th Status + %tbody + - @already_added_projects.each do |project| + %tr{id: "project_#{project.id}", class: "#{project_status_css_class(project.import_status)}"} + %td= project.import_source + %td + %strong= link_to project.path_with_namespace, project + %td.job-status + - if project.import_status == 'finished' + %span.cgreen + %i.fa.fa-check + done + - elsif project.import_status == 'started' + %i.fa.fa-spinner.fa-spin + started + - else + = project.human_import_status_name + + - @repos.each do |repo| + %tr{id: "repo_#{repo["owner"]}___#{repo["slug"]}"} + %td= "#{repo["owner"]}/#{repo["slug"]}" + %td.import-target + = "#{repo["owner"]}/#{repo["slug"]}" + %td.import-actions.job-status + = button_tag "Import", class: "btn js-add-to-import" + +:coffeescript + $ -> + new ImporterStatus("#{jobs_import_bitbucket_path}", "#{import_bitbucket_path}") diff --git a/app/views/import/github/status.html.haml b/app/views/import/github/status.html.haml index 84d9903fe15..b1538b1a41e 100644 --- a/app/views/import/github/status.html.haml +++ b/app/views/import/github/status.html.haml @@ -1,6 +1,6 @@ %h3.page-title %i.fa.fa-github - Import repositories from GitHub.com + Import repositories from GitHub %p.light Select projects you want to import. diff --git a/app/views/import/gitlab/status.html.haml b/app/views/import/gitlab/status.html.haml index d1e48dfad20..43db102994f 100644 --- a/app/views/import/gitlab/status.html.haml +++ b/app/views/import/gitlab/status.html.haml @@ -1,5 +1,5 @@ %h3.page-title - %i.fa.fa-github + %i.fa.fa-heart Import repositories from GitLab.com %p.light diff --git a/app/views/projects/_bitbucket_import_modal.html.haml b/app/views/projects/_bitbucket_import_modal.html.haml new file mode 100644 index 00000000000..dd7aacc7e6e --- /dev/null +++ b/app/views/projects/_bitbucket_import_modal.html.haml @@ -0,0 +1,9 @@ +%div#bitbucket_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 Bitbucket first. + = link_to 'How to setup integration with Bitbucket', 'https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/integration/bitbucket.md'
\ No newline at end of file diff --git a/app/views/projects/new.html.haml b/app/views/projects/new.html.haml index 5216f308110..875c092fd1a 100644 --- a/app/views/projects/new.html.haml +++ b/app/views/projects/new.html.haml @@ -53,6 +53,19 @@ Import projects from GitHub = render 'github_import_modal' + .project-import.form-group + .col-sm-2 + .col-sm-10 + - if bitbucket_import_enabled? + = link_to status_import_bitbucket_path do + %i.fa.fa-bitbucket + Import projects from Bitbucket + - else + = link_to '#', class: 'how_to_import_link light' do + %i.fa.fa-bitbucket + Import projects from Bitbucket + = render 'bitbucket_import_modal' + - unless request.host == 'gitlab.com' .project-import.form-group .col-sm-2 |