2013-01-26 09:21:41 +00:00
<h1>HeatSync People</h1>
2012-10-14 13:23:35 +00:00
<% if can? :create, User %>
<%= link_to 'New User', new_user_path %>
<% end %>
2013-05-24 06:25:09 +00:00
<% if can? :manage, User %>
| <%= link_to 'Merge Users', users_merge_path %>
<% end %>
2012-10-14 13:23:35 +00:00
<table>
2013-01-26 09:21:41 +00:00
<col />
2013-01-25 13:52:19 +00:00
<col />
2013-01-25 18:11:39 +00:00
<% if current_user.admin? then %><col /><% end %>
2013-01-25 13:52:19 +00:00
<col />
2013-02-12 08:58:17 +00:00
<% if current_user.admin? %><col />
<col class="col_highlight" /><% end %>
2013-01-25 13:52:19 +00:00
<col />
<col class="col_highlight" />
<col />
<col class="col_highlight" />
2012-10-14 13:23:35 +00:00
<tr>
2013-01-26 09:21:41 +00:00
<th></th>
2013-01-25 18:11:39 +00:00
<th><a href="?sort=name">Name</a></th>
<% if current_user.admin? then %><th><a href="?sort=email">Email</a></th><% end %>
<th><a href="?sort=certifications">Certifications</a></th>
2013-01-25 10:50:53 +00:00
<% if current_user.admin? then %>
2013-01-25 18:11:39 +00:00
<th><a href="?sort=orientation">Orientation?</a></th>
2013-01-25 10:50:53 +00:00
<% end %>
2013-01-25 18:11:39 +00:00
<th><a href="?sort=waiver">Waiver?</a></th>
<th><a href="?sort=member">Member?</a></th>
<th><a href="?sort=card">Card?</a></th>
<th><a href="?sort=instructor">Instructor?</a></th>
2013-02-12 08:58:17 +00:00
<% if current_user.admin? then %><th><a href="?sort=admin">Admin?</a></th><% end %>
2012-10-14 13:23:35 +00:00
<th></th>
<th></th>
</tr>
<% if !@users.blank? %>
<% @users.each do |user| %>
2013-01-26 01:21:42 +00:00
<tr<%= " class='hidden'" if user.hidden? %>>
2013-01-26 09:21:41 +00:00
<td><%= image_tag user.gravatar_url(:default => "http://members.heatsynclabs.org/assets/nil.png"), :class => :avatar %></td>
2013-01-25 10:50:53 +00:00
<td><%= link_to user.name, user %></td>
2013-01-25 18:11:39 +00:00
<% if current_user.admin? then %><td><%= user.email %></td><% end %>
2013-01-25 10:50:53 +00:00
<td><% user.certifications.each do |c| %>
2013-01-25 13:01:02 +00:00
<%= link_to c.name, c %><%= "," unless c.id == user.certifications.last.id %>
2013-01-25 10:50:53 +00:00
<% end %></td>
<% if current_user.admin? then %><td>
<%= unless user.orientation.blank? then raw("<span class='hoverinfo' title='"+user.orientation.strftime("%B %d %Y")+"'>✓</span>") end %>
</td><% end %>
2013-01-25 13:01:02 +00:00
<td><%= unless user.waiver.blank? then raw("<span class='hoverinfo' title='"+user.waiver.strftime("%B %d %Y")+"'>✓</span>") end %></td>
2013-02-12 08:58:17 +00:00
<td><%= raw(user.member_status_symbol) %></td>
2013-01-26 04:11:01 +00:00
<td><%= unless user.cards.blank? then raw("<span class='iconinfo'>✓</span>") end %></td>
<td><%= if user.instructor? then raw("<span class='iconinfo'>✓</a>") end %></td>
2013-02-12 08:58:17 +00:00
<% if current_user.admin? then %><td><%= if user.admin? then raw("<span class='iconinfo'>✓</a>") end %></td><% end %>
2012-10-14 13:23:35 +00:00
<td><%= link_to 'Edit', edit_user_path(user) if can? :update, user %></td>
<td><%= link_to 'Destroy', user, :confirm => 'Are you sure? WARNING: THIS DOES NOT REMOVE THE USER FROM THE DOOR SYSTEM! DISABLE THEM FIRST.', :method => :delete if can? :destroy, user %></td>
</tr>
<% end %>
<% end %>
</table>
2013-01-26 09:21:41 +00:00
<% if current_user.orientation.blank? then %>
<p class="alert">There's a lot more to see here, but our records show you haven't completed the new member orientation yet. If that's incorrect, please contact a volunteer.</p>
<% end %>
2012-10-14 13:23:35 +00:00
<br />