summaryrefslogtreecommitdiff
path: root/app/presenters/ci
diff options
context:
space:
mode:
Diffstat (limited to 'app/presenters/ci')
-rw-r--r--app/presenters/ci/pipeline_status_badge_presenter.rb13
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