gitlab-org--gitlab-foss/app/views/projects/artifacts/_tree_file.html.haml

18 lines
740 B
Text
Raw Normal View History

- blob = file.blob
- is_external_link = external_url?(blob)
- path_to_file = link_to_artifact(@project, @build, file)
2016-01-18 04:18:16 -05:00
%tr.tree-item.js-artifact-tree-row{ data: { link: path_to_file, external_link: "#{is_external_link}" } }
%td.tree-item-file-name
= tree_icon('file', blob.mode, blob.name)
= link_to path_to_file,
class: ('tree-item-file-external-link js-artifact-tree-tooltip' if is_external_link),
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')
%td
= number_to_human_size(blob.size, precision: 2)