From 8b6d3c76451d4ece5fd829d0e2d96a00aa19122d Mon Sep 17 00:00:00 2001 From: erdgeist Date: Wed, 22 Jul 2026 20:44:34 +0200 Subject: Add attached nodes subsection in assets#show and thumbnail in nodes#create --- app/views/assets/show.html.erb | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'app/views/assets/show.html.erb') diff --git a/app/views/assets/show.html.erb b/app/views/assets/show.html.erb index e551e358..27238211 100644 --- a/app/views/assets/show.html.erb +++ b/app/views/assets/show.html.erb @@ -21,6 +21,31 @@
<%= image_tag @asset.upload.url(:medium), style: "max-width: 300px; max-height: 300px;" %>
<% end %> +
Attached to
+
+ <% nodes = @asset.attached_nodes %> + <% if nodes.any? %> + + <% else %> + — not attached to any page — + <% end %> + <%= link_to new_node_path(:asset_id => @asset.id), :class => "action_button" do %> + <%= icon("file-plus", library: "tabler", "aria-hidden": true) %> New page with this attachment + <% end %> +
+
Public Path
<% public_path = @asset.upload.url.sub(/\?\d+$/, "") %> -- cgit v1.3