diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-08-09 14:23:41 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-08-09 14:23:41 +0200 |
| commit | ed3905b5409190c1e11c2c49c2163ac967c6d8b9 (patch) | |
| tree | dc67b92c29f9a7fb4692f9104e7448621c1a6e45 /app/views | |
| parent | 44b503f5289705727f0c06392813face855f60f4 (diff) | |
Offer destroying an asset from its own page
Diffstat (limited to 'app/views')
| -rw-r--r-- | app/views/assets/show.html.erb | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/app/views/assets/show.html.erb b/app/views/assets/show.html.erb index 60d63290..c261e032 100644 --- a/app/views/assets/show.html.erb +++ b/app/views/assets/show.html.erb | |||
| @@ -6,16 +6,33 @@ | |||
| 6 | <div class="layout_row_content info_group"> | 6 | <div class="layout_row_content info_group"> |
| 7 | <div class="info_group_items"> | 7 | <div class="info_group_items"> |
| 8 | <div class="info_item"> | 8 | <div class="info_item"> |
| 9 | <%= link_to edit_asset_path(@asset), class: 'action_button' do %> | 9 | <%= link_to edit_asset_path(@asset), class: 'action_button' do %> |
| 10 | <%= icon("edit", library: "tabler", "aria-hidden": true) %> <%= t("admin.common.edit") %> | 10 | <%= icon("edit", library: "tabler", "aria-hidden": true) %> <%= t("admin.common.edit") %> |
| 11 | <% end %> | 11 | <% end %> |
| 12 | </div> | ||
| 13 | <div class="info_item"> | ||
| 14 | <%= link_to admin_log_path(:asset_id => @asset.id), :class => "action_button" do %> | ||
| 15 | <%= icon("history", library: "tabler", "aria-hidden": true) %> <%= t("node_actions.asset_history") %> | ||
| 16 | <% end %> | ||
| 17 | </div> | ||
| 18 | <div class="info_item"> | ||
| 19 | <% if @asset.attached_nodes.any? %> | ||
| 20 | <span class="disabled_action"> | ||
| 21 | <%= icon("trash", library: "tabler", "aria-hidden": true) %> | ||
| 22 | <%= t("admin.common.destroy") %> | ||
| 23 | </span> | ||
| 24 | <span class="field_hint"><%= t(".destroy_blocked") %></span> | ||
| 25 | <% else %> | ||
| 26 | <%= button_to asset_path(@asset), method: :delete, | ||
| 27 | form: { data: { confirm: t("admin.common.confirm_sure") }, | ||
| 28 | class: 'button_to destructive' } do %> | ||
| 29 | <%= icon("trash", library: "tabler", "aria-hidden": true) %> <%= t("admin.common.destroy") %> | ||
| 30 | <% end %> | ||
| 31 | <% end %> | ||
| 12 | </div> | 32 | </div> |
| 13 | <div class="info_item"> | 33 | <div class="info_item"> |
| 14 | <%= link_to t("admin.common.back"), assets_path %> | 34 | <%= link_to t("admin.common.back"), assets_path %> |
| 15 | </div> | 35 | </div> |
| 16 | <%= link_to admin_log_path(:asset_id => @asset.id), :class => "action_button" do %> | ||
| 17 | <%= icon("history", library: "tabler", "aria-hidden": true) %> <%= t("node_actions.asset_history") %> | ||
| 18 | <% end %> | ||
| 19 | </div> | 36 | </div> |
| 20 | </div> | 37 | </div> |
| 21 | 38 | ||
