Sha256: 1963a402d172a07c7c2e045d9367a271dedde4d595487a4a66a244a51e89c492

Contents?: true

Size: 1.65 KB

Versions: 56

Compression:

Stored size: 1.65 KB

Contents

= within_admin_layout(title: "New",
  breadcrumbs: breadcrumb_for("Clinic Appointments", appointments_path)) do

  = simple_form_for appointment,
      url: appointments_path,
      method: :post,
      html: { autocomplete: "off" },
      wrapper: "horizontal_form" do |f|

    / Note the shenanigans to get the select2 to redisplay the patient after a validation error
    / or on an edit. Selected: 1 means just select the option at index 1 - option at index 0 is always
    / the blank option. Selecting index 1 fails silently if there is nothing there (no patient
    / selected yet) otherwise it will display the selected patient who will always be
    / at option index 1.
    #patient-select2
      = f.input :patient_id,
                wrapper: :horizontal_medium,
                collection: [[appointment.patient&.to_s(:long), appointment.patient&.id]],
                selected: 1,
                input_html: { \
                  class: "patient-id-select2 patient-ajax-search",
                  data: { "ajax--url" => search_patients_path(format: :json),
                          placeholder: "Search by patient name or hospital/NHS no." } \
              }

    = f.input :clinic_id,
              collection: Renalware::Clinics::Clinic.all,
              wrapper: :horizontal_medium
    = f.input :consultant_id,
              collection: Renalware::Renal::Consultant.pluck(:name, :id),
              wrapper: :horizontal_medium
    = f.input :starts_at, as: :datetime_picker, wrapper: :horizontal_datepicker
    = f.input :outcome_notes, as: :text, wrapper: :horizontal_large
    = f.input :dna_notes, as: :text, wrapper: :horizontal_large
    = f.submit class: :button

Version data entries

56 entries across 56 versions & 1 rubygems

Version Path
renalware-core-2.1.1 app/views/renalware/clinics/appointments/new.html.slim
renalware-core-2.1.0 app/views/renalware/clinics/appointments/new.html.slim
renalware-core-2.0.167 app/views/renalware/clinics/appointments/new.html.slim
renalware-core-2.0.166 app/views/renalware/clinics/appointments/new.html.slim
renalware-core-2.0.165 app/views/renalware/clinics/appointments/new.html.slim
renalware-core-2.0.164 app/views/renalware/clinics/appointments/new.html.slim
renalware-core-2.0.163 app/views/renalware/clinics/appointments/new.html.slim
renalware-core-2.0.162 app/views/renalware/clinics/appointments/new.html.slim
renalware-core-2.0.161 app/views/renalware/clinics/appointments/new.html.slim
renalware-core-2.0.160 app/views/renalware/clinics/appointments/new.html.slim
renalware-core-2.0.159 app/views/renalware/clinics/appointments/new.html.slim
renalware-core-2.0.158 app/views/renalware/clinics/appointments/new.html.slim
renalware-core-2.0.157 app/views/renalware/clinics/appointments/new.html.slim
renalware-core-2.0.156 app/views/renalware/clinics/appointments/new.html.slim
renalware-core-2.0.155 app/views/renalware/clinics/appointments/new.html.slim
renalware-core-2.0.153 app/views/renalware/clinics/appointments/new.html.slim
renalware-core-2.0.152 app/views/renalware/clinics/appointments/new.html.slim
renalware-core-2.0.151 app/views/renalware/clinics/appointments/new.html.slim
renalware-core-2.0.149 app/views/renalware/clinics/appointments/new.html.slim
renalware-core-2.0.148 app/views/renalware/clinics/appointments/new.html.slim