JuanVqz/doctors

View on GitHub
app/views/patient_referrals/index.html.haml

Summary

Maintainability
Test Coverage
= render 'shared/section' do
  .flex.flex-col.md:flex-row.md:justify-between
    = render 'shared/actions', model: :patient_referral, search_path: nil

= render 'shared/section' do
  = render 'shared/table' do
    %thead.border-b.border-gray-300.dark:border-gray-700.text-gray-400
      %tr
        %th.py-2{scope: :col}= t('.patient')
        %th.py-2{scope: :col}= t('.doctor')
        %th.py-2{scope: :col}= t('.created_at')
        %th.py-2.text-center{scope: :col}= t('.actions')
    %tbody
      - @patient_referrals.each do |patient_referral|
        %tr.hover:bg-gray-200.dark:hover:bg-gray-700
          %td.py-2.whitespace-nowrap= patient_referral.patient
          %td.py-2.whitespace-nowrap= patient_referral.referred_doctor
          %td.py-2.whitespace-nowrap= patient_referral.created_at.to_date
          %td.py-2.whitespace-nowrap
            .flex.flex-row.justify-center.gap-2
              = link_to patient_referral_path(patient_referral, format: :pdf), 'data-tooltip': t('tooltips.defaults.print'), class: "#{secondary_button} tooltip tooltip-top", target: :_blank do
                %span.fa.fa-print.text-red-600
              = link_to edit_patient_referral_path(patient_referral), 'data-tooltip': t('tooltips.defaults.edit'), class: "#{secondary_button} tooltip tooltip-top" do
                %span.fa.fa-edit.text-yellow-600
              = link_to patient_referral, 'data-tooltip': t('tooltips.defaults.details'), class: "#{secondary_button} tooltip tooltip-top" do
                %span.fa.fa-eye.text-sky-600
  = render 'shared/pagination', pagy: @pagy