BigW Consortium Gitlab

Commit 25756618 by Rydkin Maxim

replace helper with decorator

parent b9f7d4b4
...@@ -121,8 +121,4 @@ module CiStatusHelper ...@@ -121,8 +121,4 @@ module CiStatusHelper
status.respond_to?(:label) && status.respond_to?(:label) &&
status.respond_to?(:icon) status.respond_to?(:icon)
end end
def status_title(pipeline)
Ci::PipelinePresenter.new(pipeline).status_title
end
end end
...@@ -4,6 +4,7 @@ module Ci ...@@ -4,6 +4,7 @@ module Ci
include HasStatus include HasStatus
include Importable include Importable
include AfterCommitQueue include AfterCommitQueue
include Presentable
belongs_to :project belongs_to :project
belongs_to :user belongs_to :user
......
...@@ -84,6 +84,6 @@ class PipelineEntity < Grape::Entity ...@@ -84,6 +84,6 @@ class PipelineEntity < Grape::Entity
end end
def status_tooltip def status_tooltip
Ci::PipelinePresenter.new(pipeline).status_title pipeline.present(current_user: request.user).status_title
end end
end end
- pipeline = @build.pipeline.present(current_user: current_user)
.content-block.build-header.top-area .content-block.build-header.top-area
.header-content .header-content
= render 'ci/status/badge', status: @build.detailed_status(current_user), link: false, title: status_title(@build.pipeline) = render 'ci/status/badge', status: @build.detailed_status(current_user), link: false, title: pipeline.status_title
Job Job
%strong.js-build-id ##{@build.id} %strong.js-build-id ##{@build.id}
in pipeline in pipeline
= link_to pipeline_path(@build.pipeline) do = link_to pipeline_path(pipeline) do
%strong ##{@build.pipeline.id} %strong ##{pipeline.id}
for commit for commit
= link_to namespace_project_commit_path(@project.namespace, @project, @build.pipeline.sha) do = link_to namespace_project_commit_path(@project.namespace, @project, pipeline.sha) do
%strong= @build.pipeline.short_sha %strong= pipeline.short_sha
from from
= link_to namespace_project_commits_path(@project.namespace, @project, @build.ref) do = link_to namespace_project_commits_path(@project.namespace, @project, @build.ref) do
%code %code
......
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