<tr id="<%= dom_id(misc_release) %>">
  <td data-behavior="select"><%= check_box_tag "misc_release_ids[]", misc_release.id, false %></td>
  <td class="text-center">
    <% if misc_release.approved? %>
      <% tooltip_user_data = get_approval_data_for_releasable(misc_release) %>
      <i class="fa fa-check-circle fa-2x text-success"
         data-toggle="tooltip"
         title="<%= t '.messages.approved_tooltip', user: tooltip_user_data, timestamp: misc_release.approved_at %>"></i>
    <% end %>
  </td>
  <td>
    <% if misc_release.photo.attached? %>
      <%= image_tag medium_variant(misc_release.photo), class: "img-fluid" %>
    <% end %>
  </td>
  <td>
    <%= misc_release.name %>
  </td>
  <td>
    <%= contact_info( 
      address: misc_release.person_address, 
      phone: misc_release.person_phone, 
      email: misc_release.person_email
    ) %>
  </td>
  <td>
    <%= notes_preview misc_release.notes.order_by_recent %>
  </td>
  <td id="<%= dom_id misc_release, "tags_preview" %>">
    <%= tags_preview misc_release, misc_release.tags %>
  </td>

   <td>
    <%= misc_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, misc_release, :note], class: "dropdown-item", remote: true %>
        <% end %>
        <% if policy(misc_release.tags).new? %>
          <%= link_to fa_icon("tags fw", text: "Tags"), [:new, misc_release, :acts_as_taggable_on_tag], class: "dropdown-item", remote: true %>
        <% end %>
        <% if policy(MiscRelease).review? %>
          <%= link_to fa_icon("search fw", text: t('.actions.review')), new_misc_release_approvals_path(misc_release), class: "dropdown-item" %>
        <% end %>
        <% if policy(MedicalRelease).download_single? && policy(Contract).show? && (misc_release.contract.attached? || misc_release.contract_template.present?) %>
          <%= link_to fa_icon("download fw", text: "Download"), [misc_release, :contracts, format: "pdf"], class: "dropdown-item", target: "_blank" %>
        <% end %>
        <% if policy(misc_release).destroy? %>
          <%= link_to fa_icon("trash fw", text: "Delete"), misc_release, class: "dropdown-item", method: :delete, data: { confirm: "Are you sure?" } %>
        <% end %>
      </div>
    </div>
  </td>
</tr>
