mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-13 17:30:38 -07:00
working on schedules
This commit is contained in:
parent
72418edd7c
commit
2fb55a7443
26 changed files with 726 additions and 1 deletions
51
app/views/schedules/_form.html.haml
Normal file
51
app/views/schedules/_form.html.haml
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
= form_for([@schedule.school, @schedule]) do |f|
|
||||
- if @schedule.errors.any?
|
||||
#error_explanation
|
||||
%h2
|
||||
= pluralize(@schedule.errors.count, "error")
|
||||
prohibited this schedule from being saved:
|
||||
%ul
|
||||
- @schedule.errors.full_messages.each do |msg|
|
||||
%li= msg
|
||||
.field
|
||||
= f.label :name
|
||||
%br/
|
||||
= f.text_field :name
|
||||
.field
|
||||
= f.label :description
|
||||
%br/
|
||||
= f.text_area :description
|
||||
.field
|
||||
= f.label :school_id
|
||||
%br/
|
||||
= f.number_field :school_id
|
||||
.field
|
||||
= f.label :frequency_hours
|
||||
%br/
|
||||
= f.number_field :frequency_hours
|
||||
.field
|
||||
= f.label :start_date
|
||||
%br/
|
||||
= f.date_select :start_date
|
||||
.field
|
||||
= f.label :end_date
|
||||
%br/
|
||||
= f.date_select :end_date
|
||||
.field
|
||||
= f.label :active
|
||||
%br/
|
||||
= f.check_box :active
|
||||
.field
|
||||
= f.label :random
|
||||
%br/
|
||||
= f.check_box :random
|
||||
.field
|
||||
= f.label :recipient_list_id
|
||||
%br/
|
||||
= f.number_field :recipient_list_id
|
||||
.field
|
||||
= f.label :question_list_id
|
||||
%br/
|
||||
= f.number_field :question_list_id
|
||||
.actions
|
||||
= f.submit
|
||||
5
app/views/schedules/edit.html.haml
Normal file
5
app/views/schedules/edit.html.haml
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
%h1 Editing schedule
|
||||
= render 'form'
|
||||
= link_to 'Show', [@schedule.school, @schedule]
|
||||
|
|
||||
= link_to 'Back', school_schedules_path(@schedule.school)
|
||||
33
app/views/schedules/index.html.haml
Normal file
33
app/views/schedules/index.html.haml
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
%h1 Listing schedules
|
||||
%table
|
||||
%tr
|
||||
%th Name
|
||||
%th Description
|
||||
%th School
|
||||
%th Frequency hours
|
||||
%th Start date
|
||||
%th End date
|
||||
%th Active
|
||||
%th Random
|
||||
%th Recipient list
|
||||
%th Question list
|
||||
%th
|
||||
%th
|
||||
%th
|
||||
- @schedules.each do |schedule|
|
||||
%tr
|
||||
%td= schedule.name
|
||||
%td= schedule.description
|
||||
%td= schedule.school.name
|
||||
%td= schedule.frequency_hours
|
||||
%td= schedule.start_date
|
||||
%td= schedule.end_date
|
||||
%td= schedule.active
|
||||
%td= schedule.random
|
||||
%td= schedule.recipient_list.name
|
||||
%td= schedule.question_list.name
|
||||
%td= link_to 'Show', [schedule.school, schedule]
|
||||
%td= link_to 'Edit', edit_school_schedule_path(schedule.school, schedule)
|
||||
%td= link_to 'Destroy', [schedule.school, schedule], :confirm => 'Are you sure?', :method => :delete
|
||||
%br/
|
||||
= link_to 'New Schedule', new_school_schedule_path(@school)
|
||||
3
app/views/schedules/new.html.haml
Normal file
3
app/views/schedules/new.html.haml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
%h1 New schedule
|
||||
= render 'form'
|
||||
= link_to 'Back', school_schedules_path(@schedule.school)
|
||||
34
app/views/schedules/show.html.haml
Normal file
34
app/views/schedules/show.html.haml
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
%p#notice= notice
|
||||
%p
|
||||
%b Name:
|
||||
= @schedule.name
|
||||
%p
|
||||
%b Description:
|
||||
= @schedule.description
|
||||
%p
|
||||
%b School:
|
||||
= @schedule.school.name
|
||||
%p
|
||||
%b Frequency hours:
|
||||
= @schedule.frequency_hours
|
||||
%p
|
||||
%b Start date:
|
||||
= @schedule.start_date
|
||||
%p
|
||||
%b End date:
|
||||
= @schedule.end_date
|
||||
%p
|
||||
%b Active:
|
||||
= @schedule.active
|
||||
%p
|
||||
%b Random:
|
||||
= @schedule.random
|
||||
%p
|
||||
%b Recipient list:
|
||||
= @schedule.recipient_list.name
|
||||
%p
|
||||
%b Question list:
|
||||
= @schedule.question_list.name
|
||||
= link_to 'Edit', edit_school_schedule_path(@schedule.school, @schedule)
|
||||
|
|
||||
= link_to 'Back', school_schedules_path(@schedule.school)
|
||||
4
app/views/school/schedules/index.json.jbuilder
Normal file
4
app/views/school/schedules/index.json.jbuilder
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
json.array!(@school_schedules) do |school_schedule|
|
||||
json.extract! school_schedule, :id, :name, :description, :school_id, :frequency_hours, :start_date, :end_date, :active, :random, :recipient_list_id, :question_list_id
|
||||
json.url school_schedule_url(school_schedule, format: :json)
|
||||
end
|
||||
1
app/views/school/schedules/show.json.jbuilder
Normal file
1
app/views/school/schedules/show.json.jbuilder
Normal file
|
|
@ -0,0 +1 @@
|
|||
json.extract! @school_schedule, :id, :name, :description, :school_id, :frequency_hours, :start_date, :end_date, :active, :random, :recipient_list_id, :question_list_id, :created_at, :updated_at
|
||||
Loading…
Add table
Add a link
Reference in a new issue