Cache admin schedule event partial

This commit is contained in:
James Mason 2018-09-25 17:13:40 -07:00 committed by Henne Vogelsang
parent 111fe83452
commit 21b908ad38

View file

@ -1,14 +1,15 @@
- cells_length = event.event_type.length / @program.schedule_interval - cache [:admin, @conference, @program, :schedule, event] do
/ this height fits the room cells - cells_length = event.event_type.length / @program.schedule_interval
- compact_grid = @program.schedule_interval < 15 / this height fits the room cells
- single_cell_height = compact_grid ? 32 : 58 - compact_grid = @program.schedule_interval < 15
- height = (cells_length * single_cell_height) - single_cell_height = compact_grid ? 32 : 58
- height -= 23 unless compact_grid - height = (cells_length * single_cell_height)
/ subtracting the padding before calculate the number of lines - height -= 23 unless compact_grid
- lines = (height - 7) / 23 / subtracting the padding before calculate the number of lines
- color = event.track.try(:color).present? ? event.track.try(:color) : 'FFFFFF' - lines = (height - 7) / 23
- non_schedulable = event_schedule_id && (EventSchedule.find(event_schedule_id).schedule != @schedule) - color = event.track.try(:color).present? ? event.track.try(:color) : 'FFFFFF'
.schedule-event{ style: "height: #{height}px; background-color: #{color}; color: #{contrast_color(color)}", | - non_schedulable = event_schedule_id && (EventSchedule.find(event_schedule_id).schedule != @schedule)
.schedule-event{ style: "height: #{height}px; background-color: #{color}; color: #{contrast_color(color)}", |
id: "event-#{event.id}", | id: "event-#{event.id}", |
event_id: event.id, | event_id: event.id, |
length: cells_length, | length: cells_length, |