If the user is the product admin, then pending roles are shown and
called out as such. Otherwise, they are hidden from view and only
approved users are displayed.
Signed-off-by: Darryl L. Pierce <mcpierce(a)gmail.com>
---
app/views/roles/_list.html.erb | 31 +++++++++++++++++--------------
doc/ChangeLog | 1 +
2 files changed, 18 insertions(+), 14 deletions(-)
diff --git a/app/views/roles/_list.html.erb b/app/views/roles/_list.html.erb
index 7ae4783..ead82dd 100644
--- a/app/views/roles/_list.html.erb
+++ b/app/views/roles/_list.html.erb
@@ -9,27 +9,30 @@
</caption>
<thead>
<tr>
- <th scope="col">#</th>
- <th scope="col" class="name">User</th>
- <th scope="col">Product</th>
- <th scope="col">Since</th>
+ <th scope="col">#</th>
+ <th scope="col" class="name">User</th>
+ <th scope="col">Product</th>
+ <th scope="col">Since</th>
</tr>
</thead>
<tbody>
<% product_roles.each do |product_role| %>
+ <% if !product_role.pending? || (product_role.pending? &&
@product.can_approve_roles?(@user)) %>
<tr class="<%= cycle('odd', 'even') %>">
- <td><%= product_role.id %></td>
- <td class="name">
- <% if product_role.user.avatar_url %>
- <div class="small-icon"><%= image_tag
product_role.user.avatar_url %></div>
- <% end %>
- <%= link_to product_role.user.display_name, user_path(product_role.user)
%>
- <%= link_to product_role.role.name, product_role_path(product_role.product,
product_role) %>
- </td>
- <td><%= link_to product_role.product.name,
product_roles_path(product_role.product) %></td>
- <td><%= show_date(product_role.created_at) %></td>
+ <td><%= product_role.id %></td>
+ <td class="name">
+ <% if product_role.user.avatar_url %>
+ <div class="small-icon"><%= image_tag product_role.user.avatar_url
%></div>
+ <% end %>
+ <%= link_to product_role.user.display_name, user_path(product_role.user) %>
+ <%= link_to product_role.role.name, product_role_path(product_role.product,
product_role) %>
+ <% if product_role.pending? %><b>(PENDING REQUEST)</b><%
end %>
+ </td>
+ <td><%= link_to product_role.product.name,
product_roles_path(product_role.product) %></td>
+ <td><%= show_date(product_role.created_at) %></td>
</tr>
<% end %>
+ <% end %>
</tbody>
</table>
</div>
diff --git a/doc/ChangeLog b/doc/ChangeLog
index 736d3d2..6998f48 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -60,6 +60,7 @@ Change Log (0.3.0):
* #230 - Sprint not started but no error message is shown. (BUG)
* #231 - Fix the breadcrumb trail for the task page. (BUG)
* #232 - Only show approved product members as sprint team candidates. (BUG)
+ * #233 - Only approved members are displayed. (BUG)
* #234 - Fix the URL for user registration. (BUG)
* #235 - Recent activity is actually oldest activity. (BUG)
--
1.6.2
Show replies by thread