Patch #32835 » copy-paste-friendly-repo-breadcrumbs.patch
app/views/repositories/_breadcrumbs.html.erb | ||
---|---|---|
1 |
<%= link_to(@repository.identifier.present? ? @repository.identifier : 'root', |
|
2 |
:action => 'show', :id => @project, |
|
3 |
:repository_id => @repository.identifier_param, |
|
4 |
:path => nil, :rev => @rev) %> |
|
5 | 1 |
<% |
6 | 2 |
dirs = path.split('/') |
7 | 3 |
if 'file' == kind |
8 | 4 |
filename = dirs.pop |
9 | 5 |
end |
6 | ||
7 |
breadcrumbs = [] |
|
8 |
breadcrumbs << link_to( |
|
9 |
@repository.identifier.presence || 'root', :action => 'show', |
|
10 |
:id => @project, :repository_id => @repository.identifier_param, |
|
11 |
:path => nil, :rev => @rev) |
|
10 | 12 |
link_path = '' |
13 | ||
11 | 14 |
dirs.each do |dir| |
12 | 15 |
next if dir.blank? |
16 | ||
13 | 17 |
link_path << '/' unless link_path.empty? |
14 | 18 |
link_path << "#{dir}" |
15 |
%> |
|
16 |
/ <%= link_to dir, :action => 'show', :id => @project, :repository_id => @repository.identifier_param, |
|
17 |
:path => to_path_param(link_path), :rev => @rev %> |
|
18 |
<% end %> |
|
19 |
<% if filename %> |
|
20 |
/ <%= link_to filename, |
|
21 |
:action => 'entry', :id => @project, :repository_id => @repository.identifier_param, |
|
22 |
:path => to_path_param("#{link_path}/#{filename}"), :rev => @rev %> |
|
23 |
<% end %> |
|
19 |
breadcrumbs << tag.span do |
|
20 |
link_to(dir, :action => 'show', :id => @project, |
|
21 |
:repository_id => @repository.identifier_param, |
|
22 |
:path => to_path_param(link_path), :rev => @rev) |
|
23 |
end |
|
24 |
end |
|
25 |
if filename |
|
26 |
breadcrumbs << tag.span do |
|
27 |
link_to(filename, :action => 'entry', :id => @project, |
|
28 |
:repository_id => @repository.identifier_param, |
|
29 |
:path => to_path_param("#{link_path}/#{filename}"), :rev => @rev) |
|
30 |
end |
|
31 |
end |
|
32 |
%> |
|
33 |
<%= breadcrumbs.join(tag.span('/', :class => 'separator')).html_safe -%> |
|
24 | 34 |
<% |
25 | 35 |
# @rev is revsion or Git and Mercurial branch or tag. |
26 | 36 |
# For Mercurial *tip*, @rev and @changeset are nil. |
27 | 37 |
rev_text = @changeset.nil? ? @rev : format_revision(@changeset) |
28 | 38 |
%> |
29 |
<%= "@ #{rev_text}" unless rev_text.blank? %> |
|
30 | ||
31 |
<% html_title(with_leading_slash(path)) -%> |
|
39 |
<%= " @ #{rev_text}" unless rev_text.blank? -%> |
|
40 |
<% html_title(with_leading_slash(path)) %> |
app/views/repositories/annotate.html.erb | ||
---|---|---|
4 | 4 |
<%= render :partial => 'navigation' %> |
5 | 5 |
</div> |
6 | 6 | |
7 |
<h2><%= render :partial => 'breadcrumbs', :locals => { :path => @path, :kind => 'file', :revision => @rev } %></h2> |
|
7 |
<h2 class="breadcrumbs"><%= render :partial => 'breadcrumbs', :locals => { :path => @path, :kind => 'file', :revision => @rev } %></h2>
|
|
8 | 8 | |
9 | 9 |
<%= render :partial => 'link_to_functions' %> |
10 | 10 |
app/views/repositories/changes.html.erb | ||
---|---|---|
4 | 4 |
<%= render :partial => 'navigation' %> |
5 | 5 |
</div> |
6 | 6 | |
7 |
<h2><%= render :partial => 'breadcrumbs', :locals => { :path => @path, :kind => (@entry ? @entry.kind : nil), :revision => @rev } %></h2> |
|
7 |
<h2 class="breadcrumbs"><%= render :partial => 'breadcrumbs', :locals => { :path => @path, :kind => (@entry ? @entry.kind : nil), :revision => @rev } %></h2>
|
|
8 | 8 | |
9 | 9 |
<%= render :partial => 'link_to_functions' %> |
10 | 10 |
app/views/repositories/entry.html.erb | ||
---|---|---|
4 | 4 |
<%= render :partial => 'navigation' %> |
5 | 5 |
</div> |
6 | 6 | |
7 |
<h2><%= render :partial => 'breadcrumbs', :locals => { :path => @path, :kind => 'file', :revision => @rev } %></h2> |
|
7 |
<h2 class="breadcrumbs"><%= render :partial => 'breadcrumbs', :locals => { :path => @path, :kind => 'file', :revision => @rev } %></h2>
|
|
8 | 8 | |
9 | 9 |
<%= render :partial => 'link_to_functions' %> |
10 | 10 |
app/views/repositories/show.html.erb | ||
---|---|---|
4 | 4 |
<%= render :partial => 'navigation' %> |
5 | 5 |
</div> |
6 | 6 | |
7 |
<h2><%= render :partial => 'breadcrumbs', |
|
7 |
<h2 class="breadcrumbs"><%= render :partial => 'breadcrumbs',
|
|
8 | 8 |
:locals => { :path => @path, :kind => 'dir', :revision => @rev } %></h2> |
9 | 9 | |
10 | 10 |
<% if !@entries.nil? && authorize_for('repositories', 'browse') %> |
public/stylesheets/scm.css | ||
---|---|---|
116 | 116 |
div.action_M { background: #fd8 } |
117 | 117 |
div.action_D { background: #f88 } |
118 | 118 |
div.action_A { background: #bfb } |
119 | ||
120 |
.breadcrumbs>.separator::before, .breadcrumbs>.separator::after { |
|
121 |
content: " "; |
|
122 |
} |
- « Previous
- 1
- 2
- Next »