- title 'Messages Inbox'

br
h2 Inbox

= render 'provider/admin/messages/menu'

- if @messages.blank?
  p= t('provider.admin.messages.no_received_messages')

- else
  = render 'provider/admin/messages/bulk_operations', scope: :received_messages, messages: @messages

  table#messages.data
    thead
      tr
        th.select= bulk_select_all
        th From
        th Subject
        th Date Sent
        th
    tbody
      - @messages.each do |message|
        tr class=message.state id="message_#{message.id}"
          td.select= bulk_select_one message
          td= message_sender(message)
          td= link_to message_subject(message), provider_admin_messages_inbox_path(message)
          td= message.created_at.to_s(:long)
          td= delete_button_for provider_admin_messages_inbox_path(message)

  = will_paginate(@messages)
  = link_to_export_widget_for('Messages') if can?(:export, :data)
