<commit_before>- intervals = number_columns * 60 / EventType::LENGTH_STEP + 1
- width = 85 / intervals
- carousel_number = (@conf_period / number_columns.to_f).ceil
.carousel.slide{ id: "carousel-#{ date }-#{ number_columns }", |
                     "data-ride" => "carousel", |
                     "data-wrap" => "false", |
                     "data-interval" => "false" }
  / Wrapper for slides
  .carousel-inner
    - start_time = DateTime.parse("#{date} #{@conf_start}:00")
    - (0..carousel_number-1).each do |number|
      %div{ class: "#{ carousel_item_class(number, carousel_number, number_columns, @hour_column)}" }
        %table.table.table-bordered.schedule-table#schedule
          %tr
            %th
            - td_start_time = start_time
            - (1..intervals).each do |i|
              %th.date
                = (td_start_time).strftime("%H:%M")
              - td_start_time += @step_minutes

          - start_room_time = start_time
          - @rooms.each do |room|
            - start_room_time = start_time
            - span = 1
            %tr
              %td.room{ style: "height: #{ td_height(@rooms) }px;" }
                .room.elipsis.break-words{ style: "-webkit-line-clamp: #{ room_lines(@rooms) }; height: #{ room_height(@rooms) }px;" }
                  = room.name
                - event_schedules = room.event_schedules.select{ |e| (e.schedule_id == @conference.program.selected_schedule.id) && (e.start_time >= start_time) && (e.start_time <= (start_time + number_columns.hour)) }
                - (1..intervals).each do |i|
                  - if span > 1
                    - span -= 1
                  - else
                    - event_schedule = event_schedules.find{ |e| e.start_time <= start_room_time and e.end_time > start_room_time }
                    - if event_schedule && (event_schedule.event.state == 'canceled' || event_schedule.event.state == 'withdrawn') && !event_schedule.intersecting_events.confirmed.empty?
                      - replacement_event = event_schedule.intersecting_events.confirmed.first
                      - event_schedule = (replacement_event.start_time <= start_room_time && replacement_event.end_time > start_room_time) ? replacement_event : nil

                    - if event_schedule
                      / There is an event, calculate the span and show it
                      - event_span =  (event_schedule.end_time.to_i - start_room_time.to_i) / 60 / EventType::LENGTH_STEP
                      - span = ((event_span + i - 1 ) > intervals ? intervals  + 1 - i : event_span)
                      = render partial: 'schedule_item', locals: {event: event_schedule.event, event_schedule: event_schedule, span: span, width: width}
                    - else
                      / if span equals 1 show an empty td
                      %td.no-padding{ width: "#{ width }%"}
                  - start_room_time += @step_minutes
          - start_time = start_room_time - @step_minutes

  / Controls
  %a.left.carousel-control{ href: "#carousel-#{ date }-#{ number_columns }", |
                            role: "button", |
                            "data-slide" => "prev" }
    %span.glyphicon.glyphicon-chevron-left
  %a.right.carousel-control{ href: "#carousel-#{ date }-#{ number_columns }", |
                             role: "button", |<commit_msg>Fix bug in the schedule<commit_after>- intervals = number_columns * 60 / EventType::LENGTH_STEP + 1
- width = 85 / intervals
- carousel_number = (@conf_period / number_columns.to_f).ceil
.carousel.slide{ id: "carousel-#{ date }-#{ number_columns }", |
                     "data-ride" => "carousel", |
                     "data-wrap" => "false", |
                     "data-interval" => "false" }
  / Wrapper for slides
  .carousel-inner
    - start_time = DateTime.parse("#{date} #{@conf_start}:00")
    - (0..carousel_number-1).each do |number|
      %div{ class: "#{ carousel_item_class(number, carousel_number, number_columns, @hour_column)}" }
        %table.table.table-bordered.schedule-table#schedule
          %tr
            %th
            - td_start_time = start_time
            - (1..intervals).each do |i|
              %th.date
                = (td_start_time).strftime("%H:%M")
              - td_start_time += @step_minutes

          - start_room_time = start_time
          - @rooms.each do |room|
            - start_room_time = start_time
            - span = 1
            %tr
              %td.room{ style: "height: #{ td_height(@rooms) }px;" }
                .room.elipsis.break-words{ style: "-webkit-line-clamp: #{ room_lines(@rooms) }; height: #{ room_height(@rooms) }px;" }
                  = room.name
                - event_schedules = room.event_schedules.select{ |e| (e.schedule_id == @conference.program.selected_schedule.id) && (e.end_time > start_time) && (e.start_time <= (start_time + number_columns.hour)) }
                - (1..intervals).each do |i|
                  - if span > 1
                    - span -= 1
                  - else
                    - event_schedule = event_schedules.find{ |e| e.start_time <= start_room_time and e.end_time > start_room_time }
                    - if event_schedule && (event_schedule.event.state == 'canceled' || event_schedule.event.state == 'withdrawn') && !event_schedule.intersecting_events.confirmed.empty?
                      - replacement_event = event_schedule.intersecting_events.confirmed.first
                      - event_schedule = (replacement_event.start_time <= start_room_time && replacement_event.end_time > start_room_time) ? replacement_event : nil

                    - if event_schedule
                      / There is an event, calculate the span and show it
                      - event_span =  (event_schedule.end_time.to_i - start_room_time.to_i) / 60 / EventType::LENGTH_STEP
                      - span = ((event_span + i - 1 ) > intervals ? intervals  + 1 - i : event_span)
                      = render partial: 'schedule_item', locals: {event: event_schedule.event, event_schedule: event_schedule, span: span, width: width}
                    - else
                      / if span equals 1 show an empty td
                      %td.no-padding{ width: "#{ width }%"}
                  - start_room_time += @step_minutes
          - start_time = start_room_time - @step_minutes

  / Controls
  %a.left.carousel-control{ href: "#carousel-#{ date }-#{ number_columns }", |
                            role: "button", |
                            "data-slide" => "prev" }
    %span.glyphicon.glyphicon-chevron-left
  %a.right.carousel-control{ href: "#carousel-#{ date }-#{ number_columns }", |
                             role: "button", |
{'fraction_non_alphanumeric': 0.12776376316960975, 'fraction_numerical': 0.005638818815848048, 'mean_word_length': 1.8331231609920136, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3733260', 'n_tokens_mistral': 2035, 'n_tokens_neox': 1938, 'n_words': 384}