summaryrefslogtreecommitdiff
path: root/app/views/projects/artifacts/_tree_file.html.haml
blob: 4d31fe42723e80ef557fea9f758ced2fb0ae891d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
- blob = file.blob
- is_external_link = blob.external_link?
- path_to_file = file_project_job_artifacts_path(@project, @build, path: file.path)

%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', class: 'js-artifact-tree-external-icon')
  %td
    = number_to_human_size(blob.size, precision: 2)