Access Cards

<%= link_to 'New Card', new_card_path if can? :create, Card %> <%= link_to 'Upload all cards', upload_all_path if can? :upload_all, Card %> <%= link_to 'Door Logs', door_logs_path if can? :read, DoorLog %>

Most Active Card Last 7 Days: <%= @most_active_card.name %> (<%= @most_active_card.accesses_this_week %> times)

<% if !@cards.blank? %> <% @cards.each do |card| %> <% end %> <% end %>
User Note DB ID Card # Access? Accesses Last 7 Days
<%= link_to card.user.name, card %> <%= card.name %> <%= card.id %> <%= card.card_number %> <%= if card.card_permissions == 1 then "Access" end %> <%= card.accesses_this_week unless card.accesses_this_week < 1 %> <%= link_to 'Upload', upload_path(card) if can? :upload, card %> <%= link_to 'Edit', edit_card_path(card) if can? :update, card %> <%= link_to 'Destroy', card, :confirm => 'Are you sure? WARNING: THIS DOES NOT REMOVE THE CARD FROM THE DOOR SYSTEM! DISABLE AND UPLOAD IT FIRST.', :method => :delete if can? :destroy, card %>