File: diff_file_header_component.html.haml

package info (click to toggle)
gitlab 17.6.5-19
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 629,368 kB
  • sloc: ruby: 1,915,304; javascript: 557,307; sql: 60,639; xml: 6,509; sh: 4,567; makefile: 1,239; python: 406
file content (48 lines) | stat: -rw-r--r-- 1,599 bytes parent folder | download
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
41
42
43
44
45
46
47
48
-# TODO: add file size
-# TODO: add file toggle
-# TODO: add comment button
-# TODO: add viewed toggle
-# TODO: add raw\rendered toggle
-# TODO: add file actions:
-#  * view file
-#  * view replaced file (for image diffs)
-#  * view on environment
-#  * edit
-#  * open in WebIDE
-#  * toggle file comments
-#  * submodule compare

.rd-diff-file-header{ data: { testid: 'rd-diff-file-header' } }
  .rd-diff-file-title
    - if @diff_file.submodule?
      %span
        = helpers.sprite_icon('folder-git', file_icon: true)
        %strong
          = helpers.submodule_link(@diff_file.blob, @diff_file.content_sha, @diff_file.repository)
      -# TODO: add copy button
    - else
      -# TODO: add icons for file types
      - if @diff_file.renamed_file?
        - old_path, new_path = helpers.mark_inline_diffs(@diff_file.old_path, @diff_file.new_path)
        %strong
          = old_path
        %strong
          = new_path
      - else
        %strong
          = @diff_file.file_path
        - if @diff_file.deleted_file?
          = _("deleted")
      -# TODO: add copy button
      - if @diff_file.mode_changed?
        %small #{@diff_file.a_mode} → #{@diff_file.b_mode}
      - if @diff_file.stored_externally? && @diff_file.external_storage == :lfs
        = helpers.gl_badge_tag(_('LFS'), variant: :neutral)
  .rd-diff-file-stats
    %span.rd-lines-added
      %span +
      %span{ "data-testid" => "js-file-addition-line" }= @diff_file.added_lines
    %span.rd-lines-removed
      %span −
      %span{ "data-testid" => "js-file-deletion-line" }= @diff_file.removed_lines