Adding analytics, adjusting door log issues

This commit is contained in:
Will Bradley 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 def show
if can? :read, DoorLog then if can? :read, DoorLog then
card_num_R = @card.card_number.to_i(16)%32767 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 end
respond_to do |format| respond_to do |format|
format.html # show.html.erb format.html # show.html.erb

View File

@ -72,7 +72,7 @@ Guide to log keys and data:
end %> end %>
<% @cardnum = (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: "+@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? %> <%= "("+@card.user.name+")" unless @card.nil? %>
</td> </td>
<% else <% else

View File

@ -30,5 +30,6 @@
<p class="alert"><%= raw(alert) %></p> <p class="alert"><%= raw(alert) %></p>
<%= yield %> <%= yield %>
</div> </div>
<%= raw Setting.analytics_code if Setting.present? %>
</body> </body>
</html> </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" src="/wymeditor/wymeditor/jquery.wymeditor.min.js"></script>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){

View File

@ -2,7 +2,8 @@
:welcome_title => "Welcome to the Hackerspace Members Site", :welcome_title => "Welcome to the Hackerspace Members Site",
:welcome_body => "<p>We are a member-driven community workshop where you can learn, make cool stuff, meet other cool people, and make your city a better place to live!</p><p>You don't have to be a member to come visit, but if you're interested in volunteering or being a member, feel free to sign up here! For more information, <a href=\"/more_info\">Click Here</a>.</p>", :welcome_body => "<p>We are a member-driven community workshop where you can learn, make cool stuff, meet other cool people, and make your city a better place to live!</p><p>You don't have to be a member to come visit, but if you're interested in volunteering or being a member, feel free to sign up here! For more information, <a href=\"/more_info\">Click Here</a>.</p>",
:more_info_page => "No info here yet, bug a member about filling this part out!", :more_info_page => "No info here yet, bug a member about filling this part out!",
:member_resources_inset => "No info here yet, bug a member about filling this part out!" :member_resources_inset => "No info here yet, bug a member about filling this part out!",
:analytics_code => "<!-- insert analytics code here -->"
} }
if ActiveRecord::Base.connection.tables.include?('settings') and !defined?(::Rake) if ActiveRecord::Base.connection.tables.include?('settings') and !defined?(::Rake)