Schedule for <%= @conference.title %>

<% @dates.each do |date| %>
<% @rooms.each do |room| %> <% 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 %> <%- start_hour = conf_start.hour start_min = conf_start.min %> <% @rooms.each do |room| %> <% events_for_date = @events.find_all {|e| e.room_id == room.id && e.start_time && e.start_time.to_date == date } %> <% event = events_for_date.find_all{|e| e.start_time.hour == start_hour && e.start_time.min == start_min } %> <% if !event.empty? %> <% span[room.id] = event[0].event_type.length / 15 %> <% span[room.id] = span[room.id] + 1 %> <% elsif span[room.id] > 1 %> <% span[room.id] = ( span[room.id] - 1 ) if span[room.id] > 1 %> <% end %> <% if span[room.id] == 1 %> <% end %> <%end %> <% conf_start += 15.minutes %> <%end %>
Time<%= room.name %>
<%= conf_start.strftime("%H:%M") %>
<%- if speaker = event[0].speakers.first %> <%= image_tag speaker.gravatar_url, :class => "img-circle pull-right", :alt => speaker.public_name, :title => speaker.public_name, :style => "padding:8px;" %> <%- end %> <%= event[0].title %> <% unless event[0].subtitle.empty? %> <%= event[0].subtitle %> <% end %> <%= "#{speaker.first_name} #{speaker.last_name}" %> <% if event[0].track%> <%= event[0].track.name %> <% end -%>
<% end %>
<%= javascript_tag do %> jQuery( function($) { $('tbody tr td[data-href]').addClass('clickable').mouseup(function(e) { if(e.which===1) { window.location = $(this).attr('data-href'); } else if(e.which===2) { window.open($(this).attr('data-href'), '_blank'); } }); }); $(function() { // add a hash to the URL when the user clicks on a tab $('a[data-toggle="tab"]').on('click', function(e) { history.pushState(null, null, $(this).attr('href')); }); // navigate to a tab when the history changes window.addEventListener("popstate", function(e) { var activeTab = $('[href=' + location.hash + ']'); if (activeTab.length) { activeTab.tab('show'); } else { $('.nav-tabs a[href=#<%= j @today %>]').tab('show'); } }); }); $(function() { var hash = window.location.hash; hash && $('ul.nav a[href="' + hash + '"]').tab('show'); }); <% end %>