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