BigW Consortium Gitlab

Commit feaf0180 by Kamil Trzcinski Committed by Grzegorz Bizon

Remove ci_status_with_icon helper and replace it with partial [ci skip]

parent a83a80ed
......@@ -4,25 +4,7 @@ module CiStatusHelper
builds_namespace_project_commit_path(project.namespace, project, pipeline.sha)
end
def ci_status_with_icon(status, target = nil)
content = ci_icon_for_status(status) + ci_text_for_status(status)
klass = "ci-status ci-#{status}"
if target
link_to content, target, class: klass
else
content_tag :span, content, class: klass
end
end
def ci_text_for_status(status)
if detailed_status?(status)
status.text
else
status
end
end
# Is used by Commit and Merge Request Widget
def ci_label_for_status(status)
if detailed_status?(status)
return status.label
......
......@@ -91,7 +91,7 @@
%strong ##{build.id}
%td.status
= ci_status_with_icon(build.status)
= render "ci/status/icon_with_label", subject: build
%td.status
- if project
......
- details_path = subject.details_path if subject.has_details?(current_user)
- klass = "ci-status ci-#{subject.status}"
- if details_path
= link_to details_path, class: klass do
= custom_icon(status.icon)
= status.text
- else
%span{ class: klass }
= custom_icon(status.icon)
= status.text
.content-block.build-header
.header-content
= ci_status_with_icon(@build.status)
= render "ci/status/icon_with_label", subject: build
Build
%strong ##{@build.id}
in pipeline
......
......@@ -9,10 +9,7 @@
%tr.build.commit{class: ('retried' if retried)}
%td.status
- if can?(current_user, :read_build, build)
= ci_status_with_icon(build.status, namespace_project_build_url(build.project.namespace, build.project, build))
- else
= ci_status_with_icon(build.status)
= render "ci/status/icon_with_label", subject: build
%td.branch-commit
- if can?(current_user, :read_build, build)
......
- status = pipeline.status
- detailed_status = pipeline.detailed_status
- show_commit = local_assigns.fetch(:show_commit, true)
- show_branch = local_assigns.fetch(:show_branch, true)
%tr.commit
%td.commit-link
= link_to namespace_project_pipeline_path(pipeline.project.namespace, pipeline.project, pipeline.id), class: "ci-status ci-#{detailed_status}" do
= ci_icon_for_status(detailed_status)
= ci_text_for_status(detailed_status)
= render "ci/status/icon_with_label", subject: pipeline
%td
= link_to namespace_project_pipeline_path(pipeline.project.namespace, pipeline.project, pipeline.id) do
......
......@@ -8,10 +8,7 @@
%tr.generic_commit_status{class: ('retried' if retried)}
%td.status
- if can?(current_user, :read_commit_status, generic_commit_status) && generic_commit_status.target_url
= ci_status_with_icon(generic_commit_status.status, generic_commit_status.target_url)
- else
= ci_status_with_icon(generic_commit_status.status)
= render "ci/status/icon_with_label", subject: generic_commit_status
%td.generic_commit_status-link
- if can?(current_user, :read_commit_status, generic_commit_status) && generic_commit_status.target_url
......
.page-content-header
.header-main-content
= ci_status_with_icon(@pipeline.detailed_status)
= render "ci/status/icon_with_label", subject: @pipeline
%strong Pipeline ##{@commit.pipelines.last.id}
triggered #{time_ago_with_tooltip(@commit.authored_date)} by
= author_avatar(@commit, size: 24)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment