summaryrefslogtreecommitdiff
path: root/app/views/projects/mirrors/_push.html.haml
blob: c3dcd9617a60f9db6ddd58ca3bea8e769793904b (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
- expanded = Rails.env.test?
%section.settings.no-animate{ class: ('expanded' if expanded) }
  .settings-header
    %h4
      Push to a remote repository
    %button.btn.js-settings-toggle
      = expanded ? 'Collapse' : 'Expand'
    %p
      Set up the remote repository that you want to update with the content of the current repository
      every time someone pushes to it.
      = link_to 'Read more', help_page_path('workflow/repository_mirroring', anchor: 'pushing-to-a-remote-repository'), target: '_blank'
  .settings-content
    = form_for @project, url: project_mirror_path(@project) do |f|
      %div
        = form_errors(@project)
      = render "shared/remote_mirror_update_button", remote_mirror: @remote_mirror
      - if @remote_mirror.last_error.present?
        .panel.panel-danger
          .panel-heading
            - if @remote_mirror.last_update_at
              The remote repository failed to update #{time_ago_with_tooltip(@remote_mirror.last_update_at)}.
            - else
              The remote repository failed to update.

            - if @remote_mirror.last_successful_update_at
              Last successful update #{time_ago_with_tooltip(@remote_mirror.last_successful_update_at)}.
          .panel-body
            %pre
              :preserve
                #{h(@remote_mirror.last_error.strip)}
      = f.fields_for :remote_mirrors, @remote_mirror do |rm_form|
        .form-group
          = rm_form.check_box :enabled, class: "float-left"
          .prepend-left-20
            = rm_form.label :enabled, "Remote mirror repository", class: "label-light append-bottom-0"
            %p.light.append-bottom-0
              Automatically update the remote mirror's branches, tags, and commits from this repository every time someone pushes to it.
        .form-group.has-feedback
          = rm_form.label :url, "Git repository URL", class: "label-light"
          = rm_form.text_field :url, class: "form-control", placeholder: 'https://username:password@gitlab.company.com/group/project.git'

          = render "projects/mirrors/instructions"

        .form-group
          = rm_form.check_box :only_protected_branches, class: 'float-left'
          .prepend-left-20
            = rm_form.label :only_protected_branches, class: 'label-light'
            = link_to icon('question-circle'), help_page_path('user/project/protected_branches')

        = f.submit 'Save changes', class: 'btn btn-create', name: 'update_remote_mirror'