You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

_breadcrumbs.html.erb 1.1KB

123456789101112131415161718192021222324252627282930313233343536
  1. <%
  2. dirs = path.split('/')
  3. if 'file' == kind
  4. filename = dirs.pop
  5. end
  6. breadcrumbs = []
  7. breadcrumbs << link_to(
  8. @repository.identifier.presence || 'root', :action => 'show',
  9. :id => @project, :repository_id => @repository.identifier_param,
  10. :path => nil, :rev => @rev)
  11. link_path = ''
  12. dirs.each do |dir|
  13. next if dir.blank?
  14. link_path << '/' unless link_path.empty?
  15. link_path << "#{dir}"
  16. breadcrumbs << link_to(dir, :action => 'show', :id => @project,
  17. :repository_id => @repository.identifier_param,
  18. :path => to_path_param(link_path), :rev => @rev)
  19. end
  20. if filename
  21. breadcrumbs << link_to(filename, :action => 'entry', :id => @project,
  22. :repository_id => @repository.identifier_param,
  23. :path => to_path_param("#{link_path}/#{filename}"), :rev => @rev)
  24. end
  25. %>
  26. <%= breadcrumbs.join(tag.span('/', :class => 'separator')).html_safe -%>
  27. <%
  28. # @rev is revsion or Git and Mercurial branch or tag.
  29. # For Mercurial *tip*, @rev and @changeset are nil.
  30. rev_text = @changeset.nil? ? @rev : format_revision(@changeset)
  31. %>
  32. <%= " @ #{rev_text}" unless rev_text.blank? -%>
  33. <% html_title(with_leading_slash(path)) %>