parent
df369cc985
commit
260b1dd2c3
@ -1,2 +1,21 @@
|
||||
module SchedulesHelper
|
||||
|
||||
def options_for_frequency_hours
|
||||
[
|
||||
['Once A Week', 24 * 7],
|
||||
['Every Other Week', 2 * 24 * 7],
|
||||
['Once A Month', 4 * 24 * 7]
|
||||
]
|
||||
end
|
||||
|
||||
def frequency_description(hours)
|
||||
case hours
|
||||
when (24 * 7)
|
||||
'Once A Week'
|
||||
when (2 * 24 * 7)
|
||||
'Every Other Week'
|
||||
when (4 * 24 * 7)
|
||||
'Once A Month'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -1,3 +1,6 @@
|
||||
%h1 New schedule
|
||||
= render 'form'
|
||||
= link_to 'Back', school_schedules_path(@schedule.school)
|
||||
.row
|
||||
.offset-2.col-8
|
||||
%h3 Create A New Schedule For This School
|
||||
= render 'form', schedule: @schedule
|
||||
%br
|
||||
%p= link_to 'Back', @school
|
||||
|
||||
@ -1,55 +1,77 @@
|
||||
%p
|
||||
%strong Name:
|
||||
= @school.name
|
||||
%p
|
||||
%strong District:
|
||||
= @school.district_id
|
||||
|
||||
%p= link_to "Add Recipient", new_school_recipient_path(@school)
|
||||
|
||||
%p= link_to "Bulk Add Recipients", import_school_recipients_path(@school)
|
||||
|
||||
%p= link_to "Create Recipient List", new_school_recipient_list_path(@school)
|
||||
|
||||
%p= link_to "Create A Question List", new_question_list_path()
|
||||
|
||||
-#%p= link_to "Create A Schedule", new_school_schedule_path(@school)
|
||||
|
||||
= link_to 'Edit', edit_school_path(@school)
|
||||
|
|
||||
= link_to 'Back', root_path
|
||||
|
||||
%br
|
||||
%br
|
||||
%br
|
||||
%h4 School Recipient Lists
|
||||
%table{style: 'width: 100%;'}
|
||||
%tbody
|
||||
%thead{style: 'font-weight: bold;'}
|
||||
%th Name
|
||||
%th Descriptin
|
||||
%th{colspan: 2} Actions
|
||||
- @school.recipient_lists.each do |recipient_list|
|
||||
%tr.recipient
|
||||
%td= link_to recipient_list.name, [@school, recipient_list]
|
||||
%td= recipient_list.description
|
||||
%td= link_to('Edit', edit_school_recipient_list_path(@school, recipient_list))
|
||||
%td= link_to('Delete', school_recipient_list_path(@school, recipient_list), method: :delete, data: {confirm: 'Are you sure you want to delete this list?'})
|
||||
|
||||
|
||||
%br
|
||||
%br
|
||||
%br
|
||||
%h4 School Recipients
|
||||
%table{style: 'width: 100%;'}
|
||||
%tbody
|
||||
%thead{style: 'font-weight: bold;'}
|
||||
%th Name
|
||||
%th Phone
|
||||
%th{colspan: 2} Actions
|
||||
- @school.recipients.each do |recipient|
|
||||
%tr.recipient
|
||||
%td= recipient.name
|
||||
%td= recipient.phone
|
||||
%td= link_to('Edit', edit_school_recipient_path(@school, recipient))
|
||||
%td= link_to('Delete', school_recipient_path(@school, recipient), method: :delete, data: {confirm: 'Are you sure you want to delete this recipient?'})
|
||||
.row
|
||||
.col
|
||||
%p
|
||||
%strong Name:
|
||||
= @school.name
|
||||
%p
|
||||
%strong District:
|
||||
= @school.district_id
|
||||
|
||||
%p= link_to "Add Recipient", new_school_recipient_path(@school)
|
||||
|
||||
%p= link_to "Bulk Add Recipients", import_school_recipients_path(@school)
|
||||
|
||||
%p= link_to "Create Recipient List", new_school_recipient_list_path(@school)
|
||||
|
||||
%p= link_to "Create A Question List", new_question_list_path()
|
||||
|
||||
%p= link_to "Create A Schedule", new_school_schedule_path(@school)
|
||||
|
||||
= link_to 'Edit', edit_school_path(@school)
|
||||
|
|
||||
= link_to 'Back', root_path
|
||||
|
||||
|
||||
%br
|
||||
%br
|
||||
%br
|
||||
%h4 School Schedules
|
||||
%table{style: 'width: 100%;'}
|
||||
%tbody
|
||||
%thead{style: 'font-weight: bold;'}
|
||||
%th Name
|
||||
%th Start
|
||||
%th End
|
||||
%th{colspan: 2} Actions
|
||||
- @school.schedules.each do |schedule|
|
||||
%tr.recipient
|
||||
%td= link_to schedule.name, [@school, schedule]
|
||||
%td= schedule.start_date
|
||||
%td= schedule.end_date
|
||||
%td= link_to('Edit', edit_school_recipient_list_path(@school, schedule))
|
||||
%td= link_to('Delete', school_recipient_list_path(@school, schedule), method: :delete, data: {confirm: 'Are you sure you want to delete this schedule?'})
|
||||
|
||||
%br
|
||||
%br
|
||||
%br
|
||||
%h4 School Recipient Lists
|
||||
%table{style: 'width: 100%;'}
|
||||
%tbody
|
||||
%thead{style: 'font-weight: bold;'}
|
||||
%th Name
|
||||
%th Descriptin
|
||||
%th{colspan: 2} Actions
|
||||
- @school.recipient_lists.each do |recipient_list|
|
||||
%tr.recipient
|
||||
%td= link_to recipient_list.name, [@school, recipient_list]
|
||||
%td= recipient_list.description
|
||||
%td= link_to('Edit', edit_school_recipient_list_path(@school, recipient_list))
|
||||
%td= link_to('Delete', school_recipient_list_path(@school, recipient_list), method: :delete, data: {confirm: 'Are you sure you want to delete this list?'})
|
||||
|
||||
|
||||
%br
|
||||
%br
|
||||
%br
|
||||
%h4 School Recipients
|
||||
%table{style: 'width: 100%;'}
|
||||
%tbody
|
||||
%thead{style: 'font-weight: bold;'}
|
||||
%th Name
|
||||
%th Phone
|
||||
%th{colspan: 2} Actions
|
||||
- @school.recipients.each do |recipient|
|
||||
%tr.recipient
|
||||
%td= recipient.name
|
||||
%td= recipient.phone
|
||||
%td= link_to('Edit', edit_school_recipient_path(@school, recipient))
|
||||
%td= link_to('Delete', school_recipient_path(@school, recipient), method: :delete, data: {confirm: 'Are you sure you want to delete this recipient?'})
|
||||
|
||||
Loading…
Reference in new issue