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

33 lines
1.2 KiB
Plaintext
Raw Normal View History

2015-04-17 11:14:55 +08:00
<%= link_to @repository.identifier.present? ? h(@repository.identifier) : 'root',
{:action => 'show', :id => @project,
2015-04-16 13:40:46 +08:00
:repository_id => @repository.identifier_param,
2015-04-17 11:14:55 +08:00
:path => nil, :rev => @rev },
:class=>"fl c_blue f14 fb" %>
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-17 11:14:55 +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.
2015-04-17 11:14:55 +08:00
rev_text = @changeset.nil? ? "master" : format_revision(@changeset)
2013-08-01 10:33:49 +08:00
%>
2015-04-17 11:14:55 +08:00
<p class="fl f14 fb c_grey02"><%= "@ #{h rev_text}" unless rev_text.blank? %></p>
2013-08-01 10:33:49 +08:00
<% html_title(with_leading_slash(path)) -%>