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 ...@@ -56,6 +56,12 @@ class Projects::BuildsController < Projects::ApplicationController
render json: @build.to_json(only: [:status, :id, :sha, :coverage], methods: :sha) render json: @build.to_json(only: [:status, :id, :sha, :coverage], methods: :sha)
end end
def destroy
@build.destroy
redirect_to namespace_project_builds_path(project.namespace, project),
notice: "Build ##{@build.id} has been sucessfully removed!"
end
private private
def build def build
......
...@@ -94,9 +94,14 @@ ...@@ -94,9 +94,14 @@
%h4.title Build artifacts %h4.title Build artifacts
.center .center
.btn-group{ role: :group } .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? - 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 .build-widget
%h4.title %h4.title
...@@ -108,23 +113,29 @@ ...@@ -108,23 +113,29 @@
- elsif @build.retry_url - elsif @build.retry_url
= link_to "Retry", @build.retry_url, class: 'btn btn-sm btn-primary', method: :post = link_to "Retry", @build.retry_url, class: 'btn btn-sm btn-primary', method: :post
- if @build.duration = 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:
#{duration_in_words(@build.finished_at, @build.started_at)}
%p %p
%span.attr-name Duration: %span.attr-name Created:
#{duration_in_words(@build.finished_at, @build.started_at)} #{time_ago_with_tooltip(@build.created_at)}
%p - if @build.finished_at
%span.attr-name Created: %p
#{time_ago_with_tooltip(@build.created_at)} %span.attr-name Finished:
- if @build.finished_at #{time_ago_with_tooltip(@build.finished_at)}
%p %p
%span.attr-name Finished: %span.attr-name Runner:
#{time_ago_with_tooltip(@build.finished_at)} - if @build.runner && current_user && current_user.admin
%p = link_to "##{@build.runner.id}", admin_runner_path(@build.runner.id)
%span.attr-name Runner: - elsif @build.runner
- if @build.runner && current_user && current_user.admin \##{@build.runner.id}
= link_to "##{@build.runner.id}", admin_runner_path(@build.runner.id)
- elsif @build.runner
\##{@build.runner.id}
- if @build.trigger_request - if @build.trigger_request
.build-widget .build-widget
......
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