diff --git a/app/views/repositories/_breadcrumbs.html.erb b/app/views/repositories/_breadcrumbs.html.erb index 82f25d43a..8452657e2 100644 --- a/app/views/repositories/_breadcrumbs.html.erb +++ b/app/views/repositories/_breadcrumbs.html.erb @@ -1,31 +1,40 @@ -<%= link_to(@repository.identifier.present? ? @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 + +breadcrumbs = [] +breadcrumbs << link_to( + @repository.identifier.presence || 'root', :action => 'show', + :id => @project, :repository_id => @repository.identifier_param, + :path => nil, :rev => @rev) link_path = '' + dirs.each do |dir| next if dir.blank? + link_path << '/' unless link_path.empty? link_path << "#{dir}" - %> - / <%= link_to dir, :action => 'show', :id => @project, :repository_id => @repository.identifier_param, - :path => to_path_param(link_path), :rev => @rev %> -<% end %> -<% if filename %> - / <%= link_to filename, - :action => 'entry', :id => @project, :repository_id => @repository.identifier_param, - :path => to_path_param("#{link_path}/#{filename}"), :rev => @rev %> -<% end %> + breadcrumbs << tag.span do + link_to(dir, :action => 'show', :id => @project, + :repository_id => @repository.identifier_param, + :path => to_path_param(link_path), :rev => @rev) + end +end +if filename + breadcrumbs << tag.span do + link_to(filename, :action => 'entry', :id => @project, + :repository_id => @repository.identifier_param, + :path => to_path_param("#{link_path}/#{filename}"), :rev => @rev) + end +end +%> +<%= breadcrumbs.join(tag.span('/', :class => 'separator')).html_safe -%> <% # @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) %> -<%= "@ #{rev_text}" unless rev_text.blank? %> - -<% html_title(with_leading_slash(path)) -%> +<%= " @ #{rev_text}" unless rev_text.blank? -%> +<% html_title(with_leading_slash(path)) %> diff --git a/app/views/repositories/annotate.html.erb b/app/views/repositories/annotate.html.erb index 038f01eca..829090af6 100644 --- a/app/views/repositories/annotate.html.erb +++ b/app/views/repositories/annotate.html.erb @@ -4,7 +4,7 @@ <%= render :partial => 'navigation' %> -

<%= render :partial => 'breadcrumbs', :locals => { :path => @path, :kind => 'file', :revision => @rev } %>

+ <%= render :partial => 'link_to_functions' %> diff --git a/app/views/repositories/changes.html.erb b/app/views/repositories/changes.html.erb index cd5a95585..96b532073 100644 --- a/app/views/repositories/changes.html.erb +++ b/app/views/repositories/changes.html.erb @@ -4,7 +4,7 @@ <%= render :partial => 'navigation' %> -

<%= render :partial => 'breadcrumbs', :locals => { :path => @path, :kind => (@entry ? @entry.kind : nil), :revision => @rev } %>

+ <%= render :partial => 'link_to_functions' %> diff --git a/app/views/repositories/entry.html.erb b/app/views/repositories/entry.html.erb index 940bb2dc2..99c611104 100644 --- a/app/views/repositories/entry.html.erb +++ b/app/views/repositories/entry.html.erb @@ -4,7 +4,7 @@ <%= render :partial => 'navigation' %> -

<%= render :partial => 'breadcrumbs', :locals => { :path => @path, :kind => 'file', :revision => @rev } %>

+ <%= render :partial => 'link_to_functions' %> diff --git a/app/views/repositories/show.html.erb b/app/views/repositories/show.html.erb index d96a737ae..adcce9f64 100644 --- a/app/views/repositories/show.html.erb +++ b/app/views/repositories/show.html.erb @@ -4,7 +4,7 @@ <%= render :partial => 'navigation' %> -

<%= render :partial => 'breadcrumbs', +

<% if !@entries.nil? && authorize_for('repositories', 'browse') %> diff --git a/public/stylesheets/scm.css b/public/stylesheets/scm.css index c177b07cc..4640be5f9 100644 --- a/public/stylesheets/scm.css +++ b/public/stylesheets/scm.css @@ -116,3 +116,7 @@ table.annotate td.line-code { background-color: #fafafa; } div.action_M { background: #fd8 } div.action_D { background: #f88 } div.action_A { background: #bfb } + +.breadcrumbs>.separator::before, .breadcrumbs>.separator::after { + content: " "; +}