summaryrefslogtreecommitdiff
path: root/app/views/assets/show.html.erb
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2026-07-22 20:44:34 +0200
committererdgeist <erdgeist@erdgeist.org>2026-07-22 20:44:34 +0200
commit8b6d3c76451d4ece5fd829d0e2d96a00aa19122d (patch)
tree9195c97479e42b822931bee9bad037dac8600af0 /app/views/assets/show.html.erb
parentb78a91f158f90343d49a252fc332680108eba18d (diff)
Add attached nodes subsection in assets#show and thumbnail in nodes#create
Diffstat (limited to 'app/views/assets/show.html.erb')
-rw-r--r--app/views/assets/show.html.erb25
1 files changed, 25 insertions, 0 deletions
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 @@
21 <div class="node_content"><%= image_tag @asset.upload.url(:medium), style: "max-width: 300px; max-height: 300px;" %></div> 21 <div class="node_content"><%= image_tag @asset.upload.url(:medium), style: "max-width: 300px; max-height: 300px;" %></div>
22 <% end %> 22 <% end %>
23 23
24 <div class="node_description">Attached to</div>
25 <div class="node_content">
26 <% nodes = @asset.attached_nodes %>
27 <% if nodes.any? %>
28 <ul class="search_results_list">
29 <% nodes.each do |node| %>
30 <li>
31 <%= link_to node.title, node_path(node) %>
32 <% if node.editable_page&.headline_asset == @asset %>
33 <%= icon("star", library: "tabler", "aria-hidden": true) %>
34 <% end %>
35 <% unless node.head && node.head.related_assets.exists?(:asset_id => @asset.id) %>
36 <span class="field_hint">pending versions only</span>
37 <% end %>
38 </li>
39 <% end %>
40 </ul>
41 <% else %>
42 — not attached to any page —
43 <% end %>
44 <%= link_to new_node_path(:asset_id => @asset.id), :class => "action_button" do %>
45 <%= icon("file-plus", library: "tabler", "aria-hidden": true) %> New page with this attachment
46 <% end %>
47 </div>
48
24 <div class="node_description">Public Path</div> 49 <div class="node_description">Public Path</div>
25 <div class="node_content"> 50 <div class="node_content">
26 <% public_path = @asset.upload.url.sub(/\?\d+$/, "") %> 51 <% public_path = @asset.upload.url.sub(/\?\d+$/, "") %>