Read about our upcoming Code of Conduct on this issue

_breadcrumb.html.haml 1.25 KB
Newer Older
1
2
- blame = local_assigns.fetch(:blame, false)
.nav-block
Annabel Dunstone Gray's avatar
Annabel Dunstone Gray committed
3
4
5
6
7
  .tree-ref-container
    .tree-ref-holder
      = render 'shared/ref_switcher', destination: 'blob', path: @path

    %ul.breadcrumb.repo-breadcrumb
8
      %li.breadcrumb-item
9
        = link_to project_tree_path(@project, @ref) do
Annabel Dunstone Gray's avatar
Annabel Dunstone Gray committed
10
11
12
          = @project.path
      - path_breadcrumbs do |title, path|
        - title = truncate(title, length: 40)
13
        %li.breadcrumb-item
Annabel Dunstone Gray's avatar
Annabel Dunstone Gray committed
14
          - if path == @path
15
            = link_to project_blob_path(@project, tree_join(@ref, path)) do
Annabel Dunstone Gray's avatar
Annabel Dunstone Gray committed
16
17
              %strong= title
          - else
18
            = link_to title, project_tree_path(@project, tree_join(@ref, path))
Annabel Dunstone Gray's avatar
Annabel Dunstone Gray committed
19

20
  .tree-controls<
21
    = render 'projects/find_file_link'
22
23
24
25
26
27
28
29
    -# only show normal/blame view links for text files
    - if blob.readable_text?
      - if blame
        = link_to 'Normal view', project_blob_path(@project, @id),
            class: 'btn'
      - else
        = link_to 'Blame', project_blame_path(@project, @id),
            class: 'btn js-blob-blame-link' unless blob.empty?
30

31
32
    = link_to 'History', project_commits_path(@project, @id),
        class: 'btn'
33

34
35
    = link_to 'Permalink', project_blob_path(@project,
        tree_join(@commit.sha, @path)), class: 'btn js-data-file-blob-permalink-url'