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

32 lines
1.1 KiB
Plaintext
Raw Normal View History

2015-04-16 13:40:46 +08:00
<%= link_to(@repository.identifier.present? ? h(@repository.identifier) : 'root',
:action => 'show', :id => @project,
:repository_id => @repository.identifier_param,
:path => nil, :rev => @rev) %>
2013-08-01 10:33:49 +08:00
<%
2015-04-16 13:40:46 +08:00
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}"
%>
2013-08-01 10:33:49 +08:00
/ <%= link_to h(dir), :action => 'show', :id => @project, :repository_id => @repository.identifier_param,
2015-04-16 13:40:46 +08:00
:path => to_path_param(link_path), :rev => @rev %>
2013-08-01 10:33:49 +08:00
<% end %>
<% if filename %>
/ <%= link_to h(filename),
2015-04-16 13:40:46 +08:00
:action => 'changes', :id => @project, :repository_id => @repository.identifier_param,
:path => to_path_param("#{link_path}/#{filename}"), :rev => @rev %>
2013-08-01 10:33:49 +08:00
<% end %>
<%
2015-04-16 13:40:46 +08:00
# @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)
2013-08-01 10:33:49 +08:00
%>
<%= "@ #{h rev_text}" unless rev_text.blank? %>
<% html_title(with_leading_slash(path)) -%>