From 862edbf4d5fdb9a88f84bfa1d51ab8cc83896094 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Thu, 13 Aug 2026 01:11:29 +0200 Subject: Give every admin page one horizontal gutter by many views inside. The inner ones are gone nodes#edit's becomes #body_field, which is what #edit_grid places in its full-width row. Rows now reach into the label band themselves rather than depending on a page wrapper to do it. The label column plus its gap equals the escape, so a row's content starts at the gutter on every page; #edit_grid's rows are exempt because the grid already steps back. share one left edge. #new_node's -118px was compensating for that 10px and left the page 7px out once it went. standalone_action_bar was overridden everywhere it appeared. page_translations#edit no longer uses #edit_grid: it has no metadata column, so the two-column template pushed its abstract into the empty half. nodes#edit's lower action bar was inside #edit_grid, so it was a grid item inheriting the escape and sat 125px left of the form above it. --- app/views/nodes/edit.html.erb | 339 ++++++++++++++++++++++-------------------- 1 file changed, 181 insertions(+), 158 deletions(-) (limited to 'app/views/nodes/edit.html.erb') diff --git a/app/views/nodes/edit.html.erb b/app/views/nodes/edit.html.erb index 6b5a1234..d19fdd95 100644 --- a/app/views/nodes/edit.html.erb +++ b/app/views/nodes/edit.html.erb @@ -1,174 +1,197 @@

<%= title_for_node(@node) %>

-
- <%= button_to t(".unlock_back"), unlock_node_path(@node), method: :put, - form: { class: 'button_to state_changing' }, - disabled: @node.autosave.present? %> - - <% if @node.autosave || (@node.draft && @node.head) %> - <%= button_to revert_node_path(@node), method: :put, - form: { data: { confirm: t(".confirm_discard") }, class: 'button_to destructive' } do %> - <%= icon("trash", library: "tabler", "aria-hidden": true) %> - <%= @node.draft && !@node.autosave ? t(".destroy_draft") : t(".discard_autosave") %> - <% end %> - <% if pair = @node.available_layer_pairs.find { |p| p.include?(:autosave) } %> - <%= button_to t(".what_changed"), - diff_node_revisions_path(@node), - method: :get, - params: { start_revision: pair.first, end_revision: pair.last }, - form: { class: 'button_to computation' } %> +
+
+ <%= button_to t(".unlock_back"), unlock_node_path(@node), method: :put, + form: { class: 'button_to state_changing' }, + disabled: @node.autosave.present? %> + + <% if @node.autosave || (@node.draft && @node.head) %> + <%= button_to revert_node_path(@node), method: :put, + form: { data: { confirm: t(".confirm_discard") }, class: 'button_to destructive' } do %> + <%= icon("trash", library: "tabler", "aria-hidden": true) %> + <%= @node.draft && !@node.autosave ? t(".destroy_draft") : t(".discard_autosave") %> + <% end %> + <% if pair = @node.available_layer_pairs.find { |p| p.include?(:autosave) } %> + <%= button_to t(".what_changed"), + diff_node_revisions_path(@node), + method: :get, + params: { start_revision: pair.first, end_revision: pair.last }, + form: { class: 'button_to computation' } %> + <% end %> <% end %> - <% end %> - <%= submit_tag t(".save_draft"), form: dom_id(@node, :edit) %> - <%= submit_tag t(".save_unlock_exit"), name: "unlock_exit", form: dom_id(@node, :edit) %> - <%= link_to t(".preview"), preview_page_path(@page), target: "_blank", rel: "noopener", class: "preview_link" %> -
+ <%= submit_tag t(".save_draft"), form: dom_id(@node, :edit) %> + <%= submit_tag t(".save_unlock_exit"), name: "unlock_exit", form: dom_id(@node, :edit) %> + <%= link_to t(".preview"), preview_page_path(@page), target: "_blank", rel: "noopener", class: "preview_link" %> +
-
<%= form_for(@node, html: { data: { autosave_url: autosave_node_path(@node), show_url: node_path(@node) } }) do |f| %> - <% if @node.errors.any? %> -
-
    <% @node.errors.full_messages.each do |msg| %>
  • <%= msg %>
  • <% end %>
-
- <% end %> - - <%= fields_for @page do |d| %> -
- -
-
<%= t("admin.columns.title") %>
-
<%= d.text_field :title %>
- -
<%= t(".abstract") %>
-
<%= d.text_area :abstract %>
- -
<%= t(".attachments") %>
-
- + <% if @node.errors.any? %> +
+
    <% @node.errors.full_messages.each do |msg| %>
  • <%= msg %>
  • <% end %>
+ <% end %> - -
- -
- <%= t(".metadata_summary") %> -
-
<%= t(".slug") %>
-
- <%= d.text_field( - :slug, :value => @page.slug || @node.slug - ) - %> -
- -
<%= t(".parent") %>
-
- <%= text_field_tag :move_to_search_term, (Node.find_by(:id => @page.parent_node_id) || @node.parent)&.title %> -

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

-
- <%= d.hidden_field( - :parent_node_id, - :value => @page.parent_node_id || @node.parent_id - ) - %> -
- -
<%= t(".external_url") %>
-
- <%= d.text_field :external_url %> -
- -
<%= t(".tags") %>
-
- <%= text_field_tag :tag_list, @page.tag_list.join(', ') %> - <%= t(".tags_hint") %> -
- -
<%= t(".publish_at") %>
-
<%= d.datetime_select :published_at, :value => @page.published_at %>
- -
<%= t(".template") %>
-
- <%= d.select :template_name, custom_page_templates, {:prompt => 'Select Template'} %> - <%= t(".template_hint") %> + <%= fields_for @page do |d| %> +
+ +
+
+
<%= t("admin.columns.title") %>
+
<%= d.text_field :title %>
+
+ +
+
<%= t(".abstract") %>
+
<%= d.text_area :abstract %>
+
+ +
+
<%= t(".attachments") %>
+
+ +
+
+ +
-
<%= t(".author") %>
-
- <%= d.select :user_id, user_list, - :selected => @page.user_id || @node.draft&.user_id || @node.head&.user_id %> +
+ <%= t(".metadata_summary") %> +
+
+
<%= t(".slug") %>
+
+ <%= d.text_field( + :slug, :value => @page.slug || @node.slug + ) + %> +
+
+ +
+
<%= t(".parent") %>
+
+ <%= text_field_tag :move_to_search_term, (Node.find_by(:id => @page.parent_node_id) || @node.parent)&.title %> +

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

+
+ <%= d.hidden_field( + :parent_node_id, + :value => @page.parent_node_id || @node.parent_id + ) + %> +
+
+ +
+
<%= t(".external_url") %>
+
+ <%= d.text_field :external_url %> +
+
+ +
+
<%= t(".tags") %>
+
+ <%= text_field_tag :tag_list, @page.tag_list.join(', ') %> + <%= t(".tags_hint") %> +
+
+ +
+
<%= t(".publish_at") %>
+
<%= d.datetime_select :published_at, :value => @page.published_at %>
+
+ +
+
<%= t(".template") %>
+
+ <%= d.select :template_name, custom_page_templates, {:prompt => 'Select Template'} %> + <%= t(".template_hint") %> +
+
+ +
+
<%= t(".author") %>
+
+ <%= d.select :user_id, user_list, + :selected => @page.user_id || @node.draft&.user_id || @node.head&.user_id %> +
+
+
+
+ +
+
+
<%= t(".body") %>
+
+
+ + +
+ +
+
+ <%= d.text_area :body, :class => 'with_editor' %> +
+ +
+
+
- -
-
- -
-
<%= t(".body") %>
-
- -
+ <% end %> -
-
-
<%= d.text_area :body, :class => 'with_editor' %>
-
- -
+
+ <%= f.submit t(".save_draft") %> + <%= f.submit t(".save_unlock_exit"), name: "unlock_exit"%>
-
- <% end %> - -
- <%= f.submit t(".save_draft") %> - <%= f.submit t(".save_unlock_exit"), name: "unlock_exit"%> -
<% end %>
-- cgit v1.3