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
f7874323
Commit
f7874323
authored
Aug 03, 2018
by
Luke Bennett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move direction select to mirror_repos_form
parent
f69f5468
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
10 deletions
+14
-10
app/views/projects/mirrors/_mirror_repos.html.haml
app/views/projects/mirrors/_mirror_repos.html.haml
+1
-10
app/views/projects/mirrors/_mirror_repos_form.html.haml
app/views/projects/mirrors/_mirror_repos_form.html.haml
+4
-0
ee/app/views/projects/mirrors/_mirror_repos_form.html.haml
ee/app/views/projects/mirrors/_mirror_repos_form.html.haml
+9
-0
No files found.
app/views/projects/mirrors/_mirror_repos.html.haml
View file @
f7874323
-
expanded
=
Rails
.
env
.
test?
-
protocols
=
Gitlab
::
UrlSanitizer
::
ALLOWED_SCHEMES
.
join
(
'|'
)
-
can_push
=
can?
(
current_user
,
:admin_remote_mirror
,
@project
)
-
can_pull
=
can?
(
current_user
,
:admin_mirror
,
@project
)
-
options
=
[]
-
options
.
push
([
_
(
'Pull'
),
'pull'
])
if
can_pull
-
options
.
push
([
_
(
'Push'
),
'push'
])
if
can_push
%section
.settings.project-mirror-settings.js-mirror-settings.no-animate
{
class:
(
'expanded'
if
expanded
)
}
.settings-header
...
...
@@ -29,11 +24,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'
,
count:
options
.
count
,
disabled:
options
.
count
==
1
=
render
'projects/mirrors/mirror_repos_form'
,
can_push:
can_push
,
can_pull:
can_pull
,
f:
f
=
render
'projects/mirrors/mirror_repos_form'
,
f:
f
.form-check.append-bottom-10
=
check_box_tag
:only_protected_branches
,
'1'
,
false
,
class:
'js-mirror-protected form-check-input'
...
...
app/views/projects/mirrors/_mirror_repos_form.html.haml
View file @
f7874323
-
protocols
=
Gitlab
::
UrlSanitizer
::
ALLOWED_SCHEMES
.
join
(
'|'
)
.form-group
=
label_tag
:mirror_direction
,
_
(
'Mirror direction'
),
class:
'label-light'
=
select_tag
:mirror_direction
,
options_for_select
([[
_
(
'Push'
),
'push'
]]),
class:
'form-control js-mirror-direction'
,
disabled:
true
=
f
.
fields_for
:remote_mirrors
,
@remote_mirror
do
|
rm_f
|
=
rm_f
.
hidden_field
:enabled
,
value:
'1'
=
rm_f
.
hidden_field
:url
,
class:
'js-mirror-url-hidden'
,
required:
true
,
pattern:
"(
#{
protocols
}
):
\/\/
.+"
...
...
ee/app/views/projects/mirrors/_mirror_repos_form.html.haml
View file @
f7874323
-
import_data
=
@project
.
import_data
||
@project
.
build_import_data
-
is_one_user_option
=
default_mirror_users
.
count
==
1
-
protocols
=
Gitlab
::
UrlSanitizer
::
ALLOWED_SCHEMES
.
join
(
'|'
)
-
can_push
=
can?
(
current_user
,
:admin_remote_mirror
,
@project
)
-
can_pull
=
can?
(
current_user
,
:admin_mirror
,
@project
)
&&
!
@project
.
mirror
-
options
=
[]
-
options
.
push
([
_
(
'Pull'
),
'pull'
])
if
can_pull
-
options
.
push
([
_
(
'Push'
),
'push'
])
if
can_push
.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'
,
disabled:
options
.
count
==
1
.js-form-insertion-point
...
...
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