Talk boxes with less information and schedule view simplified
This commit is contained in:
parent
6ba3512d2b
commit
2905c8858c
8 changed files with 38 additions and 31 deletions
|
|
@ -14,9 +14,7 @@
|
|||
<table class="table table-bordered" id="schedule" width="100%">
|
||||
<tr>
|
||||
<th>Rooms</th>
|
||||
<%# The conference starts at 9 and ends at 18:45 %>
|
||||
<% intervals = (19 - 9) * 4 %>
|
||||
<% (9..18).each do |i| %>
|
||||
<% (@start_hour..@end_hour-1).each do |i| %>
|
||||
<th colspan="4"><%= "#{i}:00" %></th>
|
||||
<% end %>
|
||||
</tr>
|
||||
|
|
@ -25,24 +23,23 @@
|
|||
<tr>
|
||||
<td><%= room.name %></td>
|
||||
<% events_for_date = room.events.find_all{ |e| e.start_time.to_date == date } %>
|
||||
<% start_time = DateTime.parse("#{date} 09:00") %>
|
||||
<% (1..intervals).each do |i| %>
|
||||
<% start_time = DateTime.parse("#{date} #{@start_hour}:00") %>
|
||||
<% (1..@intervals).each do |i| %>
|
||||
<% events_for_time = events_for_date.find_all{|e| e.start_time == start_time} %>
|
||||
<% if !events_for_time.empty? %>
|
||||
<% event = events_for_time[0] %>
|
||||
<!-- There is an event, calculate the span and show it -->
|
||||
<% span = event.event_type.length / 15 %>
|
||||
<%= render partial: 'schedule_item', locals: {event: event, span: span, intervals: intervals} %>
|
||||
<% span = event.span %>
|
||||
<%= render partial: 'schedule_item', locals: {event: event, span: span, width: @width} %>
|
||||
<% span += 1 %>
|
||||
<% elsif span > 1 %>
|
||||
<% span -= 1 %>
|
||||
<% end %>
|
||||
<% if span == 1 %>
|
||||
<!-- span equals 1 show an empty td -->
|
||||
<td style="width: <%= 95 / intervals%>%">
|
||||
</td>
|
||||
<td style="width: <%= @width %>%"></td>
|
||||
<% end %>
|
||||
<% start_time += 15.minutes %>
|
||||
<% start_time += @step_minutes %>
|
||||
<% end %>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue