Project

General

Profile

Defect #9660 ยป fixed_roadmap_links.diff

Danil Tashkinov, 2014-05-13 15:25

View differences:

app/helpers/application_helper.rb
end
end
def version_issues_cpath(version, options = {})
options = { :fixed_version_id => version, :set_filter => 1 }.merge(options)
project = case version.sharing
when 'hierarchy', 'tree'
version.project.root if version.project.root.visible?
when 'system'
nil
else
version.project
end
project ? project_issues_path(project, options) : issues_path(options)
end
private
def wiki_helper
app/views/versions/_overview.html.erb
<%= progress_bar([version.closed_percent, version.completed_percent],
:width => '40em', :legend => ('%0.0f%' % version.completed_percent)) %>
<p class="progress-info">
<%= link_to(l(:label_x_issues, :count => version.issues_count),
project_issues_path(version.project,
:status_id => '*', :fixed_version_id => version,
:set_filter => 1)) %>
&nbsp;
(<%= link_to_if(version.closed_issues_count > 0,
l(:label_x_closed_issues_abbr, :count => version.closed_issues_count),
project_issues_path(version.project, :status_id => 'c',
:fixed_version_id => version, :set_filter => 1)) %>
&#8212;
<%= link_to_if(version.open_issues_count > 0,
l(:label_x_open_issues_abbr, :count => version.open_issues_count),
project_issues_path(version.project, :status_id => 'o',
:fixed_version_id => version, :set_filter => 1)) %>)
<%= link_to(l(:label_x_issues, :count => version.issues_count),
version_issues_cpath(version, :status_id => '*')) %>
&nbsp;
(<%= link_to_if(version.closed_issues_count > 0,
l(:label_x_closed_issues_abbr, :count => version.closed_issues_count),
version_issues_cpath(version, :status_id => 'c')) %>
&#8212;
<%= link_to_if(version.open_issues_count > 0,
l(:label_x_open_issues_abbr, :count => version.open_issues_count),
version_issues_cpath(version, :status_id => 'o')) %>)
</p>
<% else %>
<p class="progress-info"><%= l(:label_roadmap_no_issues) %></p>
test/unit/helpers/application_helper_test.rb
board_url = {:controller => 'boards', :action => 'show', :id => 2, :project_id => 'ecookbook'}
message_url = {:controller => 'messages', :action => 'show', :board_id => 1, :id => 4}
news_url = {:controller => 'news', :action => 'show', :id => 1}
project_url = {:controller => 'projects', :action => 'show', :id => 'subproject1'}
......
def test_pre_content_should_not_parse_wiki_and_redmine_links
raw = <<-RAW
[[CookBook documentation]]
#1
<pre>
[[CookBook documentation]]
#1
</pre>
RAW
......
assert_equal "#{ja} #{ja}...", result
assert !result.html_safe?
end
def test_version_issues_cpath_sharing_none
version = Version.new(:name => 'test', :sharing => 'none')
version.project = Project.find(5)
assert_match '/projects/private-child/issues?', version_issues_cpath(version)
end
def test_version_issues_cpath_sharing_descendants
version = Version.new(:name => 'test', :sharing => 'descendants')
version.project = Project.find(5)
assert_match '/projects/private-child/issues?', version_issues_cpath(version)
end
def test_version_issues_cpath_sharing_hierarchy
version = Version.new(:name => 'test', :sharing => 'hierarchy')
version.project = Project.find(5)
assert_match '/projects/ecookbook/issues?', version_issues_cpath(version)
end
def test_version_issues_cpath_sharing_tree
version = Version.new(:name => 'test', :sharing => 'tree')
version.project = Project.find(5)
assert_match '/projects/ecookbook/issues?', version_issues_cpath(version)
end
def test_version_issues_cpath_sharing_system
version = Version.new(:name => 'test', :sharing => 'system')
version.project = Project.find(5)
assert_match /^\/issues\?/, version_issues_cpath(version)
end
end
    (1-1/1)