status.html.haml 3.98 KB
Newer Older
1 2
- page_title _('Bitbucket import')
- header_title _('Projects'), root_path
3

Douwe Maan's avatar
Douwe Maan committed
4 5
%h3.page-title
  %i.fa.fa-bitbucket
6
  = _('Import projects from Bitbucket')
Douwe Maan's avatar
Douwe Maan committed
7

8 9
- if @repos.any?
  %p.light
10
    = _('Select projects you want to import.')
11 12 13
  %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
Douwe Maan's avatar
Douwe Maan committed
23
  %table.table.import-jobs
24 25 26
    %colgroup.import-jobs-from-col
    %colgroup.import-jobs-to-col
    %colgroup.import-jobs-status-col
Douwe Maan's avatar
Douwe Maan committed
27 28
    %thead
      %tr
29 30 31
        %th= _('From Bitbucket')
        %th= _('To GitLab')
        %th= _('Status')
Douwe Maan's avatar
Douwe Maan committed
32 33
    %tbody
      - @already_added_projects.each do |project|
34
        %tr{ id: "project_#{project.id}", class: "#{project_status_css_class(project.import_status)}" }
Douwe Maan's avatar
Douwe Maan committed
35
          %td
36
            = link_to project.import_source, "https://bitbucket.org/#{project.import_source}", target: '_blank', rel: 'noopener noreferrer'
Douwe Maan's avatar
Douwe Maan committed
37
          %td
38
            = link_to project.full_path, [project.namespace.becomes(Namespace), project]
Douwe Maan's avatar
Douwe Maan committed
39 40 41 42
          %td.job-status
            - if project.import_status == 'finished'
              %span
                %i.fa.fa-check
43
                = _('done')
Douwe Maan's avatar
Douwe Maan committed
44 45
            - elsif project.import_status == 'started'
              %i.fa.fa-spinner.fa-spin
46
              = _('started')
Douwe Maan's avatar
Douwe Maan committed
47 48
            - else
              = project.human_import_status_name
Douwe Maan's avatar
Douwe Maan committed
49

Douwe Maan's avatar
Douwe Maan committed
50
      - @repos.each do |repo|
51
        %tr{ id: "repo_#{repo.owner}___#{repo.slug}" }
Douwe Maan's avatar
Douwe Maan committed
52
          %td
53
            = link_to repo.full_name, "https://bitbucket.org/#{repo.full_name}", target: '_blank', rel: 'noopener noreferrer'
Douwe Maan's avatar
Douwe Maan committed
54
          %td.import-target
55 56
            %fieldset.row
            .input-group
57
              .project-path.input-group-prepend
58 59 60 61 62 63
                - 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: 'input-group-text select2 js-select-namespace', tabindex: 1 }
                - else
                  = text_field_tag :path, current_user.namespace_path, class: "input-group-text input-large form-control", tabindex: 1, disabled: true
64 65
              %span.input-group-prepend
                .input-group-text /
66
              = text_field_tag :path, repo.name, class: "input-mini form-control", tabindex: 2, autofocus: true, required: true
Douwe Maan's avatar
Douwe Maan committed
67
          %td.import-actions.job-status
68
            = button_tag class: 'btn btn-import js-add-to-import' do
69
              = _('Import')
70
              = icon('spinner spin', class: 'loading-icon')
Douwe Maan's avatar
Douwe Maan committed
71
      - @incompatible_repos.each do |repo|
72
        %tr{ id: "repo_#{repo.owner}___#{repo.slug}" }
Douwe Maan's avatar
Douwe Maan committed
73
          %td
74
            = link_to repo.full_name, "https://bitbucket.org/#{repo.full_name}", target: '_blank', rel: 'noopener noreferrer'
Douwe Maan's avatar
Douwe Maan committed
75 76
          %td.import-target
          %td.import-actions-job-status
77
            = label_tag _('Incompatible Project'), nil, class: 'label badge-danger'
78 79 80

- if @incompatible_repos.any?
  %p
81 82 83 84
    = _("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.")
    - link_to_git = link_to(_('Git'), 'https://www.atlassian.com/git/tutorials/migrating-overview')
    - link_to_import_flow = link_to(_('import flow'), status_import_bitbucket_path)
    = _("Please convert them to %{link_to_git}, and go through the %{link_to_import_flow} again.").html_safe % { link_to_git: link_to_git, link_to_import_flow: link_to_import_flow }
85

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