Actions
<%= link_to edit_asset_path(@asset), class: 'action_button' do %>
<%= icon("edit", library: "tabler", "aria-hidden": true) %> Edit
<% end %>
<%= link_to 'Back', assets_path %>
Thumbnail
<%= image_tag @asset.upload.url(:medium), style: "max-width: 300px; max-height: 300px;" %>
<% end %>
Attached to
<% nodes = @asset.attached_nodes %>
<% if nodes.any? %>
-
<% nodes.each do |node| %>
- <%= link_to node.title, node_path(node) %> <% if node.editable_page&.headline_asset == @asset %> <%= icon("star", library: "tabler", "aria-hidden": true) %> <% end %> <% unless node.head && node.head.related_assets.exists?(:asset_id => @asset.id) %> pending versions only <% end %> <% end %>
Public Path
<% public_path = @asset.upload.url.sub(/\?\d+$/, "") %>
<%= link_to public_path, public_path, target: "_blank", rel: "noopener" %>
Creator
<%= @asset.creator.presence || "—" %>
Source
<% if @asset.source_url.present? %>
<%= link_to @asset.source_url, @asset.source_url %>
<% else %>
—
<% end %>
License
<% if (license = AssetLicense.find(@asset.license_key)) %>
<%= t("asset_licenses.#{license.key}") %>
<% else %>
—
<% end %>
Content Type
<%= @asset.upload.content_type %>
Size
<%= "#{@asset.upload.size/1024} KB" %>