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
path: root/app/views
diff options
context:
space:
mode:
authorNick Thomas <nick@gitlab.com>2017-10-05 18:03:17 +0300
committerNick Thomas <nick@gitlab.com>2017-10-05 18:03:17 +0300
commitce87f42dc928377abdd1dd445598afb8150d4521 (patch)
tree875d7173db44d05c67b6de45f57359bb550ec62e /app/views
parentcd60a02ad94088ae1444ac9a8b355b4d05fc30a3 (diff)
parentd1dd115356a06fd20e8b9293cd645bb064b7c56a (diff)
Merge branch '34102-online-view-of-artifacts-fe' into 'master'
Add external link for online artifacts Closes #34102 See merge request gitlab-org/gitlab-ce!14399
Diffstat (limited to 'app/views')
-rw-r--r--app/views/projects/artifacts/_tree_file.html.haml15
1 files changed, 11 insertions, 4 deletions
diff --git a/app/views/projects/artifacts/_tree_file.html.haml b/app/views/projects/artifacts/_tree_file.html.haml
index 8edb9be049a..a97ddb3c377 100644
--- a/app/views/projects/artifacts/_tree_file.html.haml
+++ b/app/views/projects/artifacts/_tree_file.html.haml
@@ -1,10 +1,17 @@
+- blob = file.blob
- path_to_file = file_project_job_artifacts_path(@project, @build, path: file.path)
+- external_link = blob.external_link?(@build)
-%tr.tree-item{ 'data-link' => path_to_file }
- - blob = file.blob
+%tr.tree-item.js-artifact-tree-row{ data: { link: path_to_file, external_link: "#{external_link}" } }
%td.tree-item-file-name
= tree_icon('file', blob.mode, blob.name)
- = link_to path_to_file do
- %span.str-truncated= blob.name
+ - if external_link
+ = link_to path_to_file, class: 'tree-item-file-external-link js-artifact-tree-tooltip',
+ target: '_blank', rel: 'noopener noreferrer', title: _('Opens in a new window') do
+ %span.str-truncated>= blob.name
+ = icon('external-link', class: 'js-artifact-tree-external-icon')
+ - else
+ = link_to path_to_file do
+ %span.str-truncated= blob.name
%td
= number_to_human_size(blob.size, precision: 2)