diff --git a/layouts/schedule/event.html b/layouts/schedule/event.html index 2c98434e..3022b8c3 100644 --- a/layouts/schedule/event.html +++ b/layouts/schedule/event.html @@ -1,189 +1,142 @@ -<% -# vim: set ft=eruby ts=2 sw=2 et ai: -%> -<% go_live = @site.config.fetch(:go_live) %> -<% matrix_works = @site.config.fetch(:matrix_works) %> +<% # vim: set ft=eruby ts=2 sw=2 et ai: %> <% go_live = +@site.config.fetch(:go_live) %> <% matrix_works = +@site.config.fetch(:matrix_works) %> -
+
<%if item[:logo] %> - -<% end %> - -<% if item[:abstract] or item[:description] %> + +<% end %> <% if item[:abstract] or item[:description] %>
-<% if item[:abstract] %> -
<%= item[:abstract] %>
-<% end %> -<% if item[:description] %> -
<%= item[:description] %>
-<% end %> + <% if item[:abstract] %> +
<%= item[:abstract] %>
+ <% end %> <% if item[:description] %> +
<%= item[:description] %>
+ <% end %>
-<% end %> - -<% - videos = [] - videos.push *((item[:attachments] or []).select{|a| a[:mime] == 'video/webm'}.map{|a| $attachments_by_export[a[:filename]][:localname]}) - videos.push *((item[:links] or []).select{|l| l[:url] =~ /\.webm$/}.map{|l| l[:url]}) - videos - .each do |video| - mime = case video - when /\.webm$/ - 'video/webm; codecs="vp8, vorbis"' - when /\.og[gv]$/ - 'video/ogg; codecs="theora, vorbis"' - when /\.(mp4|mpeg)$/ - 'video/mp4; codecs="avc1.42E01E, mp4a.40.2"' - else - next - end - require 'uri' - url = video -%> +<% end %> <% videos = [] videos.push *((item[:attachments] or []).select{|a| +a[:mime] == 'video/webm'}.map{|a| +$attachments_by_export[a[:filename]][:localname]}) videos.push *((item[:links] +or []).select{|l| l[:url] =~ /\.webm$/}.map{|l| l[:url]}) videos .each do +|video| mime = case video when /\.webm$/ 'video/webm; codecs="vp8, vorbis"' when +/\.og[gv]$/ 'video/ogg; codecs="theora, vorbis"' when /\.(mp4|mpeg)$/ +'video/mp4; codecs="avc1.42E01E, mp4a.40.2"' else next end require 'uri' url = +video %>
-
-<% end %> - -<% unless item[:speakers].empty? %> +<% end %> <% unless item[:speakers].empty? %>

Speakers

- - <% item[:speakers].map(&$to_speaker).each do |s| %> - - <% photo = s[:thumbnail] ? $item_by_id.fetch(s[:thumbnail][:identifier]) : nil %> - - - - <% end %> - -
<% if photo %>Photo of <%= s[:name] %><% end %><%= l s %>
-<% end %> - -<% if item[:attachments] and not item[:attachments].empty? %> -

Attachments

- -<% end %> - -<% unless item[:links].empty? %> -

Links

- -<% end %> - -<% -if false - table = $timetable.fetch(item[:day]).fetch(:by_index) - interval = $timetable.fetch(item[:day]).fetch(:interval) - - unslug = lambda{|slug| slug == item[:slug]} - sort = lambda{|e| [e[:start_time], e[:end_time], e[:room_rank], e[:conference_room_id]]} - - concurrent_events = begin - require 'set' - s = Set.new - (item[:start_time_index]..item[:end_time_index]).each do |i| - table[i].each do |slug| - s << slug - end - end - s.reject(&unslug).map(&$to_event).sort_by(&sort) - end - - next_up_minutes = 30 - next_up = begin - require 'set' - (item[:end_time_index]..item[:end_time_index] + (next_up_minutes / interval)).each do |i| - (table[i] or []).each do |slug| - s << slug - end - end - s.reject(&unslug).map(&$to_event).sort_by(&sort) - end - - next_in_same_room_limit = 3 - next_in_same_room = begin - require 'set' - list = room(item[:room])[:events_by_day].fetch(item[:day].to_sym) - i = 0 - while i < list.size - break if list[i] == item[:slug] - i += 1 - end - raise "failed to find the event item in the list of events in the same room" unless i < list.size - list[(i+1)..(i+next_in_same_room_limit)].map(&$to_event) - end - - [ - ['sametime', "Concurrent events", concurrent_events], - ['sameroom', "Next (up to #{next_in_same_room_limit}) talks in the same room (#{@item[:room_name]})", next_in_same_room], - ['upcoming', "Events that start after this one (within #{next_up_minutes} minutes)", next_up], - ].each do |anchor, heading, event_list| - unless event_list.empty? - %> -

<%= heading %>:

+ + +<% end %> <% if item[:attachments] and not item[:attachments].empty? %> +

Attachments

+ +<% end %> <% unless item[:links].empty? %> +

Links

+ +<% end %> <% if false table = $timetable.fetch(item[:day]).fetch(:by_index) +interval = $timetable.fetch(item[:day]).fetch(:interval) unslug = lambda{|slug| +slug == item[:slug]} sort = lambda{|e| [e[:start_time], e[:end_time], +e[:room_rank], e[:conference_room_id]]} concurrent_events = begin require 'set' +s = Set.new (item[:start_time_index]..item[:end_time_index]).each do |i| +table[i].each do |slug| s << slug end end +s.reject(&unslug).map(&$to_event).sort_by(&sort) end next_up_minutes = 30 +next_up = begin require 'set' (item[:end_time_index]..item[:end_time_index] + +(next_up_minutes / interval)).each do |i| (table[i] or []).each do |slug| s << +slug end end s.reject(&unslug).map(&$to_event).sort_by(&sort) end +next_in_same_room_limit = 3 next_in_same_room = begin require 'set' list = +room(item[:room])[:events_by_day].fetch(item[:day].to_sym) i = 0 while i < +list.size break if list[i] == item[:slug] i += 1 end raise "failed to find the +event item in the list of events in the same room" unless i < list.size +list[(i+1)..(i+next_in_same_room_limit)].map(&$to_event) end [ ['sametime', +"Concurrent events", concurrent_events], ['sameroom', "Next (up to +#{next_in_same_room_limit}) talks in the same room (#{@item[:room_name]})", +next_in_same_room], ['upcoming', "Events that start after this one (within +#{next_up_minutes} minutes)", next_up], ].each do |anchor, heading, event_list| +unless event_list.empty? %> + +

<%= heading %>:

- - - - - - - - <% event_list.each do |e| %> - - - - - - - <% end %> - + + + + + + + + <% event_list.each do |e| %> + + + + + + + <% end %> +
WhenTitleTrackWhere
<%= e[:start_time] %>-<%= e[:end_time] %><%= l(e) %><%= l(track(e[:track])) %><%= l(room(e[:room])) %>
WhenTitleTrackWhere
<%= e[:start_time] %>-<%= e[:end_time] %><%= l(e) %><%= l(track(e[:track])) %><%= l(room(e[:room])) %>
-<% end %> -<% end %> -<% end %> +<% end %> <% end %> <% end %>