mirror of
https://github.com/meineerde/redmine.git
synced 2025-12-19 23:11:12 +00:00
Adds version date as title in #link_to_version (#17431).
git-svn-id: http://svn.redmine.org/redmine/trunk@13324 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
8d982736e0
commit
579d687580
@ -160,6 +160,7 @@ module ApplicationHelper
|
|||||||
# Generates a link to a version
|
# Generates a link to a version
|
||||||
def link_to_version(version, options = {})
|
def link_to_version(version, options = {})
|
||||||
return '' unless version && version.is_a?(Version)
|
return '' unless version && version.is_a?(Version)
|
||||||
|
options = {:title => format_date(version.effective_date)}.merge(options)
|
||||||
link_to_if version.visible?, format_version_name(version), version_path(version), options
|
link_to_if version.visible?, format_version_name(version), version_path(version), options
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -184,7 +185,7 @@ module ApplicationHelper
|
|||||||
when 'Project'
|
when 'Project'
|
||||||
html ? link_to_project(object) : object.to_s
|
html ? link_to_project(object) : object.to_s
|
||||||
when 'Version'
|
when 'Version'
|
||||||
html ? link_to(object.name, version_path(object)) : object.to_s
|
html ? link_to_version(object) : object.to_s
|
||||||
when 'TrueClass'
|
when 'TrueClass'
|
||||||
l(:general_text_Yes)
|
l(:general_text_Yes)
|
||||||
when 'FalseClass'
|
when 'FalseClass'
|
||||||
|
|||||||
@ -816,7 +816,7 @@ class IssuesControllerTest < ActionController::TestCase
|
|||||||
def test_index_with_fixed_version_column
|
def test_index_with_fixed_version_column
|
||||||
get :index, :set_filter => 1, :c => %w(fixed_version)
|
get :index, :set_filter => 1, :c => %w(fixed_version)
|
||||||
assert_select 'table.issues td.fixed_version' do
|
assert_select 'table.issues td.fixed_version' do
|
||||||
assert_select 'a[href=?]', '/versions/2', :text => '1.0'
|
assert_select 'a[href=?]', '/versions/2', :text => 'eCookbook - 1.0'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -42,12 +42,19 @@ class ProjectsHelperTest < ActionView::TestCase
|
|||||||
def test_link_to_version_within_project
|
def test_link_to_version_within_project
|
||||||
@project = Project.find(2)
|
@project = Project.find(2)
|
||||||
User.current = User.find(1)
|
User.current = User.find(1)
|
||||||
assert_equal '<a href="/versions/5">Alpha</a>', link_to_version(Version.find(5))
|
assert_equal '<a href="/versions/5" title="07/01/2006">Alpha</a>', link_to_version(Version.find(5))
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_link_to_version
|
def test_link_to_version
|
||||||
User.current = User.find(1)
|
User.current = User.find(1)
|
||||||
assert_equal '<a href="/versions/5">OnlineStore - Alpha</a>', link_to_version(Version.find(5))
|
assert_equal '<a href="/versions/5" title="07/01/2006">OnlineStore - Alpha</a>', link_to_version(Version.find(5))
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_link_to_version_without_effective_date
|
||||||
|
User.current = User.find(1)
|
||||||
|
version = Version.find(5)
|
||||||
|
version.effective_date = nil
|
||||||
|
assert_equal '<a href="/versions/5">OnlineStore - Alpha</a>', link_to_version(version)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_link_to_private_version
|
def test_link_to_private_version
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user