diff options
| author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-03-31 19:51:28 +0200 |
|---|---|---|
| committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-04-11 23:32:54 +0200 |
| commit | 5d69f5b46d475f34fb71dfb4e8b683e90897f1da (patch) | |
| tree | 48f268cb483ecab1d8d7e042c60931596838b1a3 /app/helpers | |
| parent | 986b4a54ee159de56a7ebe51327887b49474813b (diff) | |
| download | gitlab-ce-5d69f5b46d475f34fb71dfb4e8b683e90897f1da.tar.gz | |
Use Ci::Commit as Pipeline
Diffstat (limited to 'app/helpers')
| -rw-r--r-- | app/helpers/ci_status_helper.rb | 19 | ||||
| -rw-r--r-- | app/helpers/gitlab_routing_helper.rb | 12 |
2 files changed, 15 insertions, 16 deletions
diff --git a/app/helpers/ci_status_helper.rb b/app/helpers/ci_status_helper.rb index 8b1575d5e0c..fd2179c7af5 100644 --- a/app/helpers/ci_status_helper.rb +++ b/app/helpers/ci_status_helper.rb @@ -1,17 +1,4 @@ module CiStatusHelper - def ci_status_path(ci_commit) - project = ci_commit.project - builds_namespace_project_commit_path(project.namespace, project, ci_commit.sha) - end - - def ci_status_icon(ci_commit) - ci_icon_for_status(ci_commit.status) - end - - def ci_status_label(ci_commit) - ci_label_for_status(ci_commit.status) - end - def ci_status_with_icon(status, target = nil) content = ci_icon_for_status(status) + ' '.html_safe + ci_label_for_status(status) klass = "ci-status ci-#{status}" @@ -47,10 +34,10 @@ module CiStatusHelper end def render_ci_status(ci_commit, tooltip_placement: 'auto left') - link_to ci_status_icon(ci_commit), - ci_status_path(ci_commit), + link_to ci_icon_for_status(ci_commit.status), + project_ci_commit_path(ci_commit.project, ci_commit), class: "ci-status-link ci-status-icon-#{ci_commit.status.dasherize}", - title: "Build #{ci_status_label(ci_commit)}", + title: "Build #{ci_label_for_status(ci_commit.status)}", data: { toggle: 'tooltip', placement: tooltip_placement } end diff --git a/app/helpers/gitlab_routing_helper.rb b/app/helpers/gitlab_routing_helper.rb index f3fddef01cb..f1af8e163cd 100644 --- a/app/helpers/gitlab_routing_helper.rb +++ b/app/helpers/gitlab_routing_helper.rb @@ -25,10 +25,22 @@ module GitlabRoutingHelper namespace_project_commits_path(project.namespace, project, @ref || project.repository.root_ref) end + def project_pipelines_path(project, *args) + namespace_project_pipelines_path(project.namespace, project, *args) + end + def project_builds_path(project, *args) namespace_project_builds_path(project.namespace, project, *args) end + def project_commit_path(project, commit) + builds_namespace_project_commit_path(project.namespace, project, commit.id) + end + + def project_ci_commit_path(project, ci_commit) + builds_namespace_project_commit_path(project.namespace, project, ci_commit.sha) + end + def activity_project_path(project, *args) activity_namespace_project_path(project.namespace, project, *args) end |
