BigW Consortium Gitlab

status.html.haml 2.5 KB
Newer Older
1
- page_title "GitHub import"
2
- header_title "Projects", root_path
Valery Sizov committed
3
%h3.page-title
4
  %i.fa.fa-github
5
  Import projects from GitHub
Valery Sizov committed
6

7
%p.light
8
  Select projects you want to import.
9
%hr
10
%p
11 12
  = button_tag class: "btn btn-import btn-success js-import-all" do
    Import all projects
13
    = icon("spinner spin", class: "loading-icon")
14

15
.table-responsive
Douwe Maan committed
16
  %table.table.import-jobs
17 18 19
    %colgroup.import-jobs-from-col
    %colgroup.import-jobs-to-col
    %colgroup.import-jobs-status-col
Douwe Maan committed
20 21 22 23 24 25 26 27 28
    %thead
      %tr
        %th From GitHub
        %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
29
            = github_project_link(project.import_source)
Douwe Maan committed
30
          %td
31
            = link_to project.path_with_namespace, [project.namespace.becomes(Namespace), project]
Douwe Maan committed
32 33 34 35 36 37 38 39 40 41
          %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
42

Douwe Maan committed
43 44 45
      - @repos.each do |repo|
        %tr{id: "repo_#{repo.id}"}
          %td
46
            = github_project_link(repo.full_name)
Douwe Maan committed
47
          %td.import-target
48
            %fieldset.row
49
            .input-group
James Lopez committed
50
              .project-path.input-group-btn
51
                - if current_user.can_select_namespace?
52
                  - selected = params[:namespace_id] || :current_user
James Lopez committed
53
                  - opts = current_user.can_create_group? ? { extra_group: Group.new(name: repo.owner.login, path: repo.owner.login) } : {}
54
                  = select_tag :namespace_id, namespaces_options(selected, opts.merge({ display_path: true })), { class: 'select2 js-select-namespace', tabindex: 1 }
55
                - else
56
                  = text_field_tag :path, current_user.namespace_path, class: "input-large form-control", tabindex: 1, disabled: true
James Lopez committed
57
              %span.input-group-addon /
58
              = text_field_tag :path, repo.name, class: "input-mini form-control", tabindex: 2, autofocus: true, required: true
Douwe Maan committed
59
          %td.import-actions.job-status
60 61
            = button_tag class: "btn btn-import js-add-to-import" do
              Import
62
              = icon("spinner spin", class: "loading-icon")
63

64
.js-importer-status{ data: { jobs_import_path: "#{jobs_import_github_path}", import_path: "#{import_github_path}" } }