pboksz/diamond-clinic

View on GitHub
app/views/admin/doctors/index.haml

Summary

Maintainability
Test Coverage
.wrapper.admin.doctors
  .container
    = render 'layouts/messages'

    .new-model
      %h2= t('admin.doctors.index.header')
      = link_to t('admin.doctors.index.add'), new_admin_doctor_path(locale), class: 'button'

    %table
      %thead
        %tr
          %td= t('admin.doctors.index.order')
          %td= t('admin.doctors.index.name')
          %td= t('admin.doctors.index.specialty')
          %td= t('admin.doctors.index.biography')
          %td= t('admin.actions')
      %tbody
        - @doctors.each do |doctor|
          %tr
            %td= doctor.order
            %td= doctor.name(locale: locale)
            %td= doctor.specialty(locale: locale)
            %td= readmore(doctor.biography(locale: locale), max_length: 100)
            %td.action
              = link_to edit_admin_doctor_path(locale, doctor) do
                = icon('pencil')
              = link_to admin_doctor_path(locale, doctor), method: :delete, data: { confirm: t('admin.confirm') } do
                = icon('trash-o')