summaryrefslogtreecommitdiffstats
path: root/app/views/users/show.html.erb
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2019-03-28 23:44:28 +0000
committerGo MAEDA <maeda@farend.jp>2019-03-28 23:44:28 +0000
commit32dce42b71b720f1dc37e5b6f9d795fe7f5e0712 (patch)
treed059398c8d2a7e4db5fa52a3e11087aa43ab84d9 /app/views/users/show.html.erb
parent72e1451159206af1c335b23e0c1e5bf9ed84bc85 (diff)
downloadredmine-32dce42b71b720f1dc37e5b6f9d795fe7f5e0712.tar.gz
redmine-32dce42b71b720f1dc37e5b6f9d795fe7f5e0712.zip
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
Diffstat (limited to 'app/views/users/show.html.erb')
-rw-r--r--app/views/users/show.html.erb24
1 files changed, 19 insertions, 5 deletions
diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb
index 66a2a46a3..e97119bab 100644
--- a/app/views/users/show.html.erb
+++ b/app/views/users/show.html.erb
@@ -77,12 +77,26 @@
<% unless @memberships.empty? %>
<h3><%=l(:label_project_plural)%></h3>
-<ul>
-<% for membership in @memberships %>
- <li><%= link_to_project(membership.project) %>
- (<%= membership.roles.sort.collect(&:to_s).join(', ') %>, <%= format_date(membership.created_on) %>)</li>
+<table class="list projects">
+<thead>
+ <tr>
+ <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 %>
-</ul>
+</tbody>
+</table>
<% end %>
<% if (User.current == @user || User.current.admin?) && @user.groups.any? %>