64 lines
2.9 KiB
Plaintext
64 lines
2.9 KiB
Plaintext
<tr id="<%= dom_id(material_release) %>">
|
|
<td data-behavior="select"><%= check_box_tag "material_release_ids[]", material_release.id, false %></td>
|
|
<td class="text-center">
|
|
<% if material_release.approved? %>
|
|
<% tooltip_user_data = get_approval_data_for_releasable(material_release) %>
|
|
<i class="fa fa-check-circle fa-2x text-success"
|
|
data-toggle="tooltip"
|
|
title="<%= t '.messages.approved_tooltip', user: tooltip_user_data, timestamp: material_release.approved_at %>"></i>
|
|
<% end %>
|
|
</td>
|
|
<td>
|
|
<% if material_release.files.any? %>
|
|
<%= material_release.files.size %>
|
|
<% else %>
|
|
<%= fa_icon("warning", text: t(".no_media"), class: "text-danger") %>
|
|
<% end %>
|
|
</td>
|
|
<td>
|
|
<%= material_release.name %>
|
|
</td>
|
|
<td>
|
|
<%= contact_info_for(material_release.contact_person) %>
|
|
</td>
|
|
<td>
|
|
<%= notes_preview material_release.notes.order_by_recent %>
|
|
</td>
|
|
<td id="<%= dom_id material_release, "tags_preview" %>">
|
|
<%= tags_preview material_release, material_release.tags %>
|
|
</td>
|
|
<td>
|
|
<%= material_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, material_release, :note], class: "dropdown-item", remote: true %>
|
|
<% end %>
|
|
<% if policy(material_release.tags).new? %>
|
|
<%= link_to fa_icon("tags fw", text: "Tags"), [:new, material_release, :acts_as_taggable_on_tag], class: "dropdown-item", remote: true %>
|
|
<% end %>
|
|
<% if policy(material_release).edit_files? %>
|
|
<%= link_to fa_icon("file-o fw", text: "Media"), [:edit, material_release, :files], class: "dropdown-item" %>
|
|
<% end %>
|
|
<% if policy(Contract).show? && (material_release.contract.attached? || material_release.contract_template.present?) %>
|
|
<%= link_to fa_icon("download fw", text: "Download"), [material_release, :contracts, format: "pdf"], class: "dropdown-item", target: "_blank" %>
|
|
<% end %>
|
|
<% if policy(MaterialRelease).review? %>
|
|
<%= link_to fa_icon("search fw", text: t('.actions.review')), new_material_release_approvals_path(material_release), class: "dropdown-item" %>
|
|
<% end %>
|
|
<% if policy(material_release).edit? %>
|
|
<%= link_to fa_icon("pencil fw", text: "Edit"), [:edit, material_release], class: "dropdown-item" %>
|
|
<% end %>
|
|
<% if policy(material_release).destroy? %>
|
|
<%= link_to fa_icon("trash fw", text: "Delete"), material_release, class: "dropdown-item", method: :delete, data: { confirm: "Are you sure?" } %>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
|