summaryrefslogtreecommitdiffstats
path: root/app/views/repositories/_breadcrumbs.html.erb
blob: 86fe28cb540ef0a44902cb01feffdaa75238c497 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<%= 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}"
    %>
    / <%= link_to h(dir), :action => 'show', :id => @project, :repository_id => @repository.identifier_param,
                :path => to_path_param(link_path), :rev => @rev %>
<% end %>
<% if filename %>
    / <%= link_to h(filename),
                   :action => 'changes', :id => @project, :repository_id => @repository.identifier_param,
                   :path => to_path_param("#{link_path}/#{filename}"), :rev => @rev %>
<% 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? %>

<% html_title(with_leading_slash(path)) -%>