Skip to content

Instantly share code, notes, and snippets.

@alecchen
Created December 4, 2009 02:00
Show Gist options
  • Save alecchen/248775 to your computer and use it in GitHub Desktop.
Save alecchen/248775 to your computer and use it in GitHub Desktop.
<h2><%=l(:label_contact_plural)%></h2>
<table class="list">
<thead><tr>
<%= sort_header_tag('login') %>
<% for header in @headers %>
<%= sort_header_tag(header) %>
<% end %>
</tr></thead>
<tbody>
<% for user in @users -%>
<tr class="user <%= cycle("odd", "even") %> <%= %w(anon active registered locked)[user.status] %>">
<td class="username"><%= link_to h(user.login), :controller => 'account', :action => 'show', :id => user %></td>
<% if !user.custom_values.empty? %>
<% for custom_value in user.custom_values %>
<% if !custom_value.value.empty? %>
<td class=custom_value.custom_field.name><%=h show_value(custom_value) %></td>
<% else %>
<td class=custom_value.custom_field.name><%=h "" %></td>
<% end %>
<% end %>
<% else %>
<% for header in @headers %>
<td class=custom_value.custom_field.name><%=h "" %></td>
<% end %>
<% end %>
</tr>
<% end -%>
</tbody>
</table>
<% html_title(l(:label_contact_plural)) -%>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment