Got auto-detection in logs working, improved user index readability

This commit is contained in:
2012-09-16 02:53:45 -07:00
parent 5174b4c50c
commit 152d6e4e03
3 changed files with 7 additions and 74 deletions

View File

@@ -30,7 +30,10 @@
when 'G'
"Granted"
end %>
<%= "Card: "+(door_log.data.to_i+(@divided_tmp*32767)).to_s(16) %>
<% @cardnum = (door_log.data.to_i+(@divided_tmp*32767)).to_s(16) %>
<%= "Card: "+@cardnum %>
<% @card_user = User.find(:first,:conditions=>['card_number LIKE ?', @cardnum]) %>
<%= "("+@card_user.name+")" unless @card_user.nil? %>
</td>
<% else
@divided_tmp = nil

View File

@@ -6,8 +6,8 @@
<tr>
<th>Name</th>
<th>Card DB ID</th>
<th>Card Number</th>
<th>Card Access</th>
<th>Card #</th>
<th>Access?</th>
<th>Admin?</th>
<th></th>
<th></th>
@@ -20,7 +20,7 @@
<td><%= user.name %></td>
<td><%= user.card_id %></td>
<td><%= user.card_number %></td>
<td><%= if user.card_permissions == 1 then "Enabled" else "Disabled" end %></td>
<td><%= if user.card_permissions == 1 then "Access" end %></td>
<td><%= if user.admin? then "Admin" end %></td>
<td><%= link_to 'Upload', upload_path(user) %></td>
<td><%= link_to 'Edit', edit_user_path(user) %></td>