From 3d4eec32441d37460ff6ca60dc7abf31d5b1bba5 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Fri, 14 Aug 2026 01:23:45 +0200 Subject: Bring menu_items#new up to the current markup The page now uses .admin_layout, so its fields get the shared treatment.xi The title fields carry .menu_field for the 44rem cap, which survives a third locale where an id list would not. --- app/views/menu_items/_title_fields.html.erb | 1 + app/views/menu_items/edit.html.erb | 8 +++--- app/views/menu_items/new.html.erb | 44 +++++++++++++++-------------- 3 files changed, 28 insertions(+), 25 deletions(-) (limited to 'app') diff --git a/app/views/menu_items/_title_fields.html.erb b/app/views/menu_items/_title_fields.html.erb index daf449cf..815b8228 100644 --- a/app/views/menu_items/_title_fields.html.erb +++ b/app/views/menu_items/_title_fields.html.erb @@ -6,6 +6,7 @@
<%= text_field_tag "menu_item[titles][#{locale}]", menu_item.translations.find_by(:locale => locale)&.title, + :class => "menu_field", :placeholder => (locale == I18n.default_locale ? nil : t(".falls_back")) %>
diff --git a/app/views/menu_items/edit.html.erb b/app/views/menu_items/edit.html.erb index 92e358d6..c2720b29 100644 --- a/app/views/menu_items/edit.html.erb +++ b/app/views/menu_items/edit.html.erb @@ -1,23 +1,23 @@

<%= t(".title") %>

-
+
<%= form_for @menu_item do |f| %>
<%= t("admin.common.search") %>
- <%= text_field_tag :menu_search_term %> + <%= text_field_tag :menu_search_term, nil, :class => "menu_field" %>
<%= MenuItem.human_attribute_name(:node_id) %>
-
<%= f.text_field :node_id %>
+
<%= f.text_field :node_id, :class => "menu_field" %>
<%= MenuItem.human_attribute_name(:path) %>
-
<%= f.text_field :path %>
+
<%= f.text_field :path, :class => "menu_field" %>
<%= render "title_fields", :menu_item => @menu_item %> diff --git a/app/views/menu_items/new.html.erb b/app/views/menu_items/new.html.erb index 047a5a25..7f103f5c 100644 --- a/app/views/menu_items/new.html.erb +++ b/app/views/menu_items/new.html.erb @@ -1,28 +1,30 @@

<%= t(".title") %>

-<%= form_for @menu_item do |f| %> -
-
<%= t("admin.common.search") %>
-
- <%= text_field_tag :menu_search_term %> - +
+ <%= form_for @menu_item do |f| %> +
+
<%= t("admin.common.search") %>
+
+ <%= text_field_tag :menu_search_term, nil, :class => "menu_field" %> + +
-
-
-
<%= MenuItem.human_attribute_name(:node_id) %>
-
<%= f.text_field :node_id %>
-
+
+
<%= MenuItem.human_attribute_name(:node_id) %>
+
<%= f.text_field :node_id, :class => "menu_field" %>
+
-
-
<%= MenuItem.human_attribute_name(:path) %>
-
<%= f.text_field :path %>
-
+
+
<%= MenuItem.human_attribute_name(:path) %>
+
<%= f.text_field :path, :class => "menu_field" %>
+
- <%= render "title_fields", :menu_item => @menu_item %> + <%= render "title_fields", :menu_item => @menu_item %> -
-
-
<%= f.submit t("admin.common.create") %>
-
-<% end %> +
+
+
<%= f.submit t("admin.common.create") %>
+
+ <% end %> +
-- cgit v1.3