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: a1c89a9dd3075c3b08bccaaea9391b9527ede2c0 (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
45
46
47
48
49
50
51
52
53
54
55
56
- 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.gl-text-secondary
      = _('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
    = render Pajamas::CardComponent.new(card_options: { class: 'gl-new-card js-toggle-container' }, header_options: { class: 'gl-new-card-header' }, body_options: { class: 'gl-new-card-body gl-px-0' }) do |c|
      - c.with_header do
        .gl-new-card-title-wrapper
          %h5.gl-new-card-title
            = _('Mirrored repositories')
          .gl-new-card-count
            = sprite_icon('earth', css_class: 'gl-mr-2')
            %span.js-mirrored-repo-count
              = mirrored_repositories_count
        .gl-new-card-actions
          = render Pajamas::ButtonComponent.new(size: :small, button_options: { class: "js-toggle-button js-toggle-content", data: { testid: 'add-new-mirror' } }) do
            = _('Add new')
      - c.with_body do
        - if mirror_settings_enabled
          .gl-new-card-add-form.gl-m-3.gl-mb-4.gl-display-none.js-toggle-content
            %h4.gl-mt-0
              = s_('Profiles|Add new mirror repository')
            = 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|
              %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', placeholder: _('Input the remote repository URL'), required: true, pattern: "(#{protocols}):\/\/.+", autocomplete: 'new-password', data: { qa_selector: 'mirror_repository_url_field' }

              = render 'projects/mirrors/instructions'

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

              = render 'projects/mirrors/branch_filter'

              = f.submit _('Mirror repository'), class: 'js-mirror-submit', name: :update_remote_mirror, pajamas_button: true, data: { qa_selector: 'mirror_repository_button' }

              = render Pajamas::ButtonComponent.new(button_options: { type: 'reset', class: 'gl-ml-2 js-toggle-button' }) do
                = _('Cancel')

        - else
          = render Pajamas::AlertComponent.new(dismissible: false) do |c|
            - c.with_body do
              = _('Mirror settings are only available to GitLab administrators.')

        = render 'projects/mirrors/mirror_repos_list'