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
0f5731f9
Commit
0f5731f9
authored
Jul 25, 2018
by
Luke Bennett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Separate CE from EE views
parent
e2ecdd4a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
32 additions
and
33 deletions
+32
-33
app/views/projects/mirrors/_direction_dropdown.html.haml
app/views/projects/mirrors/_direction_dropdown.html.haml
+3
-0
app/views/projects/mirrors/_push_pull.html.haml
app/views/projects/mirrors/_push_pull.html.haml
+5
-31
app/views/projects/mirrors/_push_pull_form.html.haml
app/views/projects/mirrors/_push_pull_form.html.haml
+1
-2
app/views/projects/mirrors/_table_pull_row.html.haml
app/views/projects/mirrors/_table_pull_row.html.haml
+17
-0
ee/app/helpers/mirror_helper.rb
ee/app/helpers/mirror_helper.rb
+5
-0
ee/app/views/projects/mirrors/_mirrored_repositories_count.html.haml
...s/projects/mirrors/_mirrored_repositories_count.html.haml
+1
-0
No files found.
app/views/projects/mirrors/_direction_dropdown.html.haml
0 → 100644
View file @
0f5731f9
.form-group
=
label_tag
:mirror_direction
,
_
(
'Mirror direction'
),
class:
'label-light'
=
select_tag
:mirror_direction
,
options_for_select
(
options
),
class:
'form-control js-mirror-direction'
\ No newline at end of file
app/views/projects/mirrors/_push_pull.html.haml
View file @
0f5731f9
...
...
@@ -3,8 +3,8 @@
-
can_push
=
can?
(
current_user
,
:admin_remote_mirror
,
@project
)
-
can_pull
=
can?
(
current_user
,
:admin_mirror
,
@project
)
-
options
=
[]
-
options
.
unshift
([
_
(
'Push'
),
'push'
])
if
can_push
-
options
.
unshift
([
_
(
'Pull'
),
'pull'
])
if
can_pull
-
options
.
unshift
([
_
(
'Push'
),
'push'
])
if
can_push
%section
.settings.project-mirror-settings.js-mirror-settings.no-animate
{
class:
(
'expanded'
if
expanded
)
}
.settings-header
...
...
@@ -16,7 +16,7 @@
=
link_to
_
(
'Read more'
),
help_page_path
(
'workflow/repository_mirroring'
),
target:
'_blank'
.settings-content
=
form_for
@project
,
url:
project_mirror_path
(
@project
),
html:
{
class:
'gl-show-field-errors js-mirror-form'
,
autocomplete:
'false'
,
data:
{
project_mirror_ssh_endpoint:
ssh_host_keys_project_mirror_path
(
@project
,
:json
),
project_mirror_endpoint:
project_mirror_path
(
@project
)
}
}
do
|
f
|
=
form_for
@project
,
url:
project_mirror_path
(
@project
),
html:
{
class:
'gl-show-field-errors js-mirror-form'
,
autocomplete:
'false'
,
data:
mirrors_form_data_attributes
}
do
|
f
|
.panel.panel-default
.panel-heading
%h3
.panel-title
=
_
(
'Mirror a repository'
)
...
...
@@ -29,9 +29,7 @@
=
render
'projects/mirrors/instructions'
.form-group
=
label_tag
:mirror_direction
,
_
(
'Mirror direction'
),
class:
'label-light'
=
select_tag
:mirror_direction
,
options_for_select
(
options
),
class:
'form-control js-mirror-direction'
=
render_if_exists
'projects/mirrors/direction_dropdown'
,
options:
options
=
render
'projects/mirrors/push_pull_form'
,
can_push:
can_push
,
can_pull:
can_pull
,
f:
f
...
...
@@ -50,29 +48,13 @@
%tr
%th
=
_
(
'Mirrored repositories'
)
%span
.js-mirrored-repo-count
(
#{
mirrored_repositories_count
}
)
=
render_if_exists
'projects/mirrors/mirrored_repositories_count'
%th
=
_
(
'Direction'
)
%th
=
_
(
'Last update'
)
%th
%th
%tbody
.js-mirrors-table-body
-
if
@project
.
mirror
%tr
%td
=
@project
.
username_only_import_url
%td
=
_
(
'Pull'
)
%td
=
@project
.
mirror_last_update_at
.
present?
?
time_ago_with_tooltip
(
@project
.
mirror_last_update_at
)
:
_
(
'Never'
)
%td
-
if
@project
.
import_error
.
present?
.badge.mirror-error-badge
{
data:
{
toggle:
'tooltip'
,
html:
'true'
},
title:
html_escape
(
@project
.
import_error
.
try
(
:strip
))
}=
_
(
'Error'
)
%td
.btn-group.mirror-actions-group
{
role:
'group'
}
-
if
@project
.
mirror?
&&
can?
(
current_user
,
:push_code
,
@project
)
-
if
@project
.
mirror_about_to_update?
||
@project
.
updating_mirror?
%button
.btn.disabled
{
type:
'button'
,
data:
{
container:
'body'
,
toggle:
'tooltip'
},
title:
_
(
'Updating'
)
}=
icon
(
"refresh spin"
)
-
else
=
link_to
update_now_project_mirror_path
(
@project
),
method: :post
,
class:
'btn js-force-update-mirror'
,
data:
{
container:
'body'
,
toggle:
'tooltip'
},
title:
_
(
'Update now'
)
do
=
icon
(
"refresh"
)
%button
.js-delete-mirror.js-delete-pull-mirror.btn.btn-danger
{
type:
'button'
,
data:
{
toggle:
'tooltip'
,
container:
'body'
},
title:
_
(
'Remove'
)
}=
icon
(
'trash-o'
)
=
render_if_exists
'projects/mirrors/table_pull_row'
-
@project
.
remote_mirrors
.
each_with_index
do
|
mirror
,
index
|
-
if
mirror
.
enabled
%tr
...
...
@@ -86,11 +68,3 @@
.btn-group.mirror-actions-group
{
role:
'group'
}
=
render
'shared/remote_mirror_update_button'
,
remote_mirror:
mirror
%button
.js-delete-mirror.btn.btn-danger
{
type:
'button'
,
data:
{
mirror_id:
mirror
.
id
,
toggle:
'tooltip'
,
container:
'body'
},
title:
_
(
'Remove'
)
}=
icon
(
'trash-o'
)
%template
.js-tr-template
%tr
%td
<
%
-
safeUrl
%
>
%td
<
%
-
direction
%
>
%td
.js-mirror-timeago
<
%
-
timeago
%
>
%td
%button
.js-delete-mirror.btn.btn-transparent
{
type:
'button'
,
class:
'js-delete-<%-direction%>-mirror'
,
data:
{
mirror_id:
'<%- id %>'
}
}=
icon
(
'trash-o'
)
app/views/projects/mirrors/_push_pull_form.html.haml
View file @
0f5731f9
-
import_data
=
@project
.
import_data
||
@project
.
build_import_data
-
is_one_user_option
=
default_mirror_users
.
count
==
1
-
protocols
=
Gitlab
::
UrlSanitizer
::
ALLOWED_SCHEMES
.
join
(
'|'
)
=
f
.
fields_for
:remote_mirrors
,
@remote_mirror
do
|
rm_f
|
=
rm_f
.
hidden_field
:enabled
,
value:
'1'
...
...
app/views/projects/mirrors/_table_pull_row.html.haml
0 → 100644
View file @
0f5731f9
-
if
@project
.
mirror
%tr
%td
=
@project
.
username_only_import_url
%td
=
_
(
'Pull'
)
%td
=
@project
.
mirror_last_update_at
.
present?
?
time_ago_with_tooltip
(
@project
.
mirror_last_update_at
)
:
_
(
'Never'
)
%td
-
if
@project
.
import_error
.
present?
.badge.mirror-error-badge
{
data:
{
toggle:
'tooltip'
,
html:
'true'
},
title:
html_escape
(
@project
.
import_error
.
try
(
:strip
))
}=
_
(
'Error'
)
%td
.btn-group.mirror-actions-group
{
role:
'group'
}
-
if
@project
.
mirror?
&&
can?
(
current_user
,
:push_code
,
@project
)
-
if
@project
.
mirror_about_to_update?
||
@project
.
updating_mirror?
%button
.btn.disabled
{
type:
'button'
,
data:
{
container:
'body'
,
toggle:
'tooltip'
},
title:
_
(
'Updating'
)
}=
icon
(
"refresh spin"
)
-
else
=
link_to
update_now_project_mirror_path
(
@project
),
method: :post
,
class:
'btn js-force-update-mirror'
,
data:
{
container:
'body'
,
toggle:
'tooltip'
},
title:
_
(
'Update now'
)
do
=
icon
(
"refresh"
)
%button
.js-delete-mirror.js-delete-pull-mirror.btn.btn-danger
{
type:
'button'
,
data:
{
toggle:
'tooltip'
,
container:
'body'
},
title:
_
(
'Remove'
)
}=
icon
(
'trash-o'
)
\ No newline at end of file
ee/app/helpers/mirror_helper.rb
View file @
0f5731f9
...
...
@@ -33,4 +33,9 @@ module MirrorHelper
count
=
project
.
mirror
==
true
?
1
:
0
count
+
@project
.
remote_mirrors
.
to_a
.
count
{
|
mirror
|
mirror
.
enabled
}
end
def
mirrors_form_data_attributes
{
project_mirror_ssh_endpoint:
ssh_host_keys_project_mirror_path
(
@project
,
:json
),
project_mirror_endpoint:
project_mirror_path
(
@project
)
}
end
end
ee/app/views/projects/mirrors/_mirrored_repositories_count.html.haml
0 → 100644
View file @
0f5731f9
%span
.js-mirrored-repo-count
(
#{
mirrored_repositories_count
}
)
\ No newline at end of file
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