diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-04-13 16:58:22 +0300 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-04-13 16:58:22 +0300 |
commit | 251a78022d12c62ff738540d4104bbf0730ef234 (patch) | |
tree | 974e0f82fcc947a6ca5abf742fc87ebd406ce4cc /app | |
parent | 4af0968c43d517a3d702658749b5117ba4b9e11a (diff) |
Cleanup changes
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/projects/pipelines_controller.rb | 0 | ||||
-rw-r--r-- | app/helpers/ci_status_helper.rb | 12 | ||||
-rw-r--r-- | app/helpers/gitlab_routing_helper.rb | 8 | ||||
-rw-r--r-- | app/views/admin/runners/show.html.haml | 2 | ||||
-rw-r--r-- | app/views/projects/_last_commit.html.haml | 2 | ||||
-rw-r--r-- | app/views/projects/builds/show.html.haml | 6 | ||||
-rw-r--r-- | app/views/projects/ci/commits/_commit.html.haml | 0 | ||||
-rw-r--r-- | app/views/projects/ci_commits/_header_title.html.haml | 0 | ||||
-rw-r--r-- | app/views/projects/ci_commits/index.html.haml | 0 | ||||
-rw-r--r-- | app/views/projects/ci_commits/new.html.haml | 0 |
10 files changed, 14 insertions, 16 deletions
diff --git a/app/controllers/projects/pipelines_controller.rb b/app/controllers/projects/pipelines_controller.rb deleted file mode 100644 index e69de29bb2d..00000000000 --- a/app/controllers/projects/pipelines_controller.rb +++ /dev/null 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 diff --git a/app/views/admin/runners/show.html.haml b/app/views/admin/runners/show.html.haml index 50d00051409..8700b4820cd 100644 --- a/app/views/admin/runners/show.html.haml +++ b/app/views/admin/runners/show.html.haml @@ -117,7 +117,7 @@ %td.build-link - if project - = link_to builds_namespace_project_commit_path(project.namespace, project, build.sha) do + = link_to ci_status_path(build.commit) do %strong #{build.commit.short_sha} %td.timestamp diff --git a/app/views/projects/_last_commit.html.haml b/app/views/projects/_last_commit.html.haml index 6eccbaa4bfa..66c30283c7a 100644 --- a/app/views/projects/_last_commit.html.haml +++ b/app/views/projects/_last_commit.html.haml @@ -1,6 +1,6 @@ .project-last-commit - if commit.status - = link_to project_commit_path(commit.project, commit), class: "ci-status ci-#{commit.status}" do + = link_to builds_namespace_project_commit_path(commit.project.namespace, commit.project, commit), class: "ci-status ci-#{commit.status}" do = ci_icon_for_status(commit.status) = ci_label_for_status(commit.status) diff --git a/app/views/projects/builds/show.html.haml b/app/views/projects/builds/show.html.haml index 20160a718bc..b50b2cf3764 100644 --- a/app/views/projects/builds/show.html.haml +++ b/app/views/projects/builds/show.html.haml @@ -4,7 +4,7 @@ .build-page .gray-content-block.top-block Build ##{@build.id} for commit - %strong.monospace= link_to @build.commit.short_sha, builds_namespace_project_commit_path(@project.namespace, @project, @build.sha) + %strong.monospace= link_to @build.commit.short_sha, ci_status_path(@build.commit) from = link_to @build.ref, namespace_project_commits_path(@project.namespace, @project, @build.ref) - merge_request = @build.merge_request @@ -173,7 +173,7 @@ Commit .pull-right %small - = link_to @build.commit.short_sha, builds_namespace_project_commit_path(@project.namespace, @project, @build.sha), class: "monospace" + = link_to @build.commit.short_sha, ci_status_path(@build.commit), class: "monospace" %p %span.attr-name Branch: = link_to @build.ref, namespace_project_commits_path(@project.namespace, @project, @build.ref) @@ -196,7 +196,7 @@ .build-widget %h4.title #{pluralize(@builds.count(:id), "other build")} for = succeed ":" do - = link_to @build.commit.short_sha, builds_namespace_project_commit_path(@project.namespace, @project, @build.sha), class: "monospace" + = link_to @build.commit.short_sha, ci_status_path(@build.commit), class: "monospace" %table.table.builds - @builds.each_with_index do |build, i| %tr.build diff --git a/app/views/projects/ci/commits/_commit.html.haml b/app/views/projects/ci/commits/_commit.html.haml deleted file mode 100644 index e69de29bb2d..00000000000 --- a/app/views/projects/ci/commits/_commit.html.haml +++ /dev/null diff --git a/app/views/projects/ci_commits/_header_title.html.haml b/app/views/projects/ci_commits/_header_title.html.haml deleted file mode 100644 index e69de29bb2d..00000000000 --- a/app/views/projects/ci_commits/_header_title.html.haml +++ /dev/null diff --git a/app/views/projects/ci_commits/index.html.haml b/app/views/projects/ci_commits/index.html.haml deleted file mode 100644 index e69de29bb2d..00000000000 --- a/app/views/projects/ci_commits/index.html.haml +++ /dev/null diff --git a/app/views/projects/ci_commits/new.html.haml b/app/views/projects/ci_commits/new.html.haml deleted file mode 100644 index e69de29bb2d..00000000000 --- a/app/views/projects/ci_commits/new.html.haml +++ /dev/null |