2017-03-02 20:53:20 +03:00
|
|
|
- cells_length = event.event_type.length / @program.schedule_interval
|
2016-07-31 18:41:27 +02:00
|
|
|
/ this height fits the room cells
|
2017-03-02 20:53:20 +03:00
|
|
|
- compact_grid = @program.schedule_interval < 15
|
2017-01-17 14:46:12 +02:00
|
|
|
- single_cell_height = compact_grid ? 32 : 58
|
|
|
|
|
- height = (cells_length * single_cell_height)
|
|
|
|
|
- height -= 23 unless compact_grid
|
2016-07-31 18:41:27 +02:00
|
|
|
/ subtracting the padding before calculate the number of lines
|
|
|
|
|
- lines = (height - 7) / 23
|
|
|
|
|
- color = event.track.try(:color).present? ? event.track.try(:color) : 'FFFFFF'
|
|
|
|
|
.schedule-event{ style: "height: #{height}px; background-color: #{color}; color: #{contrast_color(color)}", |
|
2016-08-03 23:22:09 +02:00
|
|
|
id: "event-#{event.id}", |
|
|
|
|
|
event_id: event.id, |
|
2016-08-01 00:52:52 +02:00
|
|
|
length: cells_length, |
|
2017-01-17 14:46:12 +02:00
|
|
|
event_schedule_id: event_schedule_id, |
|
|
|
|
|
class: ('compact' if compact_grid) }
|
2016-07-31 18:41:27 +02:00
|
|
|
.schedule-event-text{ style: "-webkit-line-clamp: #{lines}; height: #{lines * 23}px;"}
|
2016-08-03 23:22:09 +02:00
|
|
|
%span.schedule-event-delete-button{ onclick: "Schedule.remove(\'event-#{event.id}\');" } X
|
2016-07-31 18:41:27 +02:00
|
|
|
= event.title
|