Inform that there are no rooms in the schedule

Inform that there are no rooms when creating the schedule with a message instead of creating a room with the title "No rooms". The message also include a link to the place where rooms are created.
This commit is contained in:
Ana 2016-07-19 23:49:06 +02:00
parent f65778b4fe
commit 2d95cd05ff
2 changed files with 32 additions and 25 deletions

View file

@ -26,7 +26,7 @@ module Admin
@unscheduled_events = @program.events - schedule.events @unscheduled_events = @program.events - schedule.events
@selected_schedule_id = @conference.program.selected_schedule.try(:id) @selected_schedule_id = @conference.program.selected_schedule.try(:id)
@dates = @conference.start_date..@conference.end_date @dates = @conference.start_date..@conference.end_date
@rooms = (@venue && @venue.rooms.any?) ? @venue.rooms : [Room.new(name: 'No Rooms!', size: 0)] @rooms = @venue.rooms if @venue && @venue.rooms.any?
end end
def update def update

View file

@ -5,6 +5,13 @@
%p.text-muted %p.text-muted
Create the schedules for the conference Create the schedules for the conference
- if @rooms.nil?
.h3
No Rooms!
%small
= link_to 'Create rooms', admin_conference_venue_rooms_path
before creating the schedule.
- else
.row .row
.col-md-2 .col-md-2
Selected schedule Selected schedule