summaryrefslogtreecommitdiff
path: root/app/views/projects/diffs/_file.html.haml
blob: c83ed55efe120d8b73b1703c98bd25418043c3ee (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
.diff-file.file-holder{id: "diff-#{i}", data: diff_file_html_data(project, diff_file)}
  .file-title{id: "file-path-#{hexdigest(diff_file.file_path)}"}
    = render "projects/diffs/file_header", diff_file: diff_file, blob: blob, diff_commit: diff_commit, project: project, url: "#diff-#{i}"

    - unless diff_file.submodule?
      .file-actions.hidden-xs
        - if blob_text_viewable?(blob)
          = link_to '#', class: 'js-toggle-diff-comments btn active has-tooltip btn-file-option', title: "Toggle comments for this file" do
            = icon('comment')
          \

        - if editable_diff?(diff_file)
          = edit_blob_link(@merge_request.source_project,
              @merge_request.source_branch, diff_file.new_path,
              from_merge_request_id: @merge_request.id)

        = view_file_btn(diff_commit.id, diff_file, project)

  - if diff_file.collapsed_by_default?
    - url = url_for(params.merge(action: :diff_for_path, path: diff_file.file_path, format: nil))
    .diff-content.diff-wrap-lines{data: { diff_for_path: url }}
      .nothing-here-block File hidden by default; content for this element available at #{url}
  - else
    = render 'projects/diffs/content', diff_file: diff_file, diff_commit: diff_commit, diff_refs: diff_refs, blob: blob, project: project