Adding user_certifications relation, and paperclip gem

This commit is contained in:
2013-01-25 03:50:53 -07:00
parent 43d949dc1d
commit 6e77b2bf68
25 changed files with 296 additions and 10 deletions

View File

@@ -10,8 +10,12 @@
<% if current_user.admin? then %>
<th>Cards</th>
<% end %>
<th>Certifications</th>
<th>Active?</th>
<th>Waiver?</th>
<% if current_user.admin? then %>
<th>Orientation?</th>
<% end %>
<th>Admin?</th>
<th></th>
<th></th>
@@ -20,16 +24,22 @@
<% if !@users.blank? %>
<% @users.each do |user| %>
<tr>
<td><%= user.name %></td>
<td><%= link_to user.name, user %></td>
<td><%= user.email %></td>
<% if current_user.admin? then %><td>
<% user.cards.each do |c| %>
<%= link_to c.card_number, card_url(c) %><%= "," unless c == user.cards.last %>
<% end %>
</td><% end %>
<td><%= if user.active? then "Active" end %></td>
<td><%= if user.waiver.blank? then "Not Signed" else "Signed" end %></td>
<td><%= if user.admin? then "Admin" end %></td>
<td><% user.certifications.each do |c| %>
<%= link_to c.name, c %><%= "," unless c == user.certifications.last %>
<% end %></td>
<td><%= if user.active? then raw("&#x2713;") end %></td>
<td><%= unless user.waiver.blank? then raw("<span class='hoverinfo' title='"+user.waiver.strftime("%B %d %Y")+"'>&#x2713;</span>") end %></td>
<% if current_user.admin? then %><td>
<%= unless user.orientation.blank? then raw("<span class='hoverinfo' title='"+user.orientation.strftime("%B %d %Y")+"'>&#x2713;</span>") end %>
</td><% end %>
<td><%= if user.admin? then raw("&#x2713;") end %></td>
<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>

View File

@@ -22,7 +22,7 @@
<b>Certifications:</b>
<ul>
<% @user.certifications.each do |certification| %>
<li>certification.name</li>
<li><%= link_to certification.name, certification %></li>
<% end %>
<% if @user.certifications.blank? %><li>n/a</li><% end %>
</ul>