summaryrefslogtreecommitdiff
path: root/app/views/projects/diffs/_file_header.html.haml
blob: d1792826522d2b495152d10168f4f3778a19aed8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
- if local_assigns.fetch(:show_toggle, true)
  %span.diff-toggle-caret
    = sprite_icon('chevron-right', css_class: 'chevron-right gl-display-none')
    = sprite_icon('chevron-down', css_class: 'chevron-down gl-display-none')

- if diff_file.submodule?
  %span
    = sprite_icon('archive')

    %strong.file-title-name
      = submodule_link(diff_file.blob, diff_file.content_sha, diff_file.repository)

    = copy_file_path_button(diff_file.blob.path)
- else
  = conditional_link_to url.present?, url do
    = blob_icon diff_file.b_mode, diff_file.file_path

    - if diff_file.renamed_file?
      - old_path, new_path = mark_inline_diffs(diff_file.old_path, diff_file.new_path)
      %strong.file-title-name.has-tooltip.gl-word-break-all{ data: { title: diff_file.old_path, container: 'body' } }
        = old_path
      →
      %strong.file-title-name.has-tooltip.gl-word-break-all{ data: { title: diff_file.new_path, container: 'body' } }
        = new_path
    - else
      %strong.file-title-name.has-tooltip.gl-word-break-all{ data: { title: diff_file.file_path, container: 'body', qa_selector: 'file_name_content' } }
        = diff_file.file_path

      - if diff_file.deleted_file?
        = _("deleted")

  = copy_file_path_button(diff_file.file_path)

  - if diff_file.mode_changed?
    %small.gl-mr-2
      #{diff_file.a_mode} → #{diff_file.b_mode}

  - if diff_file.stored_externally? && diff_file.external_storage == :lfs
    %span.badge.label-lfs.gl-mr-2 LFS