Improve github import page UI
This commit is contained in:
parent
4d03a2803e
commit
1e37e8924a
4 changed files with 28 additions and 23 deletions
|
@ -13,6 +13,4 @@
|
||||||
- else
|
- else
|
||||||
:plain
|
:plain
|
||||||
$("table.import-jobs tbody").prepend($("tr#repo_#{@repo_id}"))
|
$("table.import-jobs tbody").prepend($("tr#repo_#{@repo_id}"))
|
||||||
$("tr#repo_#{@repo_id}").addClass("active").find(".import-actions").text("started")
|
$("tr#repo_#{@repo_id}").addClass("active").find(".import-actions").html("<i class='fa fa-spinner fa-spin'></i> started")
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,22 +1,32 @@
|
||||||
%h3.page-title
|
%h3.page-title
|
||||||
Import repositories from github
|
%i.fa.fa-github
|
||||||
|
Import repositories from GitHub.com
|
||||||
|
|
||||||
|
%p.light
|
||||||
|
Select projects you want to import.
|
||||||
|
%span.pull-right
|
||||||
|
Reload to see the progress.
|
||||||
|
|
||||||
%hr
|
%hr
|
||||||
%h4
|
%table.table.import-jobs
|
||||||
Select projects you want to import.
|
|
||||||
|
|
||||||
%table.table.table-bordered.import-jobs
|
|
||||||
%thead
|
%thead
|
||||||
%tr
|
%tr
|
||||||
%th From GitHub
|
%th From GitHub
|
||||||
%th To GitLab
|
%th To GitLab
|
||||||
%th Status
|
%th Status
|
||||||
%tbody
|
%tbody
|
||||||
- @already_added_projects.each do |repo|
|
- @already_added_projects.each do |project|
|
||||||
%tr{id: "repo_#{repo.id}", class: "#{project_status_css_class(repo.import_status)}"}
|
%tr{id: "repo_#{project.id}", class: "#{project_status_css_class(project.import_status)}"}
|
||||||
%td= repo.import_source
|
%td= project.import_source
|
||||||
%td= repo.name_with_namespace
|
%td
|
||||||
%td= repo.human_import_status_name
|
%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
|
||||||
|
|
||||||
- @repos.each do |repo|
|
- @repos.each do |repo|
|
||||||
%tr{id: "repo_#{repo.id}"}
|
%tr{id: "repo_#{repo.id}"}
|
||||||
|
@ -36,6 +46,3 @@
|
||||||
new_namespace = tr.find(".import-target input").prop("value")
|
new_namespace = tr.find(".import-target input").prop("value")
|
||||||
tr.find(".import-target").empty().append(new_namespace + "/" + tr.find(".import-target").data("project_name"))
|
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'
|
$.post "#{github_import_url}", {repo_id: id, new_namespace: new_namespace}, dataType: 'script'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -19,9 +19,9 @@ module Gitlab
|
||||||
|
|
||||||
def github_options
|
def github_options
|
||||||
{
|
{
|
||||||
:site => 'https://api.github.com',
|
site: 'https://api.github.com',
|
||||||
:authorize_url => 'https://github.com/login/oauth/authorize',
|
authorize_url: 'https://github.com/login/oauth/authorize',
|
||||||
:token_url => 'https://github.com/login/oauth/access_token'
|
token_url: 'https://github.com/login/oauth/access_token'
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue