Module: MirrorHelper

Defined in:
app/helpers/mirror_helper.rb

Instance Method Summary collapse

Instance Method Details

#mirrored_repositories_countObject



39
40
41
42
# File 'app/helpers/mirror_helper.rb', line 39

def mirrored_repositories_count
  count = @project.mirror == true ? 1 : 0
  count + @project.remote_mirrors.to_a.count(&:enabled)
end

#mirrors_form_data_attributesObject



4
5
6
7
8
9
# File 'app/helpers/mirror_helper.rb', line 4

def mirrors_form_data_attributes
  {
    project_mirror_ssh_endpoint: ssh_host_keys_project_mirror_path(@project, :json),
    project_mirror_endpoint: project_mirror_path(@project, :json)
  }
end

#pull_mirror_lfs_sync_messageObject



11
12
13
14
15
16
17
18
19
20
# File 'app/helpers/mirror_helper.rb', line 11

def pull_mirror_lfs_sync_message
  template = _(
    'Pull mirrors will only create LFS objects if LFS is %{docs_link_start}enabled ' \
      'for the project%{docs_link_end}.'
  )

  docs_link = link_to('', help_page_path('topics/git/lfs/_index.md'), target: '_blank', rel: 'noopener noreferrer')

  safe_format(template, tag_pair(docs_link, :docs_link_start, :docs_link_end))
end

#push_mirror_lfs_ssh_sync_messageObject



33
34
35
36
37
# File 'app/helpers/mirror_helper.rb', line 33

def push_mirror_lfs_ssh_sync_message
  template = _('Push mirrors will %{strong_open}not%{strong_close} sync LFS objects over SSH.')

  safe_format(template, tag_pair(tag.strong, :strong_open, :strong_close))
end

#push_mirror_lfs_sync_messageObject



22
23
24
25
26
27
28
29
30
31
# File 'app/helpers/mirror_helper.rb', line 22

def push_mirror_lfs_sync_message
  template = _(
    'Push mirrors will only sync LFS objects if LFS is %{docs_link_start}enabled ' \
      'for the project%{docs_link_end}.'
  )

  docs_link = link_to('', help_page_path('topics/git/lfs/_index.md'), target: '_blank', rel: 'noopener noreferrer')

  safe_format(template, tag_pair(docs_link, :docs_link_start, :docs_link_end))
end