Welcome to mirror list, hosted at ThFree Co, Russian Federation.

_mirror_repos.html.haml « mirrors « projects « views « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2ae7d300979d54b93b13130560094c65f22b432f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
- expanded = expanded_by_default?
- protocols = Gitlab::UrlSanitizer::ALLOWED_SCHEMES.join('|')
- mirror_settings_enabled = can?(current_user, :admin_remote_mirror, @project)
- mirror_settings_class = "#{'expanded' if expanded} #{'js-mirror-settings' if mirror_settings_enabled}".strip

%section.settings.project-mirror-settings.no-animate#js-push-remote-settings{ class: mirror_settings_class, data: { qa_selector: 'mirroring_repositories_settings_content' } }
  .settings-header
    %h4.settings-title.js-settings-toggle.js-settings-toggle-trigger-only= _('Mirroring repositories')
    = render Pajamas::ButtonComponent.new(button_options: { class: 'js-settings-toggle' }) do
      = expanded ? _('Collapse') : _('Expand')
    %p
      = _('Set up your project to automatically push and/or pull changes to/from another repository. Branches, tags, and commits will be synced automatically.')
      = link_to _('How do I mirror repositories?'), help_page_path('user/project/repository/mirror/index.md'), target: '_blank', rel: 'noopener noreferrer'

  .settings-content
    - if mirror_settings_enabled
      = gitlab_ui_form_for @project, url: project_mirror_path(@project), html: { class: 'gl-show-field-errors js-mirror-form', autocomplete: 'new-password', data: mirrors_form_data_attributes } do |f|
        .panel.panel-default
          .panel-body
            %div= form_errors(@project)

            .form-group.has-feedback
              = label_tag :url, _('Git repository URL'), class: 'label-light'
              = text_field_tag :url, nil, class: 'form-control gl-form-input js-mirror-url js-repo-url qa-mirror-repository-url-input', placeholder: _('Input the remote repository URL'), required: true, pattern: "(#{protocols}):\/\/.+", autocomplete: 'new-password'

            = render 'projects/mirrors/instructions'

            = render 'projects/mirrors/mirror_repos_form', f: f

            .form-check.gl-mb-3
              = check_box_tag :only_protected_branches, '1', false, class: 'js-mirror-protected form-check-input'
              = label_tag :only_protected_branches, _('Mirror only protected branches'), class: 'form-check-label'
              .form-text.text-muted
                = _('If enabled, only protected branches will be mirrored.')
                = link_to _('Learn more.'), help_page_path('user/project/repository/mirror/index.md', anchor: 'mirror-only-protected-branches'), target: '_blank', rel: 'noopener noreferrer'

          .panel-footer
            = f.submit _('Mirror repository'), class: 'gl-button btn btn-confirm js-mirror-submit qa-mirror-repository-button', name: :update_remote_mirror
    - else
      = render Pajamas::AlertComponent.new(dismissible: false) do |c|
        = c.body do
          = _('Mirror settings are only available to GitLab administrators.')

    = render 'projects/mirrors/mirror_repos_list'