Adding analytics, adjusting door log issues

This commit is contained in:
2013-10-04 02:59:41 -07:00
parent 75da7ffb6a
commit d61289abaf
5 changed files with 6 additions and 3 deletions

View File

@@ -34,7 +34,7 @@ class CardsController < ApplicationController
def show
if can? :read, DoorLog then
card_num_R = @card.card_number.to_i(16)%32767
@door_logs = DoorLog.where('key = ? AND data = ?', "R", card_num_R).order("created_at DESC")
@door_logs = DoorLog.where('key = ? AND data = ?', "G", card_num_R).order("created_at DESC")
end
respond_to do |format|
format.html # show.html.erb

View File

@@ -72,7 +72,7 @@ Guide to log keys and data:
end %>
<% @cardnum = (door_log.data.to_i+(@divided_tmp*32767)).to_s(16) %>
<%= "Card: "+@cardnum %>
<% @card = Card.find(:first,:conditions=>['card_number LIKE ?', @cardnum]) %>
<% @card = Card.find(:first,:conditions=>['lower(card_number) = ?', @cardnum.downcase]) %>
<%= "("+@card.user.name+")" unless @card.nil? %>
</td>
<% else

View File

@@ -30,5 +30,6 @@
<p class="alert"><%= raw(alert) %></p>
<%= yield %>
</div>
<%= raw Setting.analytics_code if Setting.present? %>
</body>
</html>

View File

@@ -1,3 +1,4 @@
<script src="http://code.jquery.com/jquery-migrate-1.2.1.js"></script>
<script type="text/javascript" src="/wymeditor/wymeditor/jquery.wymeditor.min.js"></script>
<script type="text/javascript">
$(function(){