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:
parent
60877e9593
commit
1636b458ee
2 changed files with 32 additions and 25 deletions
|
|
@ -25,7 +25,7 @@ module Admin
|
||||||
@event_schedules = @schedule.event_schedules
|
@event_schedules = @schedule.event_schedules
|
||||||
@unscheduled_events = @program.events.confirmed - @schedule.events
|
@unscheduled_events = @program.events.confirmed - @schedule.events
|
||||||
@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 = @conference.venue.rooms if @conference.venue
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
|
|
|
||||||
|
|
@ -7,30 +7,37 @@
|
||||||
%p.text-muted
|
%p.text-muted
|
||||||
Create the schedules for the conference
|
Create the schedules for the conference
|
||||||
|
|
||||||
.row
|
- if @rooms.present?
|
||||||
.col-md-2
|
.row
|
||||||
Selected schedule
|
.col-md-2
|
||||||
= check_box_tag @conference.short_title, @schedule.id, (@schedule.id == @selected_schedule.try(:id)),
|
Selected schedule
|
||||||
method: :patch, url: (admin_conference_program_path(@conference.short_title) + '?[program][selected_schedule_id]='),
|
= check_box_tag @conference.short_title, @schedule.id, (@schedule.id == @selected_schedule.try(:id)),
|
||||||
class: 'switch-checkbox-schedule', data: { size: 'small',
|
method: :patch, url: (admin_conference_program_path(@conference.short_title) + '?[program][selected_schedule_id]='),
|
||||||
off_color: 'warning',
|
class: 'switch-checkbox-schedule', data: { size: 'small',
|
||||||
on_text: 'Yes',
|
off_color: 'warning',
|
||||||
off_text: 'No' }
|
on_text: 'Yes',
|
||||||
.h4
|
off_text: 'No' }
|
||||||
Unscheduled events
|
.h4
|
||||||
.unscheduled-events
|
Unscheduled events
|
||||||
- @unscheduled_events.each do |e|
|
.unscheduled-events
|
||||||
= render partial: 'event', locals: { event: e, event_schedule_id: nil }
|
- @unscheduled_events.each do |e|
|
||||||
.col-md-10
|
= render partial: 'event', locals: { event: e, event_schedule_id: nil }
|
||||||
%ul.nav.nav-tabs
|
.col-md-10
|
||||||
- @dates.each do |date|
|
%ul.nav.nav-tabs
|
||||||
%li{ class: "#{ (@dates.first == date) ? 'active' : '' }"}
|
- @dates.each do |date|
|
||||||
%a{ href: "##{date}" }
|
%li{ class: "#{ (@dates.first == date) ? 'active' : '' }"}
|
||||||
= date
|
%a{ href: "##{date}" }
|
||||||
.tab-content
|
= date
|
||||||
- @dates.each do |date|
|
.tab-content
|
||||||
.tab-pane{ class: "#{ (@dates.first == date) ? 'active' : '' }", id: "#{date}" }
|
- @dates.each do |date|
|
||||||
= render partial: 'day_tab', locals: { date: date }
|
.tab-pane{ class: "#{ (@dates.first == date) ? 'active' : '' }", id: "#{date}" }
|
||||||
|
= render partial: 'day_tab', locals: { date: date }
|
||||||
|
- else
|
||||||
|
.h3
|
||||||
|
No Rooms!
|
||||||
|
%small
|
||||||
|
= link_to 'Create rooms', admin_conference_venue_rooms_path
|
||||||
|
before creating the schedule.
|
||||||
|
|
||||||
:javascript
|
:javascript
|
||||||
$(document).ready( function() {
|
$(document).ready( function() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue