<% @dates.each do |date| %>
| Time |
<% @rooms.each do |room| %>
<%= room.name %> |
<% end %>
<% span = {} %>
<% @rooms.each do |room| %>
<% span[room.id] = 1 %>
<% end %>
<% conf_start = DateTime.parse("#{date} 09:00") %>
<% conf_end = DateTime.parse("#{date} 19:00") %>
<% while conf_start < conf_end %>
|
<%= conf_start.strftime("%H:%M") %>
|
<% @rooms.each do |room| %>
<% event = @events.find_all{|event|event.start_time and event.start_time.strftime("%Y-%m-%d %H:%M").eql? conf_start.strftime("%Y-%m-%d %H:%M") and event.room_id == room.id } %>
<% if !event.empty? %>
<% span[room.id] = event[0].event_type.length / 15 %>
<%= event[0].title %>
|
<% span[room.id] = span[room.id] + 1 %>
<% end %>
<% if span[room.id] == 1 %>
">
Empty
|
<% end %>
<% if span[room.id] > 1 %>
<% span[room.id] = ( span[room.id] - 1 ) if span[room.id] > 1 %>
<% end %>
<%end %>
<% conf_start += 15.minutes %>
<%end %>
<% end %>