summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-02-14 14:56:28 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-02-14 14:56:28 +0100
commit7460159ec91fc7b1ec840dc0a10aa21b3dbbf070 (patch)
treeb387d25c1e1d9ff489dcc73c808842b5af1a72e7
parent54c4e4d7066ffb8cc53e3849d7fa93c5e9ebe25e (diff)
downloadgitlab-ce-7460159ec91fc7b1ec840dc0a10aa21b3dbbf070.tar.gz
Reuse pipeline methods to preserve Law of Demeter
-rw-r--r--app/views/projects/pipelines/_info.html.haml4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/views/projects/pipelines/_info.html.haml b/app/views/projects/pipelines/_info.html.haml
index a6cd2d83bd5..e0c972aa2fb 100644
--- a/app/views/projects/pipelines/_info.html.haml
+++ b/app/views/projects/pipelines/_info.html.haml
@@ -7,9 +7,9 @@
= commit_author_link(@commit)
.header-action-buttons
- if can?(current_user, :update_pipeline, @pipeline.project)
- - if @pipeline.builds.latest.failed.any?(&:retryable?)
+ - if @pipeline.retryable?
= link_to "Retry failed", retry_namespace_project_pipeline_path(@pipeline.project.namespace, @pipeline.project, @pipeline.id), class: 'btn btn-inverted-secondary', method: :post
- - if @pipeline.builds.running_or_pending.any?
+ - if @pipeline.cancelable?
= link_to "Cancel running", cancel_namespace_project_pipeline_path(@pipeline.project.namespace, @pipeline.project, @pipeline.id), data: { confirm: 'Are you sure?' }, class: 'btn btn-danger', method: :post
- if @commit