Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
3cfbd2b1
Commit
3cfbd2b1
authored
Apr 11, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added loading icon to import buttons
See #14488 for more details
parent
4087bd16
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
120 additions
and
39 deletions
+120
-39
app/assets/javascripts/importer_status.js.coffee
app/assets/javascripts/importer_status.js.coffee
+27
-12
app/assets/stylesheets/pages/import.scss
app/assets/stylesheets/pages/import.scss
+21
-0
app/views/import/bitbucket/status.html.haml
app/views/import/bitbucket/status.html.haml
+14
-6
app/views/import/fogbugz/status.html.haml
app/views/import/fogbugz/status.html.haml
+11
-4
app/views/import/github/status.html.haml
app/views/import/github/status.html.haml
+11
-4
app/views/import/gitlab/status.html.haml
app/views/import/gitlab/status.html.haml
+11
-4
app/views/import/gitorious/status.html.haml
app/views/import/gitorious/status.html.haml
+11
-4
app/views/import/google_code/status.html.haml
app/views/import/google_code/status.html.haml
+14
-5
No files found.
app/assets/javascripts/importer_status.js.coffee
View file @
3cfbd2b1
...
@@ -4,16 +4,31 @@ class @ImporterStatus
...
@@ -4,16 +4,31 @@ class @ImporterStatus
this
.
setAutoUpdate
()
this
.
setAutoUpdate
()
initStatusPage
:
->
initStatusPage
:
->
$
(
".js-add-to-import"
).
click
(
event
)
=>
$
(
".js-add-to-import"
)
.
off
'click'
.
on
'click'
,
(
event
)
=>
new_namespace
=
null
new_namespace
=
null
tr
=
$
(
event
.
currentTarget
).
closest
(
"tr"
)
$btn
=
$
(
event
.
currentTarget
)
id
=
tr
.
attr
(
"id"
).
replace
(
"repo_"
,
""
)
$tr
=
$btn
.
closest
(
"tr"
)
if
tr
.
find
(
".import-target input"
).
length
>
0
id
=
$tr
.
attr
(
"id"
).
replace
(
"repo_"
,
""
)
new_namespace
=
tr
.
find
(
".import-target input"
).
prop
(
"value"
)
if
$tr
.
find
(
".import-target input"
).
length
>
0
tr
.
find
(
".import-target"
).
empty
().
append
(
new_namespace
+
"/"
+
tr
.
find
(
".import-target"
).
data
(
"project_name"
))
new_namespace
=
$tr
.
find
(
".import-target input"
).
prop
(
"value"
)
$tr
.
find
(
".import-target"
).
empty
().
append
(
new_namespace
+
"/"
+
$tr
.
find
(
".import-target"
).
data
(
"project_name"
))
$btn
.
disable
()
.
addClass
'is-loading'
$
.
post
@
import_url
,
{
repo_id
:
id
,
new_namespace
:
new_namespace
},
dataType
:
'script'
$
.
post
@
import_url
,
{
repo_id
:
id
,
new_namespace
:
new_namespace
},
dataType
:
'script'
$
(
".js-import-all"
).
click
(
event
)
=>
$
(
".js-import-all"
)
.
off
'click'
.
on
'click'
,
(
event
)
=>
$btn
=
$
(
event
.
currentTarget
)
$btn
.
disable
()
.
addClass
'is-loading'
$
(
".js-add-to-import"
).
each
->
$
(
".js-add-to-import"
).
each
->
$
(
this
).
click
()
$
(
this
).
click
()
...
...
app/assets/stylesheets/pages/import.scss
View file @
3cfbd2b1
...
@@ -16,3 +16,24 @@ i.icon-gitorious-big {
...
@@ -16,3 +16,24 @@ i.icon-gitorious-big {
width
:
18px
;
width
:
18px
;
height
:
18px
;
height
:
18px
;
}
}
.import-jobs-from-col
,
.import-jobs-to-col
{
width
:
40%
;
}
.import-jobs-status-col
{
width
:
20%
;
}
.btn-import
{
.loading-icon
{
display
:
none
;
}
&
.is-loading
{
.loading-icon
{
display
:
inline-block
;
}
}
}
app/views/import/bitbucket/status.html.haml
View file @
3cfbd2b1
...
@@ -10,13 +10,19 @@
...
@@ -10,13 +10,19 @@
%hr
%hr
%p
%p
-
if
@incompatible_repos
.
any?
-
if
@incompatible_repos
.
any?
=
button_tag
'Import all compatible projects'
,
class:
"btn btn-success js-import-all"
=
button_tag
class:
"btn btn-import btn-success js-import-all"
do
=
icon
(
'spinner spin'
,
class:
'loading-icon'
)
Import all compatible projects
-
else
-
else
=
button_tag
'Import all projects'
,
class:
"btn btn-success js-import-all"
=
button_tag
class:
"btn btn-success js-import-all"
do
=
icon
(
'spinner spin'
,
class:
'loading-icon'
)
Import all projects
.table-responsive
.table-holder
%table
.table.import-jobs
%table
.table.import-jobs
%colgroup
.import-jobs-from-col
%colgroup
.import-jobs-to-col
%colgroup
.import-jobs-status-col
%thead
%thead
%tr
%tr
%th
From Bitbucket
%th
From Bitbucket
...
@@ -28,7 +34,7 @@
...
@@ -28,7 +34,7 @@
%td
%td
=
link_to
project
.
import_source
,
"https://bitbucket.org/
#{
project
.
import_source
}
"
,
target:
"_blank"
=
link_to
project
.
import_source
,
"https://bitbucket.org/
#{
project
.
import_source
}
"
,
target:
"_blank"
%td
%td
%strong
=
link_to
project
.
path_with_namespace
,
[
project
.
namespace
.
becomes
(
Namespace
),
project
]
=
link_to
project
.
path_with_namespace
,
[
project
.
namespace
.
becomes
(
Namespace
),
project
]
%td
.job-status
%td
.job-status
-
if
project
.
import_status
==
'finished'
-
if
project
.
import_status
==
'finished'
%span
%span
...
@@ -47,7 +53,9 @@
...
@@ -47,7 +53,9 @@
%td
.import-target
%td
.import-target
=
"
#{
repo
[
"owner"
]
}
/
#{
repo
[
"slug"
]
}
"
=
"
#{
repo
[
"owner"
]
}
/
#{
repo
[
"slug"
]
}
"
%td
.import-actions.job-status
%td
.import-actions.job-status
=
button_tag
"Import"
,
class:
"btn js-add-to-import"
=
button_tag
class:
"btn btn-import js-add-to-import"
do
=
icon
(
'spinner spin'
,
class:
'loading-icon'
)
Import
-
@incompatible_repos
.
each
do
|
repo
|
-
@incompatible_repos
.
each
do
|
repo
|
%tr
{
id:
"repo_#{repo["
owner
"]}___#{repo["
slug
"]}"
}
%tr
{
id:
"repo_#{repo["
owner
"]}___#{repo["
slug
"]}"
}
%td
%td
...
...
app/views/import/fogbugz/status.html.haml
View file @
3cfbd2b1
...
@@ -13,10 +13,15 @@
...
@@ -13,10 +13,15 @@
how FogBugz email addresses and usernames are imported into GitLab.
how FogBugz email addresses and usernames are imported into GitLab.
%hr
%hr
%p
%p
=
button_tag
'Import all projects'
,
class:
'btn btn-success js-import-all'
=
button_tag
class:
'btn btn-import btn-success js-import-all'
do
=
icon
(
'spinner spin'
,
class:
'loading-icon'
)
Import all projects
.table-
holder
.table-
responsive
%table
.table.import-jobs
%table
.table.import-jobs
%colgroup
.import-jobs-from-col
%colgroup
.import-jobs-to-col
%colgroup
.import-jobs-status-col
%thead
%thead
%tr
%tr
%th
From FogBugz
%th
From FogBugz
...
@@ -28,7 +33,7 @@
...
@@ -28,7 +33,7 @@
%td
%td
=
project
.
import_source
=
project
.
import_source
%td
%td
%strong
=
link_to
project
.
path_with_namespace
,
[
project
.
namespace
.
becomes
(
Namespace
),
project
]
=
link_to
project
.
path_with_namespace
,
[
project
.
namespace
.
becomes
(
Namespace
),
project
]
%td
.job-status
%td
.job-status
-
if
project
.
import_status
==
'finished'
-
if
project
.
import_status
==
'finished'
%span
%span
...
@@ -47,7 +52,9 @@
...
@@ -47,7 +52,9 @@
%td
.import-target
%td
.import-target
=
"
#{
current_user
.
username
}
/
#{
repo
.
name
}
"
=
"
#{
current_user
.
username
}
/
#{
repo
.
name
}
"
%td
.import-actions.job-status
%td
.import-actions.job-status
=
button_tag
"Import"
,
class:
"btn js-add-to-import"
=
button_tag
class:
"btn btn-import js-add-to-import"
do
=
icon
(
'spinner spin'
,
class:
'loading-icon'
)
Import
:javascript
:javascript
new
ImporterStatus
(
"
#{
jobs_import_fogbugz_path
}
"
,
"
#{
import_fogbugz_path
}
"
);
new
ImporterStatus
(
"
#{
jobs_import_fogbugz_path
}
"
,
"
#{
import_fogbugz_path
}
"
);
app/views/import/github/status.html.haml
View file @
3cfbd2b1
...
@@ -8,10 +8,15 @@
...
@@ -8,10 +8,15 @@
Select projects you want to import.
Select projects you want to import.
%hr
%hr
%p
%p
=
button_tag
'Import all projects'
,
class:
"btn btn-success js-import-all"
=
button_tag
class:
"btn btn-import btn-success js-import-all"
do
=
icon
(
'spinner spin'
,
class:
'loading-icon'
)
Import all projects
.table-
holder
.table-
responsive
%table
.table.import-jobs
%table
.table.import-jobs
%colgroup
.import-jobs-from-col
%colgroup
.import-jobs-to-col
%colgroup
.import-jobs-status-col
%thead
%thead
%tr
%tr
%th
From GitHub
%th
From GitHub
...
@@ -23,7 +28,7 @@
...
@@ -23,7 +28,7 @@
%td
%td
=
link_to
project
.
import_source
,
"https://github.com/
#{
project
.
import_source
}
"
,
target:
"_blank"
=
link_to
project
.
import_source
,
"https://github.com/
#{
project
.
import_source
}
"
,
target:
"_blank"
%td
%td
%strong
=
link_to
project
.
path_with_namespace
,
[
project
.
namespace
.
becomes
(
Namespace
),
project
]
=
link_to
project
.
path_with_namespace
,
[
project
.
namespace
.
becomes
(
Namespace
),
project
]
%td
.job-status
%td
.job-status
-
if
project
.
import_status
==
'finished'
-
if
project
.
import_status
==
'finished'
%span
%span
...
@@ -42,7 +47,9 @@
...
@@ -42,7 +47,9 @@
%td
.import-target
%td
.import-target
=
repo
.
full_name
=
repo
.
full_name
%td
.import-actions.job-status
%td
.import-actions.job-status
=
button_tag
"Import"
,
class:
"btn js-add-to-import"
=
button_tag
class:
"btn btn-import js-add-to-import"
do
=
icon
(
'spinner spin'
,
class:
'loading-icon'
)
Import
:javascript
:javascript
new
ImporterStatus
(
"
#{
jobs_import_github_path
}
"
,
"
#{
import_github_path
}
"
);
new
ImporterStatus
(
"
#{
jobs_import_github_path
}
"
,
"
#{
import_github_path
}
"
);
app/views/import/gitlab/status.html.haml
View file @
3cfbd2b1
...
@@ -8,10 +8,15 @@
...
@@ -8,10 +8,15 @@
Select projects you want to import.
Select projects you want to import.
%hr
%hr
%p
%p
=
button_tag
'Import all projects'
,
class:
"btn btn-success js-import-all"
=
button_tag
class:
"btn btn-import btn-success js-import-all"
do
=
icon
(
'spinner spin'
,
class:
'loading-icon'
)
Import all projects
.table-
holder
.table-
responsive
%table
.table.import-jobs
%table
.table.import-jobs
%colgroup
.import-jobs-from-col
%colgroup
.import-jobs-to-col
%colgroup
.import-jobs-status-col
%thead
%thead
%tr
%tr
%th
From GitLab.com
%th
From GitLab.com
...
@@ -23,7 +28,7 @@
...
@@ -23,7 +28,7 @@
%td
%td
=
link_to
project
.
import_source
,
"https://gitlab.com/
#{
project
.
import_source
}
"
,
target:
"_blank"
=
link_to
project
.
import_source
,
"https://gitlab.com/
#{
project
.
import_source
}
"
,
target:
"_blank"
%td
%td
%strong
=
link_to
project
.
path_with_namespace
,
[
project
.
namespace
.
becomes
(
Namespace
),
project
]
=
link_to
project
.
path_with_namespace
,
[
project
.
namespace
.
becomes
(
Namespace
),
project
]
%td
.job-status
%td
.job-status
-
if
project
.
import_status
==
'finished'
-
if
project
.
import_status
==
'finished'
%span
%span
...
@@ -42,7 +47,9 @@
...
@@ -42,7 +47,9 @@
%td
.import-target
%td
.import-target
=
repo
[
"path_with_namespace"
]
=
repo
[
"path_with_namespace"
]
%td
.import-actions.job-status
%td
.import-actions.job-status
=
button_tag
"Import"
,
class:
"btn js-add-to-import"
=
button_tag
class:
"btn js-add-to-import"
do
=
icon
(
'spinner spin'
,
class:
'loading-icon'
)
Import
:javascript
:javascript
new
ImporterStatus
(
"
#{
jobs_import_gitlab_path
}
"
,
"
#{
import_gitlab_path
}
"
);
new
ImporterStatus
(
"
#{
jobs_import_gitlab_path
}
"
,
"
#{
import_gitlab_path
}
"
);
app/views/import/gitorious/status.html.haml
View file @
3cfbd2b1
...
@@ -8,10 +8,15 @@
...
@@ -8,10 +8,15 @@
Select projects you want to import.
Select projects you want to import.
%hr
%hr
%p
%p
=
button_tag
'Import all projects'
,
class:
"btn btn-success js-import-all"
=
button_tag
class:
"btn btn-import btn-success js-import-all"
do
=
icon
(
'spinner spin'
,
class:
'loading-icon'
)
Import all projects
.table-
holder
.table-
responsive
%table
.table.import-jobs
%table
.table.import-jobs
%colgroup
.import-jobs-from-col
%colgroup
.import-jobs-to-col
%colgroup
.import-jobs-status-col
%thead
%thead
%tr
%tr
%th
From Gitorious.org
%th
From Gitorious.org
...
@@ -23,7 +28,7 @@
...
@@ -23,7 +28,7 @@
%td
%td
=
link_to
project
.
import_source
,
"https://gitorious.org/
#{
project
.
import_source
}
"
,
target:
"_blank"
=
link_to
project
.
import_source
,
"https://gitorious.org/
#{
project
.
import_source
}
"
,
target:
"_blank"
%td
%td
%strong
=
link_to
project
.
path_with_namespace
,
[
project
.
namespace
.
becomes
(
Namespace
),
project
]
=
link_to
project
.
path_with_namespace
,
[
project
.
namespace
.
becomes
(
Namespace
),
project
]
%td
.job-status
%td
.job-status
-
if
project
.
import_status
==
'finished'
-
if
project
.
import_status
==
'finished'
%span
%span
...
@@ -42,7 +47,9 @@
...
@@ -42,7 +47,9 @@
%td
.import-target
%td
.import-target
=
repo
.
full_name
=
repo
.
full_name
%td
.import-actions.job-status
%td
.import-actions.job-status
=
button_tag
"Import"
,
class:
"btn js-add-to-import"
=
button_tag
class:
"btn btn-import js-add-to-import"
do
=
icon
(
'spinner spin'
,
class:
'loading-icon'
)
Import
:javascript
:javascript
new
ImporterStatus
(
"
#{
jobs_import_gitorious_path
}
"
,
"
#{
import_gitorious_path
}
"
);
new
ImporterStatus
(
"
#{
jobs_import_gitorious_path
}
"
,
"
#{
import_gitorious_path
}
"
);
app/views/import/google_code/status.html.haml
View file @
3cfbd2b1
...
@@ -14,12 +14,19 @@
...
@@ -14,12 +14,19 @@
%hr
%hr
%p
%p
-
if
@incompatible_repos
.
any?
-
if
@incompatible_repos
.
any?
=
button_tag
'Import all compatible projects'
,
class:
"btn btn-success js-import-all"
=
button_tag
class:
"btn btn-import btn-success js-import-all"
do
=
icon
(
'spinner spin'
,
class:
'loading-icon'
)
Import all compatible projects
-
else
-
else
=
button_tag
'Import all projects'
,
class:
"btn btn-success js-import-all"
=
button_tag
class:
"btn btn-import btn-success js-import-all"
do
=
icon
(
'spinner spin'
,
class:
'loading-icon'
)
Import all projects
.table-
holder
.table-
responsive
%table
.table.import-jobs
%table
.table.import-jobs
%colgroup
.import-jobs-from-col
%colgroup
.import-jobs-to-col
%colgroup
.import-jobs-status-col
%thead
%thead
%tr
%tr
%th
From Google Code
%th
From Google Code
...
@@ -31,7 +38,7 @@
...
@@ -31,7 +38,7 @@
%td
%td
=
link_to
project
.
import_source
,
"https://code.google.com/p/
#{
project
.
import_source
}
"
,
target:
"_blank"
=
link_to
project
.
import_source
,
"https://code.google.com/p/
#{
project
.
import_source
}
"
,
target:
"_blank"
%td
%td
%strong
=
link_to
project
.
path_with_namespace
,
[
project
.
namespace
.
becomes
(
Namespace
),
project
]
=
link_to
project
.
path_with_namespace
,
[
project
.
namespace
.
becomes
(
Namespace
),
project
]
%td
.job-status
%td
.job-status
-
if
project
.
import_status
==
'finished'
-
if
project
.
import_status
==
'finished'
%span
%span
...
@@ -50,7 +57,9 @@
...
@@ -50,7 +57,9 @@
%td
.import-target
%td
.import-target
=
"
#{
current_user
.
username
}
/
#{
repo
.
name
}
"
=
"
#{
current_user
.
username
}
/
#{
repo
.
name
}
"
%td
.import-actions.job-status
%td
.import-actions.job-status
=
button_tag
"Import"
,
class:
"btn js-add-to-import"
=
button_tag
class:
"btn btn-import js-add-to-import"
do
=
icon
(
'spinner spin'
,
class:
'loading-icon'
)
Import
-
@incompatible_repos
.
each
do
|
repo
|
-
@incompatible_repos
.
each
do
|
repo
|
%tr
{
id:
"repo_#{repo.id}"
}
%tr
{
id:
"repo_#{repo.id}"
}
%td
%td
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment