= content_for(:filters) do .search-form.filters = simple_form_for query, as: :q, url: appointments_path, method: :get do |f| .row .medium-3.large-2.columns = f.input :starts_at_eq, as: :date_picker, label: "Date" .medium-3.large-3.columns = f.input :clinic_id_eq, collection: clinics, label: "Clinic" .medium-3.large-3.columns = f.input :user_id_eq, as: :user_picker, collection: users, label: "User" .medium-3.large-3.columns.actions.end = f.submit "Filter", class: "button" = content_for(:actions) do = link_to "Add", new_appointment_path, class: "button" = simple_form_for request_html_form_params, url: pathology_requests_new_request_path, html: { autocomplete: "off", style: "display: inline" }, as: :request do |f| = f.input :patient_ids, as: :hidden_array = button_tag(type: "submit", class: "button secondary") do i.fas.fa-copy | Generate request forms = within_admin_layout(title: "Upcoming Clinic Visit Appointments") do table#appointments thead tr th.col-width-small | Generate request form? br | = link_to "(Uncheck all)", "#", id: "uncheck_all_appointments_link" th.col-width-medium th.col-width-date = sort_link([:renalware, query], :starts_at, "Date", default_order: :asc) th.col-width-time = sort_link([:renalware, query], :start_time, "Time", default_order: :asc) th.col-width-medium = sort_link([:renalware, query], :patient_family_name, "Patient", default_order: :asc) th.col-width-tiny Sex th.col-width-tiny Age th.col-width-small = sort_link([:renalware, query], :patient_current_modality_description_name, "Modality", default_order: :asc) th= sort_link([:renalware, query], :clinic_name, "Clinic", default_order: :asc) th= sort_link([:renalware, query], :user_family_name, "Consultant", default_order: :asc) tbody - appointments.each do |appointment| tr td= check_box_tag nil, appointment.patient.id, true, class: "patient_checkbox" td - if appointment.becomes_visit_id.present? = link_to edit_patient_clinic_visit_path(appointment.patient, id: appointment.becomes_visit_id) do i.fas.fa-file |    | View Clinic Visit - else = link_to new_patient_clinic_visit_path(appointment.patient, appointment_id: appointment.id) do i.fas.fa-pencil-alt |    | Create Clinic Visit td= I18n.l appointment.starts_on td= appointment.start_time td= default_patient_link(appointment.patient) td= appointment.patient.sex.code td= appointment.patient.age td= appointment.patient.current_modality td= appointment.clinic.name td= appointment.user.full_name = paginate appointments