diff options
author | Valery Sizov <valery@gitlab.com> | 2015-01-23 14:49:12 -0800 |
---|---|---|
committer | Valery Sizov <valery@gitlab.com> | 2015-01-23 14:55:47 -0800 |
commit | 23f0e93d4b02ced8a010f8f74def0bf286fc6ae5 (patch) | |
tree | 17d521fa3f43939e51e807357dce9c7af8cac46a /app | |
parent | 3540fb595542b690806d83412f93e2e651c029d4 (diff) | |
download | gitlab-ci-23f0e93d4b02ced8a010f8f74def0bf286fc6ae5.tar.gz |
disable retry button for old builds
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/builds_controller.rb | 4 | ||||
-rw-r--r-- | app/views/builds/_build.html.haml | 2 | ||||
-rw-r--r-- | app/views/builds/show.html.haml | 2 |
3 files changed, 6 insertions, 2 deletions
diff --git a/app/controllers/builds_controller.rb b/app/controllers/builds_controller.rb index d8ebcc0..93c44e9 100644 --- a/app/controllers/builds_controller.rb +++ b/app/controllers/builds_controller.rb @@ -34,6 +34,10 @@ class BuildsController < ApplicationController end def retry + if @build.commands.blank? + return page_404 + end + build = Build.retry(@build) if params[:return_to] diff --git a/app/views/builds/_build.html.haml b/app/views/builds/_build.html.haml index 2cd3d7c..271ceed 100644 --- a/app/views/builds/_build.html.haml +++ b/app/views/builds/_build.html.haml @@ -44,6 +44,6 @@ - if build.active? = link_to cancel_project_build_path(build.project, build, return_to: request.original_url), title: 'Cancel build' do %i.icon-remove.cred - - else + - elsif build.commands.present? = link_to retry_project_build_path(build.project, build, return_to: request.original_url), method: :post, title: 'Retry build' do %i.icon-repeat diff --git a/app/views/builds/show.html.haml b/app/views/builds/show.html.haml index d1a0844..9d8a933 100644 --- a/app/views/builds/show.html.haml +++ b/app/views/builds/show.html.haml @@ -86,7 +86,7 @@ .pull-right - if @build.active? = link_to "Cancel", cancel_project_build_path(@project, @build), class: 'btn btn-sm btn-danger' - - else + - elsif @build.commands.present? = link_to "Retry", retry_project_build_path(@project, @build), class: 'btn btn-sm btn-primary', method: :post - if @build.duration |