debian-mirror-gitlab/app/views/projects/blob/_breadcrumb.html.haml
2023-05-27 22:25:52 +05:30

35 lines
1.4 KiB
Text

- blame = local_assigns.fetch(:blame, false)
.nav-block
.tree-ref-container
.tree-ref-holder
#js-tree-ref-switcher{ data: { project_id: @project.id, project_root_path: project_path(@project), ref: current_ref, ref_type: @ref_type.to_s } }
%ul.breadcrumb.repo-breadcrumb
%li.breadcrumb-item
= link_to project_tree_path(@project, @ref) do
= @project.path
- path_breadcrumbs do |title, path|
- title = truncate(title, length: 40)
%li.breadcrumb-item
- if path == @path
= link_to project_blob_path(@project, tree_join(@ref, path)) do
%strong= title
- else
= link_to title, project_tree_path(@project, tree_join(@ref, path))
.tree-controls.gl-children-ml-sm-3<
= render 'projects/find_file_link'
-# 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: 'gl-button btn btn-default'
- else
= link_to 'Blame', project_blame_path(@project, @id),
class: 'gl-button btn btn-default js-blob-blame-link' unless blob.empty?
= link_to 'History', project_commits_path(@project, @id),
class: 'gl-button btn btn-default'
= link_to 'Permalink', project_blob_path(@project,
tree_join(@commit.sha, @path)), class: 'gl-button btn btn-default js-data-file-blob-permalink-url'