Commit c1affed1 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Add build remove button to build summary view

parent 75ad9182
......@@ -56,6 +56,12 @@ class Projects::BuildsController < Projects::ApplicationController
render json: @build.to_json(only: [:status, :id, :sha, :coverage], methods: :sha)
end
def destroy
@build.destroy
redirect_to namespace_project_builds_path(project.namespace, project),
notice: "Build ##{@build.id} has been sucessfully removed!"
end
private
def build
......
......@@ -94,9 +94,14 @@
%h4.title Build artifacts
.center
.btn-group{ role: :group }
= link_to "Download", @build.artifacts_download_url, class: 'btn btn-sm btn-primary'
= link_to @build.artifacts_download_url, class: 'btn btn-sm btn-primary' do
= icon('download')
Download
- if @build.artifacts_metadata?
= link_to "Browse", @build.artifacts_browse_url, class: 'btn btn-sm btn-primary'
= link_to @build.artifacts_browse_url, class: 'btn btn-sm btn-primary' do
= icon('folder-open')
Browse
.build-widget
%h4.title
......@@ -108,6 +113,12 @@
- elsif @build.retry_url
= link_to "Retry", @build.retry_url, class: 'btn btn-sm btn-primary', method: :post
= link_to '', class: 'btn btn-sm btn-danger', method: :delete,
data: { confirm: 'Are you sure you want to remove this?' } do
= icon('remove')
Remove
.clearfix
- if @build.duration
%p
%span.attr-name Duration:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment