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