status.html.haml 3.6 KB
Newer Older
1 2 3
- page_title 'Bitbucket import'
- header_title 'Projects', root_path

D
Douwe Maan 已提交
4 5
%h3.page-title
  %i.fa.fa-bitbucket
D
Douwe Maan 已提交
6
  Import projects from Bitbucket
D
Douwe Maan 已提交
7

8 9 10 11 12 13
- if @repos.any?
  %p.light
    Select projects you want to import.
  %hr
  %p
  - if @incompatible_repos.any?
14
    = button_tag class: 'btn btn-import btn-success js-import-all' do
15
      Import all compatible projects
16
      = icon('spinner spin', class: 'loading-icon')
17
  - else
18
    = button_tag class: 'btn btn-import btn-success js-import-all' do
19
      Import all projects
20
      = icon('spinner spin', class: 'loading-icon')
21

22
.table-responsive
D
Douwe Maan 已提交
23
  %table.table.import-jobs
24 25 26
    %colgroup.import-jobs-from-col
    %colgroup.import-jobs-to-col
    %colgroup.import-jobs-status-col
D
Douwe Maan 已提交
27 28 29 30 31 32 33
    %thead
      %tr
        %th From Bitbucket
        %th To GitLab
        %th Status
    %tbody
      - @already_added_projects.each do |project|
34
        %tr{ id: "project_#{project.id}", class: "#{project_status_css_class(project.import_status)}" }
D
Douwe Maan 已提交
35
          %td
S
Stan Hu 已提交
36
            = link_to project.import_source, "https://bitbucket.org/#{project.import_source}", target: '_blank'
D
Douwe Maan 已提交
37
          %td
38
            = link_to project.path_with_namespace, [project.namespace.becomes(Namespace), project]
D
Douwe Maan 已提交
39 40 41 42 43 44 45 46 47 48
          %td.job-status
            - if project.import_status == 'finished'
              %span
                %i.fa.fa-check
                done
            - elsif project.import_status == 'started'
              %i.fa.fa-spinner.fa-spin
              started
            - else
              = project.human_import_status_name
D
Douwe Maan 已提交
49

D
Douwe Maan 已提交
50
      - @repos.each do |repo|
51
        %tr{ id: "repo_#{repo.owner}___#{repo.slug}" }
D
Douwe Maan 已提交
52
          %td
S
Stan Hu 已提交
53
            = link_to repo.full_name, "https://bitbucket.org/#{repo.full_name}", target: "_blank"
D
Douwe Maan 已提交
54
          %td.import-target
55 56 57 58 59 60 61 62 63 64 65
            %fieldset.row
            .input-group
              .project-path.input-group-btn
                - if current_user.can_select_namespace?
                  - selected = params[:namespace_id] || :current_user
                  - opts = current_user.can_create_group? ? { extra_group: Group.new(name: repo.owner, path: repo.owner) } : {}
                  = select_tag :namespace_id, namespaces_options(selected, opts.merge({ display_path: true })), { class: 'select2 js-select-namespace', tabindex: 1 }
                - else
                  = text_field_tag :path, current_user.namespace_path, class: "input-large form-control", tabindex: 1, disabled: true
              %span.input-group-addon /
              = text_field_tag :path, repo.name, class: "input-mini form-control", tabindex: 2, autofocus: true, required: true
D
Douwe Maan 已提交
66
          %td.import-actions.job-status
67
            = button_tag class: 'btn btn-import js-add-to-import' do
68
              Import
69
              = icon('spinner spin', class: 'loading-icon')
D
Douwe Maan 已提交
70
      - @incompatible_repos.each do |repo|
71
        %tr{ id: "repo_#{repo.owner}___#{repo.slug}" }
D
Douwe Maan 已提交
72
          %td
S
Stan Hu 已提交
73
            = link_to repo.full_name, "https://bitbucket.org/#{repo.full_name}", target: '_blank'
D
Douwe Maan 已提交
74 75
          %td.import-target
          %td.import-actions-job-status
76
            = label_tag 'Incompatible Project', nil, class: 'label label-danger'
77 78 79 80 81 82

- if @incompatible_repos.any?
  %p
    One or more of your Bitbucket projects cannot be imported into GitLab
    directly because they use Subversion or Mercurial for version control,
    rather than Git. Please convert
83
    = link_to 'them to Git,', 'https://www.atlassian.com/git/tutorials/migrating-overview'
84
    and go through the
B
Bryce Johnson 已提交
85
    = link_to 'import flow', status_import_bitbucket_path
86 87
    again.

88
.js-importer-status{ data: { jobs_import_path: "#{jobs_import_bitbucket_path}", import_path: "#{import_bitbucket_path}" } }