Commit c3720adb authored by Chrysanthi Lagodimou's avatar Chrysanthi Lagodimou

Merge branch 'changes/improving-behavior-after-submitting-hours' into 'develop'

Changes/Improving behavior after submitting hours

See merge request !850
parents a3eb4e25 63425901
Pipeline #31157 passed with stage
in 41 minutes and 42 seconds
......@@ -53,9 +53,10 @@ module ApplicationHelper
}, class: html_class }
end
def checkbox_toggle_collapse(f, field, collapse_selector, check_shows: true, label_html: nil, type: :boolean)
def checkbox_toggle_collapse(f, field, collapse_selector, check_shows: true, label_html: nil, type: :boolean, disabled: false)
input_html = { data: { collapse: collapse_selector, check_shows: check_shows },
class: 'checkbox-toggle-collapse' }
class: 'checkbox-toggle-collapse',
disabled: disabled }
f.input(field, type: type, input_html: input_html, label_html: label_html)
end
......
- disabled = @semester_process_volunteer.commited_at.present?
= simple_form_for(@semester_process_volunteer, html: { class: 'col-xs-12 '},
url: submit_review_semester_process_volunteer_path(@semester_process_volunteer)) do |f|
= simple_error_notice f
h1 Halbjahres-Rapporte #{@semester_process_volunteer.semester_t} für #{@semester_process_volunteer.volunteer.contact.full_name}
- if disabled
.submit-box
.col-xs-12
p.text-danger Bestätigt am #{l(@semester_process_volunteer.commited_at.to_date)} durch #{profile_link(@semester_process_volunteer.commited_by)}
= f.simple_fields_for :semester_feedbacks, @semester_process_volunteer.semester_process_volunteer_missions do |spvm|
- mission = spvm.object.mission
......@@ -15,7 +20,7 @@
= ff.input :spv_mission_id, as: :hidden, input_html: { value: spvm.object.id }
- [:goals, :achievements, :future, :comments, :conversation].each do |field|
.row
.col-xs-12= ff.input field
.col-xs-12= ff.input field, disabled: disabled
- if mission.hours.any?
h3 Stunden
......@@ -26,24 +31,22 @@
.row
.col-xs-12= hf.input :hours, label: "Restliche Stunden in diesem Semester #{@semester_process_volunteer.semester_period}",
input_html: { value: f.object.hours == 0 ? '' : f.object.hours, min: 0},
required: false
required: false,
disabled: disabled
h3 Spesen
= f.simple_fields_for :volunteer, @volunteer do |vf|
.row.text-left#volunteer-update-waive-and-iban
.col-xs-12
= vf.input_field :id, type: :hidden
= checkbox_toggle_collapse(vf, :waive, '#not-waive-expenses', check_shows: false)
= checkbox_toggle_collapse(vf, :waive, '#not-waive-expenses', check_shows: false, disabled: disabled)
.col-xs-12#not-waive-expenses
.row
.col-xs-4= vf.input :iban
.col-xs-4= vf.input :bank
.col-xs-4= vf.input :iban, disabled: disabled
.col-xs-4= vf.input :bank, disabled: disabled
.submit-box
.col-xs-12
p Ich bestätige, dass ich alle meine Stunden und Halbjahres-Rapporte bis zum heutigen Datum erfasst habe.
- if @semester_process_volunteer.commited_at.present?
p.text-danger Bestätigt am #{l(@semester_process_volunteer.commited_at.to_date)} durch #{profile_link(@semester_process_volunteer.commited_by)}
- else
- unless disabled
.submit-box
.col-xs-12
p Ich bestätige, dass ich alle meine Stunden und Halbjahres-Rapporte bis zum heutigen Datum erfasst habe.
= f.submit 'Bestätigen', class: 'btn btn-lg-accepted'
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment