- content_for(:body_class) { "renal-profile-edit" } .profile-info-form = render layout: "renalware/shared/fieldset", locals: { legend: "Diagnosis & ESRF Info", name: "diagnosis" } do = f.input :esrf_on, as: :date_picker, wrapper: :horizontal_datepicker = f.input :weight_at_esrf, wrapper: :horizontal_small = f.input :modality_at_esrf, include_blank: "Select modality", wrapper: :horizontal_small = f.input :first_seen_on, as: :date_picker, wrapper: :horizontal_datepicker = f.association :prd_description, collection: Renalware::Renal::PRDDescription.all.order(:term), input_html: { \ class: "searchable_select", \ data: { \ placeholder: "", "allow-clear" => "true" }} = f.input :comorbidities_updated_on, as: :date_picker, wrapper: :horizontal_datepicker = f.simple_fields_for :document, f.object.document do |fd| = render layout: "renalware/shared/fieldset", locals: { legend: "Comorbidities", name: "comorbidities" } do = fd.simple_fields_for :comorbidities, fd.object.comorbidities do |fcm| = link_to "Set all comorbidities to No", "#", class: "set_all_comorbidities_to_no" table.comorbidities.align-centre - fcm.object.class.attributes_list.each do |attribute| = render_input fcm, attribute - f.object.build_address_at_diagnosis if f.object.address_at_diagnosis.blank? - label = "Address at ESRF Date" / If the user wants to overwrite or copy in the patient's current address, we use js to / clone the hidden current address form fields in edit.slim and replace the visible / address form fields below with them. #visible-address-form = f.simple_fields_for :address_at_diagnosis_attributes, f.object.address_at_diagnosis do |a| article#address_at_diagnosis header h2= label = link_to "Use current address", "", id: "use-current-address-for-address-at-diagnosis", class: "button left" = a.input :id, as: :hidden .form-content= render("renalware/addresses/form", a: a)