mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Also, the part of the schedule event is deleted and the length of the event types changes to the nearest suitable after changing the length of the interval. This closes #1220
18 lines
1,001 B
Text
18 lines
1,001 B
Text
- cells_length = event.event_type.length / @program.schedule_interval
|
|
/ this height fits the room cells
|
|
- compact_grid = @program.schedule_interval < 15
|
|
- single_cell_height = compact_grid ? 32 : 58
|
|
- height = (cells_length * single_cell_height)
|
|
- height -= 23 unless compact_grid
|
|
/ 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)}", |
|
|
id: "event-#{event.id}", |
|
|
event_id: event.id, |
|
|
length: cells_length, |
|
|
event_schedule_id: event_schedule_id, |
|
|
class: ('compact' if compact_grid) }
|
|
.schedule-event-text{ style: "-webkit-line-clamp: #{lines}; height: #{lines * 23}px;"}
|
|
%span.schedule-event-delete-button{ onclick: "Schedule.remove(\'event-#{event.id}\');" } X
|
|
= event.title
|