mirror of
https://github.com/redmine/redmine.git
synced 2025-11-13 08:46:01 +01:00
Show projects using a table instead of an unordered list in the user profile page (#31066).
Patch by Takenori TAKAKI. git-svn-id: http://svn.redmine.org/redmine/trunk@18012 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -77,12 +77,26 @@
|
|||||||
|
|
||||||
<% unless @memberships.empty? %>
|
<% unless @memberships.empty? %>
|
||||||
<h3><%=l(:label_project_plural)%></h3>
|
<h3><%=l(:label_project_plural)%></h3>
|
||||||
<ul>
|
<table class="list projects">
|
||||||
<% for membership in @memberships %>
|
<thead>
|
||||||
<li><%= link_to_project(membership.project) %>
|
<tr>
|
||||||
(<%= membership.roles.sort.collect(&:to_s).join(', ') %>, <%= format_date(membership.created_on) %>)</li>
|
<th><%=l(:label_project)%></th>
|
||||||
|
<th><%=l(:label_role_plural)%></th>
|
||||||
|
<th><%=l(:label_registered_on)%></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<% memberships_by_project = @memberships.group_by(&:project) %>
|
||||||
|
<% project_tree(memberships_by_project.keys, :init_level => true) do |project, level| %>
|
||||||
|
<% membership = memberships_by_project[project].first %>
|
||||||
|
<tr class="<%= project.css_classes %> <%= level > 0 ? "idnt idnt-#{level}" : nil %>">
|
||||||
|
<td class="name"><span><%= link_to_project(project) %></span></td>
|
||||||
|
<td class="roles"><%= membership.roles.sort.collect(&:to_s).join(', ') %></td>
|
||||||
|
<td><%= format_date(membership.created_on) %></td>
|
||||||
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</tbody>
|
||||||
|
</table>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% if (User.current == @user || User.current.admin?) && @user.groups.any? %>
|
<% if (User.current == @user || User.current.admin?) && @user.groups.any? %>
|
||||||
|
|||||||
@@ -173,8 +173,20 @@ class UsersControllerTest < Redmine::ControllerTest
|
|||||||
get :show, :params => {:id => 2}
|
get :show, :params => {:id => 2}
|
||||||
assert_response :success
|
assert_response :success
|
||||||
|
|
||||||
# membership of private project admin can see
|
assert_select 'table.list.projects>tbody' do
|
||||||
assert_select 'li a', :text => "OnlineStore"
|
assert_select 'tr:nth-of-type(1)' do
|
||||||
|
assert_select 'td:nth-of-type(1)>span>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)>span>a', :text => 'Private child of eCookbook'
|
||||||
|
assert_select 'td:nth-of-type(2)', :text => 'Manager'
|
||||||
|
end
|
||||||
|
assert_select 'tr:nth-of-type(3)' do
|
||||||
|
assert_select 'td:nth-of-type(1)>span>a', :text => 'OnlineStore'
|
||||||
|
assert_select 'td:nth-of-type(2)', :text => 'Developer'
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_show_current_should_require_authentication
|
def test_show_current_should_require_authentication
|
||||||
|
|||||||
Reference in New Issue
Block a user