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
20 lines
950 B
Text
20 lines
950 B
Text
- date_event_schedules = @event_schedules.select{ |e| e.start_time.to_date.eql? date }
|
|
.row
|
|
- @rooms.each do |room|
|
|
.col-md-2.col-xs-6
|
|
.room-name
|
|
- room_date_event_schedules = date_event_schedules.select{ |e| e.room == room }
|
|
= room.name
|
|
- (9*4..18*4).each do |slot|
|
|
- hour = slot / 4
|
|
- minutes = (15 * (slot % 4) == 0) ? '00' : 15 * (slot % 4)
|
|
- time = "#{hour}:#{minutes}"
|
|
.schedule-room-slot{ id: "schedule-room-#{room.guid}-#{hour}-#{minutes}", |
|
|
"room-guid" => room.guid, |
|
|
hour: time, |
|
|
date: date}
|
|
.div
|
|
= time
|
|
- event_schedules = room_date_event_schedules.select{ |e| (e.start_time.hour.to_s + e.start_time.strftime(':%M')).eql? time }
|
|
- if event_schedules.any?
|
|
= render partial: 'event', locals: { event: event_schedules.first.event }
|