Access Cards

<%= link_to 'New Card', new_card_path, :class => "btn" if can? :create, Card %> <%= link_to 'Upload all cards', upload_all_path, :class => "btn" if can? :upload_all, Card %> <%= link_to 'Door Logs', door_logs_path, :class => "btn" if can? :read, DoorLog %> <%= link_to 'Space API', space_api_path, :class => "btn" %> <%= link_to 'Remote Door Access', space_api_access_path, :class => "btn" if can? :access_doors_remotely, :door_access %>

Most Active Card Last Month: <%= @most_active_card.name unless @most_active_card.blank? %> (<%= @most_active_card.accesses_this_week unless @most_active_card.blank? %> days)

<% unless @runner_up_card.blank? %> Runner Up: <%= @runner_up_card.name %> (<%= @runner_up_card.accesses_this_week %> days) <% end %>

<% if !@cards.blank? %> <% @cards.each do |card| %> <% end %> <% end %>
User Note DB ID Card # Access? Days Accessed Last Month
<% if card.user.nil? %> n/a <% else %> <%= raw(card.user.member_status_symbol) %> <%= link_to card.user.name , card %> <% end %> <%= 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 %>