diff options
author | Rydkin Maxim <maks.rydkin@gmail.com> | 2017-03-21 01:05:52 +0300 |
---|---|---|
committer | Rydkin Maxim <maks.rydkin@gmail.com> | 2017-04-04 21:11:25 +0300 |
commit | 63dbdb9f52d1aa56cbf1e15022623c306083fdd1 (patch) | |
tree | 3522813727c995ca4130a2332912e12c55b61d4a /app/presenters | |
parent | 4f748f74bc561ed6cc37f2c57077e72c0cda8c9a (diff) |
add presenter for status badge
Diffstat (limited to 'app/presenters')
-rw-r--r-- | app/presenters/ci/pipeline_status_badge_presenter.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/app/presenters/ci/pipeline_status_badge_presenter.rb b/app/presenters/ci/pipeline_status_badge_presenter.rb new file mode 100644 index 00000000000..bc6601c8a7f --- /dev/null +++ b/app/presenters/ci/pipeline_status_badge_presenter.rb @@ -0,0 +1,13 @@ +module Ci + class PipelineStatusBadgePresenter < Gitlab::View::Presenter::Delegated + presents :pipeline + + def auto_canceled? + canceled? && auto_canceled_by_id? + end + + def status_title + "Pipeline is redundant and is auto-canceled by Pipeline ##{pipeline.auto_canceled_by_id}" if auto_canceled? + end + end +end |