<tr id="<%= dom_id(location_release) %>">
  <td data-behavior="select"><%= check_box_tag "location_release_ids[]", location_release.id, false %></td>
  <td>
    <% if location_release.photo.attached? %>
      <%= image_tag medium_variant(location_release.photo), class: "img-fluid" %>
    <% else %>
      <%= fa_icon("warning", text: t(".no_photos"), class: "text-danger") %>
    <% end %>
  </td>
  <td>
    <%= location_release.name %>
  </td>
  <td>
    <%= contact_info address: location_release.address %>
  </td>
  <td>
    <%= notes_preview location_release.notes.order_by_recent %>
  </td>
  <td id="<%= dom_id location_release, "tags_preview" %>">
    <%= tags_preview location_release, location_release.tags %>
  </td>
    <td>
    <%= location_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, location_release, :note], class: "dropdown-item", remote: true %>
        <% end %>
        <% if policy(location_release.tags).new? %>
          <%= link_to fa_icon("tags fw", text: "Tags"), [:new, location_release, :acts_as_taggable_on_tag], class: "dropdown-item", remote: true %>
        <% end %>
        <% if policy(location_release).edit_photos? %>
          <%= link_to fa_icon("picture-o fw", text: "Photos"), [:edit, location_release, :photos], class: "dropdown-item" %>
        <% end %>
        <% if policy(Contract).show? && (location_release.contract.attached? || location_release.contract_template.present?) %>
          <%= link_to fa_icon("download fw", text: "Download"), [location_release, :contracts, format: "pdf"], class: "dropdown-item", target: "_blank" %>
        <% end %>
        <% if policy(location_release).edit? %>
          <%= link_to fa_icon("pencil fw", text: "Edit"), [:edit, location_release], class: "dropdown-item" %>
        <% end %>
        <% if policy(location_release).destroy? %>
          <%= link_to fa_icon("trash fw", text: "Delete"), location_release, class: "dropdown-item", method: :delete, data: { confirm: "Are you sure?" } %>
        <% end %>
      </div>
    </div>
  </td>
</tr>

