Corrections in SchedulesController
- Controler file name pluralized - Load and authorization fixed and improved - Consider that save can fail in create action - Eliminate unnecessary if in update action - Ability and tests related to the schedules link in the admin sidebar fixed
This commit is contained in:
parent
2e1cd164a4
commit
29b920d746
9 changed files with 67 additions and 69 deletions
21
app/views/admin/schedules/_day_tab.html.haml
Normal file
21
app/views/admin/schedules/_day_tab.html.haml
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
- 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_id: room.id, |
|
||||
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?
|
||||
- event_schedule = event_schedules.first
|
||||
= render partial: 'event', locals: { event: event_schedule.event, event_schedule_id: event_schedule.id}
|
||||
Loading…
Add table
Add a link
Reference in a new issue