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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
214470ca
Commit
214470ca
authored
Jun 29, 2017
by
Tiago Botelho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improves mirror force update button transparency
parent
310c1f12
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
8 deletions
+16
-8
app/models/ee/project.rb
app/models/ee/project.rb
+11
-4
app/views/projects/mirrors/_show.html.haml
app/views/projects/mirrors/_show.html.haml
+1
-3
app/views/shared/_mirror_update_button.html.haml
app/views/shared/_mirror_update_button.html.haml
+4
-1
No files found.
app/models/ee/project.rb
View file @
214470ca
...
@@ -84,11 +84,18 @@ module EE
...
@@ -84,11 +84,18 @@ module EE
mirror?
&&
self
.
mirror_last_update_at
mirror?
&&
self
.
mirror_last_update_at
end
end
def
updating_mirror?
def
mirror_with_content?
return
false
unless
mirror?
&&
!
empty_repo?
mirror?
&&
!
empty_repo
return
true
if
import_in_progress?
end
def
scheduled_mirror?
enqueued
=
self
.
mirror_data
.
next_execution_timestamp
<
Time
.
now
self
.
mirror_data
.
next_execution_timestamp
<
Time
.
now
mirror_with_content?
&&
import_scheduled?
&&
enqueued
end
def
updating_mirror?
mirror_with_content?
&&
import_started?
end
end
def
mirror_last_update_status
def
mirror_last_update_status
...
...
app/views/projects/mirrors/_show.html.haml
View file @
214470ca
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
=
expanded
?
'Collapse'
:
'Expand'
=
expanded
?
'Collapse'
:
'Expand'
%p
%p
Set up your project to automatically have its branches, tags, and commits
Set up your project to automatically have its branches, tags, and commits
updated from an upstream repository
every hour
.
updated from an upstream repository.
=
link_to
'Read more'
,
help_page_path
(
'workflow/repository_mirroring'
,
anchor:
'pulling-from-a-remote-repository'
),
target:
'_blank'
=
link_to
'Read more'
,
help_page_path
(
'workflow/repository_mirroring'
,
anchor:
'pulling-from-a-remote-repository'
),
target:
'_blank'
.settings-content.no-animate
{
class:
(
'expanded'
if
expanded
)
}
.settings-content.no-animate
{
class:
(
'expanded'
if
expanded
)
}
=
form_for
@project
,
url:
namespace_project_mirror_path
(
@project
.
namespace
,
@project
)
do
|
f
|
=
form_for
@project
,
url:
namespace_project_mirror_path
(
@project
.
namespace
,
@project
)
do
|
f
|
...
@@ -30,8 +30,6 @@
...
@@ -30,8 +30,6 @@
=
f
.
check_box
:mirror
,
class:
"pull-left"
=
f
.
check_box
:mirror
,
class:
"pull-left"
.prepend-left-20
.prepend-left-20
=
f
.
label
:mirror
,
"Mirror repository"
,
class:
"label-light append-bottom-0"
=
f
.
label
:mirror
,
"Mirror repository"
,
class:
"label-light append-bottom-0"
%p
.light.append-bottom-0
Automatically update this project's branches, tags, and commits from the upstream repository every hour.
.form-group
.form-group
=
f
.
label
:import_url
,
"Git repository URL"
,
class:
"label-light"
=
f
.
label
:import_url
,
"Git repository URL"
,
class:
"label-light"
=
f
.
text_field
:import_url
,
class:
'form-control'
,
placeholder:
'https://username:password@gitlab.company.com/group/project.git'
=
f
.
text_field
:import_url
,
class:
'form-control'
,
placeholder:
'https://username:password@gitlab.company.com/group/project.git'
...
...
app/views/shared/_mirror_update_button.html.haml
View file @
214470ca
-
if
@project
.
mirror?
&&
can?
(
current_user
,
:push_code
,
@project
)
-
if
@project
.
mirror?
&&
can?
(
current_user
,
:push_code
,
@project
)
.append-bottom-default
.append-bottom-default
-
if
@project
.
updating_mirror?
-
if
@project
.
scheduled_mirror?
=
icon
(
"refresh spin"
)
Update Scheduled
…
-
elsif
@project
.
updating_mirror?
%span
.btn.disabled
%span
.btn.disabled
=
icon
(
"refresh spin"
)
=
icon
(
"refresh spin"
)
Updating
…
Updating
…
...
...
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