Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/controllers/projects/artifacts_controller.rb6
-rw-r--r--app/views/projects/artifacts/_tree_directory.html.haml5
-rw-r--r--app/views/projects/artifacts/_tree_file.html.haml5
-rw-r--r--app/views/projects/artifacts/browse.html.haml4
4 files changed, 15 insertions, 5 deletions
diff --git a/app/controllers/projects/artifacts_controller.rb b/app/controllers/projects/artifacts_controller.rb
index c1f406e3ba5..4524127e8e5 100644
--- a/app/controllers/projects/artifacts_controller.rb
+++ b/app/controllers/projects/artifacts_controller.rb
@@ -15,10 +15,8 @@ class Projects::ArtifactsController < Projects::ApplicationController
end
def browse
- path = params[:path].to_s
- @paths = artifacts_metadata.map do |_artifact_file|
- Gitlab::StringPath.new(path, artifacts_metadata)
- end
+ current_path = params[:path] ? "./#{params[:path]}/" : './'
+ @path = Gitlab::StringPath.new(current_path, artifacts_metadata)
end
private
diff --git a/app/views/projects/artifacts/_tree_directory.html.haml b/app/views/projects/artifacts/_tree_directory.html.haml
new file mode 100644
index 00000000000..a53001567c3
--- /dev/null
+++ b/app/views/projects/artifacts/_tree_directory.html.haml
@@ -0,0 +1,5 @@
+%tr{ class: 'tree-item' }
+ %td.tree-item-file-name
+ = tree_icon('folder', '755', directory.basename)
+ %span.str-truncated
+ = link_to directory.basename, browse_namespace_project_build_artifacts_path(@project.namespace, @project, @build, path: directory.path)
diff --git a/app/views/projects/artifacts/_tree_file.html.haml b/app/views/projects/artifacts/_tree_file.html.haml
new file mode 100644
index 00000000000..ad42162b50a
--- /dev/null
+++ b/app/views/projects/artifacts/_tree_file.html.haml
@@ -0,0 +1,5 @@
+%tr{ class: 'tree-item' }
+ %td.tree-item-file-name
+ = tree_icon('file', '664', file.basename)
+ %span.str-truncated
+ = file.basename
diff --git a/app/views/projects/artifacts/browse.html.haml b/app/views/projects/artifacts/browse.html.haml
index bb669ac8ba1..6dae7a9efa6 100644
--- a/app/views/projects/artifacts/browse.html.haml
+++ b/app/views/projects/artifacts/browse.html.haml
@@ -1,4 +1,6 @@
- page_title "#{@build.name} (##{@build.id})", 'Build artifacts'
- header_title project_title(@project, "Build artifacts", namespace_project_build_path(@project.namespace, @project, @build))
-= @metadata.inspect
+%table.table.table-hover
+ = render partial: 'tree_directory', collection: @path.directories, as: :directory
+ = render partial: 'tree_file', collection: @path.files, as: :file