From 44b503f5289705727f0c06392813face855f60f4 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Sun, 9 Aug 2026 14:23:17 +0200 Subject: Give the attach picker and the create-page action their own rows --- app/views/assets/show.html.erb | 21 +++++++++++++++------ config/locales/de.yml | 2 ++ config/locales/en.yml | 2 ++ public/stylesheets/admin.css | 19 +++++++++++++++++++ 4 files changed, 38 insertions(+), 6 deletions(-) diff --git a/app/views/assets/show.html.erb b/app/views/assets/show.html.erb index f31d34e1..60d63290 100644 --- a/app/views/assets/show.html.erb +++ b/app/views/assets/show.html.erb @@ -44,19 +44,28 @@ <% else %> <%= t(".not_attached") %> <% end %> - <%= link_to new_node_path(:asset_id => @asset.id), :class => "action_button" do %> - <%= icon("file-plus", library: "tabler", "aria-hidden": true) %> <%= t(".new_page_with_attachment") %> - <% end %> + + +
<%= t("assets.form.attach_to_page") %>
+
<%= form_tag attach_to_node_asset_path(@asset), :class => "asset_attach_form" do %>
<%= text_field_tag :asset_node_search_term, nil, :placeholder => t("assets.form.attach_search_placeholder"), :autocomplete => "off" %>
- <%= hidden_field_tag :node_id, nil %> - <%= submit_tag t(".attach_button") %> - <%= t("assets.form.attach_hint") %> + <%= button_tag :type => "submit", :class => "action_button" do %> + <%= icon("paperclip", library: "tabler", "aria-hidden": true) %> <%= t(".attach_button") %> + <% end %> + <%= t(".attach_hint") %> + <% end %> +
+ +
<%= t(".new_page") %>
+
+ <%= link_to new_node_path(:asset_id => @asset.id), :class => "action_button" do %> + <%= icon("file-plus", library: "tabler", "aria-hidden": true) %> <%= t(".new_page_with_attachment") %> <% end %>
diff --git a/config/locales/de.yml b/config/locales/de.yml index e410e519..bc1660f4 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -703,6 +703,8 @@ de: attached_to: "Angehängt an" pending_only: "nur in ausstehenden Versionen" not_attached: "— an keine Seite angehängt —" + attach_hint: "Hängt dieses Asset an den Entwurf der Seite an; es wird mit dem Entwurf veröffentlicht." + new_page: "neue Seite" new_page_with_attachment: "Neue Seite mit diesem Anhang" attach_button: "Anhängen" public_path: "Öffentlicher Pfad" diff --git a/config/locales/en.yml b/config/locales/en.yml index f8f586b9..58c85f9e 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -672,6 +672,8 @@ en: pending_only: "pending versions only" not_attached: "— not attached to any page —" attach_button: "Attach" + attach_hint: "Attaches this asset to the page's draft, to go live when the draft is published." + new_page: "new page" new_page_with_attachment: "New page with this attachment" public_path: "Public Path" copy_url: "Copy URL" diff --git a/public/stylesheets/admin.css b/public/stylesheets/admin.css index 9d287dc7..7951f667 100644 --- a/public/stylesheets/admin.css +++ b/public/stylesheets/admin.css @@ -2366,6 +2366,25 @@ input#menu_item_title { display: none; } +.asset_attach_form .restore_picker { + max-width: 22rem; +} + +.asset_attach_form label { + display: block; + margin: 0.5rem 0; +} + +.asset_attach_form .action_button { + margin-bottom: 0; +} + +.asset_attach_form .action_button + .field_hint { + display: block; + margin-left: 0; + margin-top: 0.5rem; +} + /* ============================================================ User section ============================================================ */ -- cgit v1.3