Browse Source

Fixed: single file 'View difference' links do not work because of duplicate slashes in url.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1325 e93f8b46-1217-0410-a6f0-8f06a7374b81
tags/0.8.0-RC1
Jean-Philippe Lang 16 years ago
parent
commit
8d4aa6f9ad
2 changed files with 6 additions and 3 deletions
  1. 5
    2
      app/helpers/repositories_helper.rb
  2. 1
    1
      app/views/repositories/revision.rhtml

+ 5
- 2
app/helpers/repositories_helper.rb View File

@@ -58,8 +58,11 @@ module RepositoriesHelper
end
def with_leading_slash(path)
path ||= ''
path.starts_with?('/') ? path : "/#{path}"
path.to_s.starts_with?('/') ? path : "/#{path}"
end
def without_leading_slash(path)
path.gsub(%r{^/+}, '')
end

def subversion_field_tags(form, repository)

+ 1
- 1
app/views/repositories/revision.rhtml View File

@@ -49,7 +49,7 @@
<td><div class="square action_<%= change.action %>"></div> <%= change.path %> <%= "(#{change.revision})" unless change.revision.blank? %></td>
<td align="right">
<% if change.action == "M" %>
<%= link_to l(:label_view_diff), :action => 'diff', :id => @project, :path => change.path, :rev => @changeset.revision %>
<%= link_to l(:label_view_diff), :action => 'diff', :id => @project, :path => without_leading_slash(change.path), :rev => @changeset.revision %>
<% end %>
</td>
</tr>

Loading…
Cancel
Save