Module: MirrorHelper

Defined in:
app/helpers/mirror_helper.rb

Instance Method Summary collapse

Instance Method Details

#mirror_lfs_sync_messageObject



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

def mirror_lfs_sync_message
  docs_link_url = help_page_path('topics/git/lfs/index')
  docs_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: docs_link_url }

  html_escape(_('Git LFS objects will be synced if LFS is %{docs_link_start}enabled for the project%{docs_link_end}. Push mirrors will %{strong_open}not%{strong_close} sync LFS objects over SSH.')) %
    { docs_link_start: docs_link_start, docs_link_end: '</a>'.html_safe, strong_open: '<strong>'.html_safe, strong_close: '</strong>'.html_safe }
end

#mirrored_repositories_countObject



19
20
21
22
# File 'app/helpers/mirror_helper.rb', line 19

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