File: _file.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 (41 lines) | stat: -rw-r--r-- 2,091 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
- environment = local_assigns.fetch(:environment, nil)
- diff_page_context = local_assigns.fetch(:diff_page_context, nil)
- file_hash = hexdigest(diff_file.file_path)
- image_diff = diff_file.rich_viewer && diff_file.rich_viewer.partial_name == 'image'
- image_replaced = diff_file.old_content_sha && diff_file.old_content_sha != diff_file.content_sha

.diff-file.file-holder{ id: file_hash, data: diff_file_html_data(project, diff_file.file_path, diff_file.content_sha) }
  .js-file-title.file-title-flex-parent{ class: diff_page_context }
    .file-header-content
      = render "projects/diffs/file_header", diff_file: diff_file, url: "##{file_hash}"

    - if diff_file.submodule?
      .file-actions.gl-hidden.sm:gl-block
        = submodule_diff_compare_link(diff_file)

    - unless diff_file.submodule?
      .file-actions.gl-hidden.sm:gl-flex
        #js-diff-stats{ data: diff_file_stats_data(diff_file) }
        - if diff_file.blob&.readable_text?
          - unless @diff_notes_disabled
            = link_button_to nil, '#', class: 'js-toggle-diff-comments has-tooltip', icon: 'comment', title: _("Toggle comments for this file")
          \
          - if editable_diff?(diff_file)
            - link_opts = @merge_request.persisted? ? { from_merge_request_iid: @merge_request.iid } : {}
            = edit_blob_button(@merge_request.source_project, @merge_request.source_branch, diff_file.new_path,
                             blob: diff_file.blob, link_opts: link_opts)

        - if diff_file.has_renderable?
          .btn-group.gl-ml-3
            = diff_mode_swap_button('rendered', file_hash)
            = diff_mode_swap_button('raw', file_hash)

        - if image_diff && image_replaced
          = view_file_button(diff_file.old_content_sha, diff_file.old_path, project, replaced: true)

        = view_file_button(diff_file.content_sha, diff_file.file_path, project)
        = view_on_environment_button(diff_file.content_sha, diff_file.file_path, environment) if environment

  = render_fork_suggestion

  = render 'projects/diffs/content', diff_file: diff_file