diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-07-19 22:19:22 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-07-19 22:19:22 +0200 |
| commit | 08d02a8591ee8047cb708646092cd4bdb7492c33 (patch) | |
| tree | 6b98f8e2d8f98f728394215da57bc9a08de56818 /app | |
| parent | 318c0ec9793beba1a6ac0e18168c774fce15dd37 (diff) | |
Add copy-url button to assets; unified the mechanism across views
Diffstat (limited to 'app')
| -rw-r--r-- | app/views/assets/show.html.erb | 10 | ||||
| -rw-r--r-- | app/views/nodes/new.html.erb | 5 |
2 files changed, 13 insertions, 2 deletions
diff --git a/app/views/assets/show.html.erb b/app/views/assets/show.html.erb index 5717dd9..ff00883 100644 --- a/app/views/assets/show.html.erb +++ b/app/views/assets/show.html.erb | |||
| @@ -20,7 +20,15 @@ | |||
| 20 | <div class="node_content"><%= image_tag @asset.upload.url(:medium), style: "max-width: 300px; max-height: 300px;" %></div> | 20 | <div class="node_content"><%= image_tag @asset.upload.url(:medium), style: "max-width: 300px; max-height: 300px;" %></div> |
| 21 | 21 | ||
| 22 | <div class="node_description">Public Path</div> | 22 | <div class="node_description">Public Path</div> |
| 23 | <div class="node_content"><%= @asset.upload.url.sub(/\?\d+$/, "") %></div> | 23 | <div class="node_content"> |
| 24 | <% public_path = @asset.upload.url.sub(/\?\d+$/, "") %> | ||
| 25 | <%= link_to public_path, public_path, target: "_blank", rel: "noopener" %> | ||
| 26 | <button type="button" class="action_button copy_button" | ||
| 27 | data-copy-url="<%= request.base_url + public_path %>"> | ||
| 28 | <%= icon("copy", library: "tabler", "aria-hidden": true) %> | ||
| 29 | <span class="copy_button_label">Copy URL</span> | ||
| 30 | </button> | ||
| 31 | </div> | ||
| 24 | 32 | ||
| 25 | <div class="node_description">Content Type</div> | 33 | <div class="node_description">Content Type</div> |
| 26 | <div class="node_content"><%= @asset.upload.content_type %></div> | 34 | <div class="node_content"><%= @asset.upload.content_type %></div> |
diff --git a/app/views/nodes/new.html.erb b/app/views/nodes/new.html.erb index 890d46e..805fbc9 100644 --- a/app/views/nodes/new.html.erb +++ b/app/views/nodes/new.html.erb | |||
| @@ -41,7 +41,10 @@ | |||
| 41 | <div class="node_description">Resulting path</div> | 41 | <div class="node_description">Resulting path</div> |
| 42 | <div class="node_content"> | 42 | <div class="node_content"> |
| 43 | <span id="resulting_path">—</span> | 43 | <span id="resulting_path">—</span> |
| 44 | <button type="button" id="copy_resulting_path" class="unselected">copy</button> | 44 | <button type="button" id="copy_resulting_path" class="unselected copy_button" data-copy-target="#resulting_path"> |
| 45 | <span class="copy_button_label">copy</span> | ||
| 46 | </button> | ||
| 47 | |||
| 45 | <span class="field_hint">This preview updates as you type. The final path can still be changed afterward by editing the title (for the last segment) or moving the node to a different parent (for everything before it).</span> | 48 | <span class="field_hint">This preview updates as you type. The final path can still be changed afterward by editing the title (for the last segment) or moving the node to a different parent (for everything before it).</span> |
| 46 | </div> | 49 | </div> |
| 47 | 50 | ||
