diff options
author | Go MAEDA <maeda@farend.jp> | 2019-05-22 08:32:27 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2019-05-22 08:32:27 +0000 |
commit | fc51fd2c81191074476cc8c6fc2a954e3c032dc2 (patch) | |
tree | b4174b29b26f4fa50bfb40756b5090428895e6a7 | |
parent | cfdd150da8261ccbb707379f114d909f0d68999b (diff) | |
download | redmine-fc51fd2c81191074476cc8c6fc2a954e3c032dc2.tar.gz redmine-fc51fd2c81191074476cc8c6fc2a954e3c032dc2.zip |
Show assignee avatar in Roadmap and Version (#28510).
Patch by Marius BALTEANU.
git-svn-id: http://svn.redmine.org/redmine/trunk@18189 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | app/views/versions/index.html.erb | 3 | ||||
-rw-r--r-- | app/views/versions/show.html.erb | 1 | ||||
-rw-r--r-- | public/stylesheets/application.css | 2 | ||||
-rw-r--r-- | test/functional/versions_controller_test.rb | 32 |
4 files changed, 37 insertions, 1 deletions
diff --git a/app/views/versions/index.html.erb b/app/views/versions/index.html.erb index 429bc5b92..ad5d5f425 100644 --- a/app/views/versions/index.html.erb +++ b/app/views/versions/index.html.erb @@ -28,8 +28,9 @@ <table class="list related-issues"> <caption><%= l(:label_related_issues) %></caption> <% issues.each do |issue| -%> - <tr class="hascontextmenu"> + <tr class="issue hascontextmenu"> <td class="checkbox"><%= check_box_tag 'ids[]', issue.id, false, :id => nil %></td> + <td class="assigned_to"><%= assignee_avatar(issue.assigned_to, :size => 16) %></td> <td class="subject"><%= link_to_issue(issue, :project => (@project != issue.project)) %></td> <td class="buttons"><%= link_to_context_menu %></td> </tr> diff --git a/app/views/versions/show.html.erb b/app/views/versions/show.html.erb index ad3ed2521..dc43d40b7 100644 --- a/app/views/versions/show.html.erb +++ b/app/views/versions/show.html.erb @@ -44,6 +44,7 @@ <%- @issues.each do |issue| -%> <tr class="issue hascontextmenu"> <td class="checkbox"><%= check_box_tag 'ids[]', issue.id, false, :id => nil %></td> + <td class="assigned_to"><%= assignee_avatar(issue.assigned_to, :size => 16) %></td> <td class="subject"><%= link_to_issue(issue, :project => (@project != issue.project)) %></td> <td class="buttons"><%= link_to_context_menu %></td> </tr> diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index c4b138f59..29750d448 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -582,6 +582,8 @@ div#search-results-counts li { list-style-type:none; float: left; margin-left: div#roadmap .related-issues { margin-bottom: 1em; } div#roadmap .related-issues td.checkbox { display: none; } +div#roadmap .related-issues td.assigned_to { width:1px; white-space:nowrap; padding: 0; } +div#roadmap .related-issues td.assigned_to img { padding-left: 4px; padding-right: 4px;} div#roadmap .wiki h1:first-child { display: none; } div#roadmap .wiki h1 { font-size: 120%; } div#roadmap .wiki h2 { font-size: 110%; } diff --git a/test/functional/versions_controller_test.rb b/test/functional/versions_controller_test.rb index b827a1fd3..7a9fe7fe8 100644 --- a/test/functional/versions_controller_test.rb +++ b/test/functional/versions_controller_test.rb @@ -98,12 +98,44 @@ class VersionsControllerTest < Redmine::ControllerTest end end + def test_index_should_show_issue_assignee + with_settings :gravatar_enabled => '1' do + Issue.generate!(:project_id => 3, :fixed_version_id => 4, :assigned_to => User.find_by_login('jsmith')) + Issue.generate!(:project_id => 3, :fixed_version_id => 4) + + get :index, :params => {:project_id => 3} + assert_response :success + + assert_select 'table.related-issues' do + assert_select 'tr.issue', :count => 2 do + assert_select 'img.gravatar[title=?]', 'Assignee: John Smith', :count => 1 + end + end + end + end + def test_show get :show, :params => {:id => 2} assert_response :success assert_select 'h2', :text => /1.0/ assert_select 'span[class=?]', 'badge badge-status-locked', :text => 'locked' + + # no issue avatar when gravatar is disabled + assert_select 'img.gravatar', :count => 0 + end + + def test_show_should_show_issue_assignee + with_settings :gravatar_enabled => '1' do + get :show, :params => {:id => 2} + assert_response :success + + assert_select 'table.related-issues' do + assert_select 'tr.issue td.assigned_to', :count => 2 do + assert_select 'img.gravatar[title=?]', 'Assignee: Dave Lopper', :count => 1 + end + end + end end def test_show_issue_calculations_should_take_into_account_only_visible_issues |