diff --git a/app/helpers/ci_status_helper.rb b/app/helpers/ci_status_helper.rb
index 8e19752a8a1142565450fe635345ca277e52cd70..d9f5e01f0dcb0a9a8a11c73e228fb8e336b27957 100644
--- a/app/helpers/ci_status_helper.rb
+++ b/app/helpers/ci_status_helper.rb
@@ -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
diff --git a/app/views/admin/runners/show.html.haml b/app/views/admin/runners/show.html.haml
index 73038164056f7be693c666305358da2b631f3f8b..fa8be25ffa86388fb83d03bd8de2fd35cc96e0ac 100644
--- a/app/views/admin/runners/show.html.haml
+++ b/app/views/admin/runners/show.html.haml
@@ -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
diff --git a/app/views/ci/status/_icon_with_label.html.haml b/app/views/ci/status/_icon_with_label.html.haml
new file mode 100644
index 0000000000000000000000000000000000000000..65a74e88444ce91f9d43b407dbde5600a0e66786
--- /dev/null
+++ b/app/views/ci/status/_icon_with_label.html.haml
@@ -0,0 +1,10 @@
+- 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
diff --git a/app/views/projects/builds/_header.html.haml b/app/views/projects/builds/_header.html.haml
index f6aa20c4579cb154b87ac4573d8d3ade684eff21..5e4e30f08d5a6d04117dcc9e140ad9947188ae62 100644
--- a/app/views/projects/builds/_header.html.haml
+++ b/app/views/projects/builds/_header.html.haml
@@ -1,6 +1,6 @@
 .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
diff --git a/app/views/projects/ci/builds/_build.html.haml b/app/views/projects/ci/builds/_build.html.haml
index 18b3b04154f4936ec7c99350572a775fb19d4a6d..6b0cd3e49a04188b031bff8e664b311c0f96b91b 100644
--- a/app/views/projects/ci/builds/_build.html.haml
+++ b/app/views/projects/ci/builds/_build.html.haml
@@ -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)
diff --git a/app/views/projects/ci/pipelines/_pipeline.html.haml b/app/views/projects/ci/pipelines/_pipeline.html.haml
index b58dceb58c9cdb3edae8c67599bb96144fe66d14..84243e4306dca67f52f0c2d1c1f3d01ccd06dceb 100644
--- a/app/views/projects/ci/pipelines/_pipeline.html.haml
+++ b/app/views/projects/ci/pipelines/_pipeline.html.haml
@@ -1,13 +1,10 @@
 - 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
diff --git a/app/views/projects/generic_commit_statuses/_generic_commit_status.html.haml b/app/views/projects/generic_commit_statuses/_generic_commit_status.html.haml
index 7f751d9ae2e87c032cee2abdb2e2d928098b541b..69cb1631ee8762172bb7ac856cd86dc8829e9ec3 100644
--- a/app/views/projects/generic_commit_statuses/_generic_commit_status.html.haml
+++ b/app/views/projects/generic_commit_statuses/_generic_commit_status.html.haml
@@ -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
diff --git a/app/views/projects/pipelines/_info.html.haml b/app/views/projects/pipelines/_info.html.haml
index 229bdfb0e8d983c9f996d92837ec9253cdefac45..f7385184a2b8f52281ca489d2d0ffd8c7cf01c4e 100644
--- a/app/views/projects/pipelines/_info.html.haml
+++ b/app/views/projects/pipelines/_info.html.haml
@@ -1,6 +1,6 @@
 .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)