gitlab-org--gitlab-foss/app/views/github_imports/status.html.haml

49 lines
1.4 KiB
Text
Raw Normal View History

2014-12-31 08:07:48 -05:00
%h3.page-title
2015-01-13 14:44:17 -05:00
%i.fa.fa-github
Import repositories from GitHub.com
2014-12-31 08:07:48 -05:00
2015-01-13 14:44:17 -05:00
%p.light
2014-12-31 08:07:48 -05:00
Select projects you want to import.
2015-01-13 14:44:17 -05:00
%span.pull-right
Reload to see the progress.
%hr
%table.table.import-jobs
2014-12-31 08:07:48 -05:00
%thead
%tr
%th From GitHub
%th To GitLab
%th Status
%tbody
2015-01-13 14:44:17 -05:00
- @already_added_projects.each do |project|
%tr{id: "repo_#{project.id}", class: "#{project_status_css_class(project.import_status)}"}
%td= project.import_source
%td
%strong= link_to project.name_with_namespace, project
%td
- if project.import_status == 'finished'
%span.cgreen
%i.fa.fa-check
done
- else
= project.human_import_status_name
2014-12-31 08:07:48 -05:00
- @repos.each do |repo|
%tr{id: "repo_#{repo.id}"}
%td= repo.full_name
2015-01-13 14:44:17 -05:00
%td.import-target
2014-12-31 08:07:48 -05:00
= repo.full_name
%td.import-actions
= button_tag "Add", class: "btn btn-add-to-import"
2015-01-13 14:44:17 -05:00
2014-12-31 08:07:48 -05:00
:coffeescript
$(".btn-add-to-import").click () ->
new_namespace = null
tr = $(this).closest("tr")
id = tr.attr("id").replace("repo_", "")
if tr.find(".import-target input").length > 0
new_namespace = tr.find(".import-target input").prop("value")
tr.find(".import-target").empty().append(new_namespace + "/" + tr.find(".import-target").data("project_name"))
$.post "#{github_import_url}", {repo_id: id, new_namespace: new_namespace}, dataType: 'script'