rubycentral/cfp-app

View on GitHub
app/views/shared/schedule/_days.html.haml

Summary

Maintainability
Test Coverage
%h1= event.conference_day_in_words(day)
%table.schedule
  %thead
    %tr
      %th (Time Slots)
      - @rooms.each do |room|
        %th
          = room.name

  %tbody
    - conference_day = ConferenceDay.new(day, current_event)
    - conference_day.conf_slots.each do |conf_slot|
      %tr
        %td
          %p
            = row_time(conf_slot)
        - if conf_slot.conference_wide?
          - ts = Staff::TimeSlotDecorator.decorate(conf_slot.conference_wide_session)
          %td.proposal-slot.time-slot{ colspan: @rooms.count, data: ts.cell_data_attr}
            %p
              = ts.conference_wide_title
        - else
          - conf_slot.sessions.each_with_index do |ts, i|
            - if conference_day.session_empty?(ts, i, conf_slot)
              %td
            - elsif ts.present?
              - ts = Staff::TimeSlotDecorator.decorate(ts)
              - takes_two = ts.takes_two_time_slots?
              %td.time-slot{rowspan: (2 if takes_two), data: ts.cell_data_attr}
                .session-content
                  %p.session-title
                    = ts.title
                  %p.speaker-name
                    = ts.presenter