2017-09-21 03:04:04 -04:00
|
|
|
- blob = file.blob
|
2017-10-02 17:37:38 -04:00
|
|
|
- is_external_link = external_url?(blob)
|
2017-09-21 03:04:04 -04:00
|
|
|
- path_to_file = link_to_artifact(@project, @build, file)
|
2016-01-18 04:18:16 -05:00
|
|
|
|
2017-09-20 16:35:49 -04:00
|
|
|
%tr.tree-item.js-artifact-tree-row{ data: { link: path_to_file, external_link: "#{is_external_link}" } }
|
2015-12-21 06:53:31 -05:00
|
|
|
%td.tree-item-file-name
|
2017-05-02 18:42:37 -04:00
|
|
|
= tree_icon('file', blob.mode, blob.name)
|
2017-09-20 16:35:49 -04:00
|
|
|
= link_to path_to_file,
|
2017-10-02 21:03:18 -04:00
|
|
|
class: ('tree-item-file-external-link js-artifact-tree-tooltip' if is_external_link),
|
2017-09-20 16:35:49 -04:00
|
|
|
target: ('_blank' if is_external_link),
|
|
|
|
rel: ('noopener noreferrer' if is_external_link),
|
|
|
|
title: ('Opens in a new window' if is_external_link) do
|
|
|
|
%span.str-truncated>= blob.name
|
|
|
|
- if is_external_link
|
|
|
|
= icon('external-link')
|
2016-01-04 09:07:49 -05:00
|
|
|
%td
|
2017-05-02 18:42:37 -04:00
|
|
|
= number_to_human_size(blob.size, precision: 2)
|