diff options
author | Luke Bennett <lukeeeebennettplus@gmail.com> | 2018-08-03 13:24:02 +0100 |
---|---|---|
committer | Luke Bennett <lukeeeebennettplus@gmail.com> | 2018-08-03 13:24:02 +0100 |
commit | afca4f6a457c1a9bb6e2857b99c6f9b13f61af6e (patch) | |
tree | fdb1a63a9ff5216a13ecc6c6971cdade6ae7e961 /app | |
parent | 693b5ea80973abdea2fad543451652d65c4f966f (diff) | |
download | gitlab-ce-afca4f6a457c1a9bb6e2857b99c6f9b13f61af6e.tar.gz |
Move direction select to mirror_repos_form
Diffstat (limited to 'app')
-rw-r--r-- | app/views/projects/mirrors/_mirror_repos.html.haml | 11 | ||||
-rw-r--r-- | app/views/projects/mirrors/_mirror_repos_form.html.haml | 4 |
2 files changed, 5 insertions, 10 deletions
diff --git a/app/views/projects/mirrors/_mirror_repos.html.haml b/app/views/projects/mirrors/_mirror_repos.html.haml index 5f61d059d68..53387b3a50c 100644 --- a/app/views/projects/mirrors/_mirror_repos.html.haml +++ b/app/views/projects/mirrors/_mirror_repos.html.haml @@ -1,10 +1,5 @@ - 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', 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' diff --git a/app/views/projects/mirrors/_mirror_repos_form.html.haml b/app/views/projects/mirrors/_mirror_repos_form.html.haml index 2af5ed6433b..6641376b677 100644 --- a/app/views/projects/mirrors/_mirror_repos_form.html.haml +++ b/app/views/projects/mirrors/_mirror_repos_form.html.haml @@ -1,5 +1,9 @@ - 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}):\/\/.+" |