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

18 lines
795 B
Plaintext
Raw Normal View History

- blob = file.blob
2017-10-03 10:34:24 +00:00
- path_to_file = file_project_job_artifacts_path(@project, @build, path: file.path)
2017-10-05 10:41:22 +00:00
- external_link = blob.external_link?(@build)
2016-01-18 09:18:16 +00:00
2017-10-04 19:01:27 +00:00
%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)
2017-10-04 19:01:27 +00:00
- if external_link
2017-12-04 11:00:52 +00:00
= link_to path_to_file, class: 'tree-item-file-external-link js-artifact-tree-tooltip str-truncated',
2017-10-04 16:15:31 +00:00
target: '_blank', rel: 'noopener noreferrer', title: _('Opens in a new window') do
2017-12-04 11:00:52 +00:00
%span>= blob.name
2017-10-03 05:33:13 +00:00
= icon('external-link', class: 'js-artifact-tree-external-icon')
2017-10-04 16:15:31 +00:00
- else
2017-12-04 11:00:52 +00:00
= link_to path_to_file, class: 'str-truncated' do
%span= blob.name
%td
= number_to_human_size(blob.size, precision: 2)