diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb
index 66a2a46a3..580c72a67 100644
--- a/app/views/users/show.html.erb
+++ b/app/views/users/show.html.erb
@@ -77,12 +77,25 @@
<% unless @memberships.empty? %>
<%=l(:label_project_plural)%>
-
-<% for membership in @memberships %>
- - <%= link_to_project(membership.project) %>
- (<%= membership.roles.sort.collect(&:to_s).join(', ') %>, <%= format_date(membership.created_on) %>)
+
+
+
+ <%=l(:label_project)%> |
+ <%=l(:label_role_plural)%> |
+ <%=l(:label_registered_on)%> |
+
+
+
+<% project_tree(@memberships.collect(&:project), :init_level => true) do |project, level| %>
+ <% membership = @memberships.select{|m|m.project==project}.first %>
+ ">
+ <%= link_to_project(project) %> |
+ <%= membership.roles.sort.collect(&:to_s).join(', ') %> |
+ <%= format_date(membership.created_on) %> |
+
<% end %>
-
+
+
<% end %>
<% if (User.current == @user || User.current.admin?) && @user.groups.any? %>
diff --git a/test/functional/users_controller_test.rb b/test/functional/users_controller_test.rb
index 2b15af1ba..b64c4359b 100644
--- a/test/functional/users_controller_test.rb
+++ b/test/functional/users_controller_test.rb
@@ -173,8 +173,20 @@ class UsersControllerTest < Redmine::ControllerTest
get :show, :params => {:id => 2}
assert_response :success
- # membership of private project admin can see
- assert_select 'li a', :text => "OnlineStore"
+ assert_select 'table.list.memberships>tbody' do
+ assert_select 'tr:nth-of-type(1)' do
+ assert_select 'td:nth-of-type(1)>a', :text => 'eCookbook'
+ assert_select 'td:nth-of-type(2)', :text => 'Manager'
+ end
+ assert_select 'tr:nth-of-type(2)' do
+ assert_select 'td:nth-of-type(1)>a', :text => 'OnlineStore'
+ assert_select 'td:nth-of-type(2)', :text => 'Developer'
+ end
+ assert_select 'tr:nth-of-type(3)' do
+ assert_select 'td:nth-of-type(1)>a', :text => 'Private child of eCookbook'
+ assert_select 'td:nth-of-type(2)', :text => 'Manager'
+ end
+ end
end
def test_show_current_should_require_authentication