mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
- Only use JS for the drag&drop functionality and to the set/alter the time and rooms of the EventSchedule object. - Introduce has_many :events, through: :event_schedules association to get unscheduled event easily
13 lines
745 B
Text
13 lines
745 B
Text
- cells_length = event.event_type.length / EventType::LENGTH_STEP
|
|
/ this height fits the room cells
|
|
- height = (cells_length * 58) - 23
|
|
/ 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.guid}", |
|
|
guid: event.guid, |
|
|
length: cells_length }
|
|
.schedule-event-text{ style: "-webkit-line-clamp: #{lines}; height: #{lines * 23}px;"}
|
|
%span.schedule-event-delete-button{ onclick: "Schedule.remove(\'event-#{event.guid}\');" } X
|
|
= event.title
|