summaryrefslogtreecommitdiff
path: root/app/views/projects/diffs/_file.html.haml
blob: b5aea217384daa22c2e09934e87f8f3ece010ccb (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
- environment = local_assigns.fetch(:environment, nil)
- file_hash = hexdigest(diff_file.file_path)
.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
    .file-header-content
      = render "projects/diffs/file_header", diff_file: diff_file, url: "##{file_hash}"

    - unless diff_file.submodule?
      - blob = diff_file.blob
      .file-actions.hidden-xs
        - if blob.readable_text?
          = link_to '#', class: 'js-toggle-diff-comments btn active has-tooltip', title: "Toggle comments for this file", disabled: @diff_notes_disabled do
            = icon('comment')
          \
          - if editable_diff?(diff_file)
            - link_opts = @merge_request.persisted? ? { from_merge_request_iid: @merge_request.iid } : {}
            = edit_blob_link(@merge_request.source_project, @merge_request.source_branch, diff_file.new_path,
                             blob: blob, link_opts: link_opts)

        = 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 'projects/fork_suggestion'

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