Removes spaces in versions anchors.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8560 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2012-01-08 17:14:17 +00:00
parent 3ed0c93857
commit f1b93601b5
2 changed files with 6 additions and 2 deletions

View File

@ -328,6 +328,10 @@ module ApplicationHelper
end
end
def anchor(text)
text.to_s.gsub(' ', '_')
end
def html_hours(text)
text.gsub(%r{(\d+)\.(\d+)}, '<span class="hours hours-int">\1</span><span class="hours hours-dec">.\2</span>').html_safe
end

View File

@ -9,7 +9,7 @@
<% else %>
<div id="roadmap">
<% @versions.each do |version| %>
<h3 class="version"><%= tag 'a', :name => h(version.name) %><%= link_to_version version %></h3>
<h3 class="version"><%= tag 'a', :name => anchor(version.name) %><%= link_to_version version %></h3>
<%= render :partial => 'versions/overview', :locals => {:version => version} %>
<%= render(:partial => "wiki/content", :locals => {:content => version.wiki_page.content}) if version.wiki_page %>
@ -49,7 +49,7 @@
<h3><%= l(:label_version_plural) %></h3>
<% @versions.each do |version| %>
<%= link_to format_version_name(version), "##{version.name}" %><br />
<%= link_to format_version_name(version), :anchor => anchor(version.name) %><br />
<% end %>
<% end %>