Skip to content

Commit a6e0991

Browse files
committed
Link from assignee to group page (#12795).
git-svn-id: http://svn.redmine.org/redmine/trunk@21075 e93f8b46-1217-0410-a6f0-8f06a7374b81
1 parent 605dadd commit a6e0991

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

app/helpers/application_helper.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,8 @@ def format_object(object, html=true, &block)
265265
object.to_s
266266
when 'Float'
267267
sprintf "%.2f", object
268-
when 'User'
269-
html ? link_to_user(object) : object.to_s
268+
when 'User', 'Group'
269+
html ? link_to_principal(object) : object.to_s
270270
when 'Project'
271271
html ? link_to_project(object) : object.to_s
272272
when 'Version'

app/views/issues/show.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
rows.left l(:field_priority), @issue.priority.name, :class => 'priority'
5151

5252
unless @issue.disabled_core_fields.include?('assigned_to_id')
53-
rows.left l(:field_assigned_to), (@issue.assigned_to ? link_to_user(@issue.assigned_to) : "-"), :class => 'assigned-to'
53+
rows.left l(:field_assigned_to), (@issue.assigned_to ? link_to_principal(@issue.assigned_to) : "-"), :class => 'assigned-to'
5454
end
5555
unless @issue.disabled_core_fields.include?('category_id') || (@issue.category.nil? && @issue.project.issue_categories.none?)
5656
rows.left l(:field_category), (@issue.category ? @issue.category.name : "-"), :class => 'category'

test/functional/issues_controller_test.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2605,14 +2605,23 @@ def test_show_should_not_display_category_field_if_no_categories_are_defined
26052605
assert_select 'table.attributes .category', 0
26062606
end
26072607

2608-
def test_show_should_display_link_to_the_assignee
2608+
def test_show_should_display_link_to_the_assigned_user
26092609
get(:show, :params => {:id => 2})
26102610
assert_response :success
26112611
assert_select '.assigned-to' do
26122612
assert_select 'a[href="/users/3"]'
26132613
end
26142614
end
26152615

2616+
def test_show_should_display_link_to_the_assigned_group
2617+
Issue.find(2).update_attribute(:assigned_to_id, 10)
2618+
get(:show, :params => {:id => 2})
2619+
assert_response :success
2620+
assert_select '.assigned-to' do
2621+
assert_select 'a[href="/groups/10"]'
2622+
end
2623+
end
2624+
26162625
def test_show_should_display_visible_changesets_from_other_projects
26172626
project = Project.find(2)
26182627
issue = project.issues.first

0 commit comments

Comments
 (0)