osem-fcy/app/views/admin/schedule/_event.html.haml
Ana 5001848af7 Introduce an Admin::EventScheduleController
- move SchedulesController#update action
- split it into an #create/#update and #destroy action and use these actions in the JS code
2016-08-11 15:11:27 +02:00

14 lines
802 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, |
event_schedule_id: event_schedule_id }
.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