replace helper with decorator

This commit is contained in:
Rydkin Maxim 2017-03-28 23:27:16 +03:00
parent b9f7d4b45e
commit 2575661865
4 changed files with 9 additions and 10 deletions

View file

@ -121,8 +121,4 @@ module CiStatusHelper
status.respond_to?(:label) &&
status.respond_to?(:icon)
end
def status_title(pipeline)
Ci::PipelinePresenter.new(pipeline).status_title
end
end

View file

@ -4,6 +4,7 @@ module Ci
include HasStatus
include Importable
include AfterCommitQueue
include Presentable
belongs_to :project
belongs_to :user

View file

@ -84,6 +84,6 @@ class PipelineEntity < Grape::Entity
end
def status_tooltip
Ci::PipelinePresenter.new(pipeline).status_title
pipeline.present(current_user: request.user).status_title
end
end

View file

@ -1,14 +1,16 @@
- pipeline = @build.pipeline.present(current_user: current_user)
.content-block.build-header.top-area
.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
%strong.js-build-id ##{@build.id}
in pipeline
= link_to pipeline_path(@build.pipeline) do
%strong ##{@build.pipeline.id}
= link_to pipeline_path(pipeline) do
%strong ##{pipeline.id}
for commit
= link_to namespace_project_commit_path(@project.namespace, @project, @build.pipeline.sha) do
%strong= @build.pipeline.short_sha
= link_to namespace_project_commit_path(@project.namespace, @project, pipeline.sha) do
%strong= pipeline.short_sha
from
= link_to namespace_project_commits_path(@project.namespace, @project, @build.ref) do
%code