From d8cc9e4ef7da6ac971d44361546188eebfb3beff Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Mon, 28 Dec 2015 11:10:39 +0100 Subject: Add button to CI build artifacts browser into build summary --- app/models/ci/build.rb | 7 +++++++ app/views/projects/builds/show.html.haml | 7 ++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index 347022ff29b..c69cb661746 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -328,6 +328,13 @@ module Ci end end + def artifacts_browse_url + if artifacts_file.exists? + Gitlab::Application.routes.url_helpers. + browse_namespace_project_build_artifacts_path(project.namespace, project, self) + end + end + def execute_hooks build_data = Gitlab::BuildDataBuilder.build(self) project.execute_hooks(build_data.dup, :build_hooks) diff --git a/app/views/projects/builds/show.html.haml b/app/views/projects/builds/show.html.haml index 5b7ecce86ab..937ee293bc8 100644 --- a/app/views/projects/builds/show.html.haml +++ b/app/views/projects/builds/show.html.haml @@ -91,7 +91,12 @@ - if current_user && can?(current_user, :download_build_artifacts, @project) && @build.download_url .build-widget.center - = link_to "Download artifacts", @build.download_url, class: 'btn btn-sm btn-primary' + .panel.panel-default + .panel-heading Build artifacts + .panel-body + .btn-group{ role: :group } + = link_to "Download", @build.download_url, class: 'btn btn-sm btn-primary' + = link_to "Browse", @build.artifacts_browse_url, class: 'btn btn-sm btn-primary' .build-widget %h4.title -- cgit v1.2.1