<tr id="<%= dom_id(music_release) %>">
  <td data-behavior="select"><%= check_box_tag "music_release_ids[]", music_release.id, false %></td>
  <td>
    <%= music_release.name %>
  </td>
  <td>
    <%= music_release.file_infos.size %>
  </td>
  <td>
    <%= music_release.composers.size %>
  </td>
  <td>
    <%= music_release.publishers.size %>
  </td>
  <td>
    <%= notes_preview music_release.notes.order_by_recent %>
  </td>
  <td id="<%= dom_id music_release, "tags_preview" %>">
    <%= tags_preview music_release, music_release.tags %>
  </td>

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

