<tr id="<%= dom_id(medical_release) %>">
  <td data-behavior="select"><%= check_box_tag "medical_release_ids[]", medical_release.id, false %></td>
  <td>
    <% if medical_release.photo.attached? %>
      <%= image_tag medium_variant(medical_release.photo), class: "img-fluid" %>
    <% end %>
  </td>
  <td>
    <%= medical_release.name %>
  </td>
  <td>
    <%= contact_info( 
      address: medical_release.person_address, 
      phone: medical_release.person_phone, 
      email: medical_release.person_email
    ) %>
  </td>
  <td>
    <%= notes_preview medical_release.notes.order_by_recent %>
  </td>
  <td id="<%= dom_id medical_release, "tags_preview" %>">
    <%= tags_preview medical_release, medical_release.tags %>
  </td>

   <td>
    <%= medical_release.signed_on %>
  </td>


  <td class="text-right">
    <div class="btn-group">
      <%= button_tag t(".actions.manage"), class: "btn btn-light btn-sm dropdown-toggle border", data: { toggle: "dropdown", boundary: "window" }, aria: { haspopup: true, expanded: false } %>
      <div class="dropdown-menu dropdown-menu-right">
        <% if policy(Note).new? %>
          <%= link_to fa_icon("sticky-note fw", text: "Notes"), [:new, medical_release, :note], class: "dropdown-item", remote: true %>
        <% end %>
        <% if policy(medical_release.tags).new? %>
          <%= link_to fa_icon("tags fw", text: "Tags"), [:new, medical_release, :acts_as_taggable_on_tag], class: "dropdown-item", remote: true %>
        <% end %>
        <% if policy(Contract).show? && (medical_release.contract.attached? || medical_release.contract_template.present?) %>
          <%= link_to fa_icon("download fw", text: "Download"), [medical_release, :contracts, format: "pdf"], class: "dropdown-item", target: "_blank" %>
        <% end %>
        <% if policy(medical_release).destroy? %>
          <%= link_to fa_icon("trash fw", text: "Delete"), medical_release, class: "dropdown-item", method: :delete, data: { confirm: "Are you sure?" } %>
        <% end %>
      </div>
    </div>
  </td>
</tr>
