summaryrefslogtreecommitdiff
path: root/app/views/projects/blob/_blob.html.haml
blob: fd0ae42571efc0366e6c4c09df9fd103d9c1e020 (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
41
.nav-block
  .tree-ref-holder
    = render 'shared/ref_switcher', destination: 'blob', path: @path

  %ul.breadcrumb.repo-breadcrumb
    %li
      = link_to namespace_project_tree_path(@project.namespace, @project, @ref) do
        = @project.path
    - tree_breadcrumbs(@tree, 6) do |title, path|
      %li
        - if path
          - if path.end_with?(@path)
            = link_to namespace_project_blob_path(@project.namespace, @project, path) do
              %strong
                = truncate(title, length: 40)
          - else
            = link_to truncate(title, length: 40), namespace_project_tree_path(@project.namespace, @project, path)
        - else
          = link_to title, '#'

%ul.blob-commit-info.hidden-xs
  - blob_commit = @repository.last_commit_for_path(@commit.id, blob.path)
  = render blob_commit, project: @project, ref: @ref

#blob-content-holder.blob-content-holder
  %article.file-holder
    = render "projects/blob/header", blob: blob
    - if current_user
      .js-file-fork-suggestion-section.file-fork-suggestion.hidden
        %span.file-fork-suggestion-note
          You don't have permission to edit this file. Try forking this project to edit the file.
        = link_to 'Fork', fork_path, method: :post, class: 'btn btn-grouped btn-inverted btn-new'
        %button.js-cancel-fork-suggestion.btn.btn-grouped{ type: 'button' }
          Cancel

    - if blob.empty?
      .file-content.code
        .nothing-here-block
          Empty file
    - else
      = render blob.to_partial_path(@project), blob: blob