socialforge/app/views/repositories/_breadcrumbs.html.erb

37 lines
1.7 KiB
Plaintext
Raw Normal View History

2016-11-08 12:19:21 +08:00
<% unless @path.blank? %>
<%= link_to "#{@repository.identifier.present? ? h(@repository.identifier) : 'root'}", ({:controller => 'repositories', :action => 'show', :id => @project, :repository_id => gitlab_repository(@project).try(:identifier)}), :class => "c_blue f14 fb" %>
<%#= link_to(@repository.identifier.present? ? h(@repository.identifier) : 'root',
:action => 'show', :id => @project,
:repository_id => @repository.identifier_param,
:path => nil, :rev => @rev)
%>
<%
dirs = path.split('/')
if 'file' == kind
filename = dirs.pop
end
link_path = ''
dirs.each do |dir|
next if dir.blank?
link_path << '/' unless link_path.empty?
link_path << "#{dir}"
%>
<span class="c_grey">/</span> <%= link_to h(dir), {:action => 'show', :id => @project, :repository_id => @repository.identifier_param,
:path => to_path_param(link_path), :rev => @rev}, :class => "f14 fb" %>
<% end %>
<% if filename %>
<span class="c_grey">/</span> <%= link_to h(filename),
{:action => 'changes', :id => @project, :repository_id => @repository.identifier_param,
:path => to_path_param("#{link_path}/#{filename}"), :rev => @rev}, :class => "f14 fb" %>
<% end %>
<%
# @rev is revsion or Git and Mercurial branch or tag.
# For Mercurial *tip*, @rev and @changeset are nil.
rev_text = @changeset.nil? ? @rev : format_revision(@changeset)
%>
<%#= "@ #{h rev_text}" unless rev_text.blank? %>
<% end %>
2013-08-01 10:33:49 +08:00
<% html_title(with_leading_slash(path)) -%>