diff options
| author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-04-13 15:58:22 +0200 |
|---|---|---|
| committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-04-13 15:58:22 +0200 |
| commit | 251a78022d12c62ff738540d4104bbf0730ef234 (patch) | |
| tree | 974e0f82fcc947a6ca5abf742fc87ebd406ce4cc /app/helpers | |
| parent | 4af0968c43d517a3d702658749b5117ba4b9e11a (diff) | |
| download | gitlab-ce-251a78022d12c62ff738540d4104bbf0730ef234.tar.gz | |
Cleanup changes
Diffstat (limited to 'app/helpers')
| -rw-r--r-- | app/helpers/ci_status_helper.rb | 12 | ||||
| -rw-r--r-- | app/helpers/gitlab_routing_helper.rb | 8 |
2 files changed, 9 insertions, 11 deletions
diff --git a/app/helpers/ci_status_helper.rb b/app/helpers/ci_status_helper.rb index effa7ce77e1..417050b4132 100644 --- a/app/helpers/ci_status_helper.rb +++ b/app/helpers/ci_status_helper.rb @@ -1,4 +1,9 @@ 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_with_icon(status, target = nil) content = ci_icon_for_status(status) + ' '.html_safe + ci_label_for_status(status) klass = "ci-status ci-#{status}" @@ -34,10 +39,11 @@ module CiStatusHelper end def render_ci_status(ci_commit, tooltip_placement: 'auto left') - return unless ci_commit.is_a?(Commit) || ci_commit.is_a?(Ci::Commit) - + # TODO: split this method into + # - render_commit_status + # - render_pipeline_status link_to ci_icon_for_status(ci_commit.status), - project_ci_commit_path(ci_commit.project, ci_commit), + ci_status_path(ci_commit), class: "ci-status-link ci-status-icon-#{ci_commit.status.dasherize}", title: "Build #{ci_label_for_status(ci_commit.status)}", data: { toggle: 'tooltip', placement: tooltip_placement } diff --git a/app/helpers/gitlab_routing_helper.rb b/app/helpers/gitlab_routing_helper.rb index f1af8e163cd..f07eff3fb57 100644 --- a/app/helpers/gitlab_routing_helper.rb +++ b/app/helpers/gitlab_routing_helper.rb @@ -33,14 +33,6 @@ module GitlabRoutingHelper 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 |
