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

18 lines
795 B
Text
Raw Normal View History

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