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
36
app/views/admin/schedules/show.html.haml
Normal file
36
app/views/admin/schedules/show.html.haml
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
.row
|
||||
.col-md-12
|
||||
.page-header
|
||||
%h1 Schedule
|
||||
%p.text-muted
|
||||
Create the schedules for the conference
|
||||
|
||||
.row
|
||||
.col-md-2
|
||||
Selected schedule
|
||||
= check_box_tag @conference.short_title, @schedule.id, (@schedule.id == @selected_schedule.try(:id)),
|
||||
method: :put, url: (admin_conference_schedule_path(@conference.short_title, @schedule) + '?selected_schedule='),
|
||||
class: 'switch-checkbox', data: { size: 'small',
|
||||
off_color: 'warning',
|
||||
on_text: 'Yes',
|
||||
off_text: 'No' }
|
||||
.h4
|
||||
Unscheduled events
|
||||
.unscheduled-events
|
||||
- @unscheduled_events.each do |e|
|
||||
= render partial: 'event', locals: { event: e, event_schedule_id: nil }
|
||||
.col-md-10
|
||||
%ul.nav.nav-tabs
|
||||
- @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
|
||||
$(document).ready( function() {
|
||||
Schedule.initialize("#{admin_conference_event_schedule_index_path(@conference)}", "#{@schedule.id}");
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue