summaryrefslogtreecommitdiffstats
path: root/app/views/principal_memberships
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2017-01-07 10:28:59 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2017-01-07 10:28:59 +0000
commit3c005719aeeb73a8a6ac02aa99eee5426c558294 (patch)
tree542c01d82e8cc3dca67ae49e2e3f074fb0a1bb09 /app/views/principal_memberships
parenta4f167ec1a6d8cb3707716e73378e98e870d466f (diff)
downloadredmine-3c005719aeeb73a8a6ac02aa99eee5426c558294.tar.gz
redmine-3c005719aeeb73a8a6ac02aa99eee5426c558294.zip
Sort user memberships by project.
git-svn-id: http://svn.redmine.org/redmine/trunk@16150 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views/principal_memberships')
-rw-r--r--app/views/principal_memberships/_index.html.erb6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/views/principal_memberships/_index.html.erb b/app/views/principal_memberships/_index.html.erb
index b451f536b..e43419072 100644
--- a/app/views/principal_memberships/_index.html.erb
+++ b/app/views/principal_memberships/_index.html.erb
@@ -1,6 +1,8 @@
+<% memberships = principal.memberships.preload(:member_roles => :role).sorted_by_project.to_a %>
+
<p><%= link_to l(:label_add_projects), new_principal_membership_path(principal), :remote => true, :class => "icon icon-add" %></p>
-<% if principal.memberships.any? %>
+<% if memberships.any? %>
<table class="list memberships">
<thead><tr>
<th><%= l(:label_project) %></th>
@@ -9,7 +11,7 @@
<%= call_table_header_hook principal %>
</tr></thead>
<tbody>
- <% principal.memberships.preload(:member_roles => :role).each do |membership| %>
+ <% memberships.each do |membership| %>
<% next if membership.new_record? %>
<tr id="member-<%= membership.id %>" class="<%= cycle 'odd', 'even' %> class">
<td class="project name">