Module: Routing::ProjectsHelper

Included in:
GitlabRoutingHelper
Defined in:
app/helpers/routing/projects_helper.rb

Instance Method Summary collapse

Instance Method Details

#commit_url(entity, *args) ⇒ Object


57
58
59
# File 'app/helpers/routing/projects_helper.rb', line 57

def commit_url(entity, *args)
  project_commit_url(entity.project, entity.sha, *args)
end

#commits_url(entity, *args) ⇒ Object


53
54
55
# File 'app/helpers/routing/projects_helper.rb', line 53

def commits_url(entity, *args)
  project_commits_url(entity.project, entity.source_ref, *args)
end

#edit_milestone_path(entity, *args) ⇒ Object


65
66
67
68
69
70
71
# File 'app/helpers/routing/projects_helper.rb', line 65

def edit_milestone_path(entity, *args)
  if entity.resource_parent.is_a?(Group)
    edit_group_milestone_path(entity.resource_parent, entity, *args)
  else
    edit_project_milestone_path(entity.resource_parent, entity, *args)
  end
end

#environment_delete_path(environment, *args) ⇒ Object


21
22
23
# File 'app/helpers/routing/projects_helper.rb', line 21

def environment_delete_path(environment, *args)
  expose_path(api_v4_projects_environments_path(id: environment.project.id, environment_id: environment.id))
end

#environment_path(environment, *args) ⇒ Object


17
18
19
# File 'app/helpers/routing/projects_helper.rb', line 17

def environment_path(environment, *args)
  project_environment_path(environment.project, environment, *args)
end

#issue_path(entity, *args) ⇒ Object


25
26
27
# File 'app/helpers/routing/projects_helper.rb', line 25

def issue_path(entity, *args)
  project_issue_path(entity.project, entity, *args)
end

#issue_url(entity, *args) ⇒ Object


37
38
39
# File 'app/helpers/routing/projects_helper.rb', line 37

def issue_url(entity, *args)
  project_issue_url(entity.project, entity, *args)
end

#merge_request_path(entity, *args) ⇒ Object


29
30
31
# File 'app/helpers/routing/projects_helper.rb', line 29

def merge_request_path(entity, *args)
  project_merge_request_path(entity.project, entity, *args)
end

#merge_request_url(entity, *args) ⇒ Object


41
42
43
# File 'app/helpers/routing/projects_helper.rb', line 41

def merge_request_url(entity, *args)
  project_merge_request_url(entity.project, entity, *args)
end

#pipeline_job_url(pipeline, build, *args) ⇒ Object


49
50
51
# File 'app/helpers/routing/projects_helper.rb', line 49

def pipeline_job_url(pipeline, build, *args)
  project_job_url(pipeline.project, build.id, *args)
end

#pipeline_path(pipeline, *args) ⇒ Object


33
34
35
# File 'app/helpers/routing/projects_helper.rb', line 33

def pipeline_path(pipeline, *args)
  project_pipeline_path(pipeline.project, pipeline.id, *args)
end

#pipeline_url(pipeline, *args) ⇒ Object


45
46
47
# File 'app/helpers/routing/projects_helper.rb', line 45

def pipeline_url(pipeline, *args)
  project_pipeline_url(pipeline.project, pipeline.id, *args)
end

#project_commits_path(project, ref = nil, *args) ⇒ Object


9
10
11
# File 'app/helpers/routing/projects_helper.rb', line 9

def project_commits_path(project, ref = nil, *args)
  namespace_project_commits_path(project.namespace, project, ref || @ref || project.repository.root_ref, *args) # rubocop:disable Cop/ProjectPathHelper
end

#project_ref_path(project, ref_name, *args) ⇒ Object


13
14
15
# File 'app/helpers/routing/projects_helper.rb', line 13

def project_ref_path(project, ref_name, *args)
  project_commits_path(project, ref_name, *args)
end

#project_tree_path(project, ref = nil, *args) ⇒ Object


5
6
7
# File 'app/helpers/routing/projects_helper.rb', line 5

def project_tree_path(project, ref = nil, *args)
  namespace_project_tree_path(project.namespace, project, ref || @ref || project.repository.root_ref, *args) # rubocop:disable Cop/ProjectPathHelper
end

#release_url(entity, *args) ⇒ Object


61
62
63
# File 'app/helpers/routing/projects_helper.rb', line 61

def release_url(entity, *args)
  project_release_url(entity.project, entity, *args)
end

#toggle_subscription_path(entity, *args) ⇒ Object


73
74
75
76
77
78
79
# File 'app/helpers/routing/projects_helper.rb', line 73

def toggle_subscription_path(entity, *args)
  if entity.is_a?(Issue)
    toggle_subscription_project_issue_path(entity.project, entity)
  else
    toggle_subscription_project_merge_request_path(entity.project, entity)
  end
end