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

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

View File

@ -13,17 +13,6 @@ class DoorLogsController < ApplicationController
end
end
# GET /door_logs/1
# GET /door_logs/1.json
# def show
# @door_log = DoorLog.find(params[:id])
#
# respond_to do |format|
# format.html # show.html.erb
# format.json { render :json => @door_log }
# end
# end
# GET /door_logs/1
# GET /door_logs/1.json
def download
@ -35,63 +24,4 @@ class DoorLogsController < ApplicationController
end
end
# # GET /door_logs/new
# # GET /door_logs/new.json
# def new
# @door_log = DoorLog.new
#
# respond_to do |format|
# format.html # new.html.erb
# format.json { render :json => @door_log }
# end
# end
# GET /door_logs/1/edit
# def edit
# @door_log = DoorLog.find(params[:id])
# end
# POST /door_logs
# POST /door_logs.json
# def create
# @door_log = DoorLog.new(params[:door_log])
#
# respond_to do |format|
# if @door_log.save
# format.html { redirect_to @door_log, :notice => 'Door log was successfully created.' }
# format.json { render :json => @door_log, :status => :created, :location => @door_log }
# else
# format.html { render :action => "new" }
# format.json { render :json => @door_log.errors, :status => :unprocessable_entity }
# end
# end
# end
# PUT /door_logs/1
# PUT /door_logs/1.json
# def update
# @door_log = DoorLog.find(params[:id])
#
# respond_to do |format|
# if @door_log.update_attributes(params[:door_log])
# format.html { redirect_to @door_log, :notice => 'Door log was successfully updated.' }
# format.json { head :no_content }
# else
# format.html { render :action => "edit" }
# format.json { render :json => @door_log.errors, :status => :unprocessable_entity }
# end
# end
# end
# DELETE /door_logs/1
# DELETE /door_logs/1.json
# def destroy
# @door_log = DoorLog.find(params[:id])
# @door_log.destroy
#
# respond_to do |format|
# format.html { redirect_to door_logs_url }
# format.json { head :no_content }
# end
# end
end

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>