Patch #32835 » copy-paste-friendly-repo-breadcrumbs.patch
| app/views/repositories/_breadcrumbs.html.erb | ||
|---|---|---|
|
<%= 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)) %>
|
||
| app/views/repositories/annotate.html.erb | ||
|---|---|---|
|
<%= render :partial => 'navigation' %>
|
||
|
</div>
|
||
|
<h2><%= render :partial => 'breadcrumbs', :locals => { :path => @path, :kind => 'file', :revision => @rev } %></h2>
|
||
|
<h2 class="breadcrumbs"><%= render :partial => 'breadcrumbs', :locals => { :path => @path, :kind => 'file', :revision => @rev } %></h2>
|
||
|
<%= render :partial => 'link_to_functions' %>
|
||
| app/views/repositories/changes.html.erb | ||
|---|---|---|
|
<%= render :partial => 'navigation' %>
|
||
|
</div>
|
||
|
<h2><%= render :partial => 'breadcrumbs', :locals => { :path => @path, :kind => (@entry ? @entry.kind : nil), :revision => @rev } %></h2>
|
||
|
<h2 class="breadcrumbs"><%= render :partial => 'breadcrumbs', :locals => { :path => @path, :kind => (@entry ? @entry.kind : nil), :revision => @rev } %></h2>
|
||
|
<%= render :partial => 'link_to_functions' %>
|
||
| app/views/repositories/entry.html.erb | ||
|---|---|---|
|
<%= render :partial => 'navigation' %>
|
||
|
</div>
|
||
|
<h2><%= render :partial => 'breadcrumbs', :locals => { :path => @path, :kind => 'file', :revision => @rev } %></h2>
|
||
|
<h2 class="breadcrumbs"><%= render :partial => 'breadcrumbs', :locals => { :path => @path, :kind => 'file', :revision => @rev } %></h2>
|
||
|
<%= render :partial => 'link_to_functions' %>
|
||
| app/views/repositories/show.html.erb | ||
|---|---|---|
|
<%= render :partial => 'navigation' %>
|
||
|
</div>
|
||
|
<h2><%= render :partial => 'breadcrumbs',
|
||
|
<h2 class="breadcrumbs"><%= render :partial => 'breadcrumbs',
|
||
|
:locals => { :path => @path, :kind => 'dir', :revision => @rev } %></h2>
|
||
|
<% if !@entries.nil? && authorize_for('repositories', 'browse') %>
|
||
| public/stylesheets/scm.css | ||
|---|---|---|
|
div.action_M { background: #fd8 }
|
||
|
div.action_D { background: #f88 }
|
||
|
div.action_A { background: #bfb }
|
||
|
.breadcrumbs>.separator::before, .breadcrumbs>.separator::after {
|
||
|
content: " ";
|
||
|
}
|
||
- « Previous
- 1
- 2
- Next »