<%= render :partial => "json", :locals=>{:squares => squares} %> <% if not session[:use_js_renderer] top = @top || -75 left = @left || -33 count = @count || 0 pos_counter = squares.last.position + 1 empty_square = Square.new(:square_type_id => 1) 6.times do |i| empty_square.position = pos_counter + i squares += [empty_square.clone] end squares.each do |square| -%> <% count += 1 -%> <% if square.deed -%>
<% elsif square.square_type_id == 6 -%>
<% elsif square.square_type_id == 5 -%>
<% elsif square.square_type_id == 3 -%>
<% else -%>
<% end -%> <% if square.deed -%> <% else -%> <% end -%> <% # this is some smart cheating # this tells us (without another query) if a user has been here in the last 10 minutes # and while not 100% accurate is good enough to show cars moving about # # if this is too busy (too many cars) the original tests should be added to the end with "and" # this at least avoids DB calls if the cell isn't locked... and the cell will always # be locked if there is recent activity # if square.users.size > 1 or (square != @user.square and square.users.size >0) if square.locked?(@user) -%>
">" />
<% end -%> <% top += 19 -%> <% left += 38 -%> <% end -%>
<% x1 = 12 %> <% y2 = 201 %> <% squares.shift %> # remove the first square <% squares.each do |square| %> <% if square.deeded? %> <% else -%> <% end -%> <% x1 += 38 y2 += 19 #y2 = 355 if y2>355 end -%>
<%= render :partial => "active_item" %>
<% end # if not using js renderer %>