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 ++++++++++++++++++++++-------------------- app/views/nodes/new.html.erb | 109 ++++++++------ app/views/nodes/show.html.erb | 39 ++++- 3 files changed, 272 insertions(+), 215 deletions(-) (limited to 'app/views/nodes') 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 %>
diff --git a/app/views/nodes/new.html.erb b/app/views/nodes/new.html.erb index 883909a6..dd7a6051 100644 --- a/app/views/nodes/new.html.erb +++ b/app/views/nodes/new.html.erb @@ -9,69 +9,80 @@ <%= form_tag nodes_path do %>
-
<%= t(".type") %>
-
- <% CccConventions::NODE_KINDS.each do |kind, config| %> - <% prefix = resolve_kind_text(config[:path_prefix]) %> -

- <%= radio_button_tag :kind, kind, kind == @selected_kind, - data: { path_prefix: prefix } %> - <%= resolve_kind_text(config[:label]) %> - <% if config[:hint] %> - <%= resolve_kind_text(config[:hint]) %> - <% end %> - <% unless current_user.may_change_live_at?(prefix) %> - <%= t(".restricted_kind") %> - <% end %> -

- <% end %> +
+
<%= t(".type") %>
+
+ <% CccConventions::NODE_KINDS.each do |kind, config| %> + <% prefix = resolve_kind_text(config[:path_prefix]) %> +

+ <%= radio_button_tag :kind, kind, kind == @selected_kind, + data: { path_prefix: prefix } %> + <%= resolve_kind_text(config[:label]) %> + <% if config[:hint] %> + <%= resolve_kind_text(config[:hint]) %> + <% end %> + <% unless current_user.may_change_live_at?(prefix) %> + <%= t(".restricted_kind") %> + <% end %> +

+ <% end %> +
-
<%= t("admin.columns.title") %>
-
- <%= text_field_tag :title, nil, required: true %> - <%= t(".slug_hint") %> +
+
<%= t("admin.columns.title") %>
+
+ <%= text_field_tag :title, nil, required: true %> + <%= t(".slug_hint") %> +
"> -
<%= t(".parent") %>
-
- <%= text_field_tag :parent_search_term, @parent&.title %> - <%= hidden_field_tag :parent_id, @parent&.id, data: { unique_name: @parent&.computed_unique_name } %> -
+
+
<%= t(".parent") %>
+
+ <%= text_field_tag :parent_search_term, @parent&.title %> + <%= hidden_field_tag :parent_id, @parent&.id, data: { unique_name: @parent&.computed_unique_name } %> +
+
-
<%= t(".resulting_path") %>
-
- - +
+
<%= t(".resulting_path") %>
+
+ + - <%= t(".path_hint") %> + <%= t(".path_hint") %> +
<% if @attach_asset %> -
<%= t(".attachment") %>
-
-
    -
  • - <% if @attach_asset.has_variant?(:thumb) %> - <%= image_tag @attach_asset.upload.url(:thumb) %> - <% end %> - <%= link_to @attach_asset.name, asset_path(@attach_asset), - :target => "_blank", :rel => "noopener" %> -
  • -
- <%= t(".attach_hint") %> - - <%= hidden_field_tag :asset_id, @attach_asset.id %> +
+
<%= t(".attachment") %>
+
+
    +
  • + <% if @attach_asset.has_variant?(:thumb) %> + <%= image_tag @attach_asset.upload.url(:thumb) %> + <% end %> + <%= link_to @attach_asset.name, asset_path(@attach_asset), + :target => "_blank", :rel => "noopener" %> +
  • +
+ <%= t(".attach_hint") %> + + <%= hidden_field_tag :asset_id, @attach_asset.id %> +
<% end %> -
-
<%= submit_tag t("admin.common.create") %>
- +
+
+
<%= submit_tag t("admin.common.create") %>
+
<% end %> diff --git a/app/views/nodes/show.html.erb b/app/views/nodes/show.html.erb index a826be37..c9558ed0 100644 --- a/app/views/nodes/show.html.erb +++ b/app/views/nodes/show.html.erb @@ -2,7 +2,8 @@ <% may_change_live = current_user.may_change_live?(@node) %>

<%= title_for_node(@node) %> (<%= I18n.default_locale.to_s.upcase %>)

-
+ +
<%= t(".status") %>
@@ -97,8 +98,10 @@ <%= t(".restricted_hint") %> <% end %>
+
- <% if @node.in_trash? %> + <% if @node.in_trash? %> +
<%= t(".trash") %>
@@ -136,8 +139,10 @@
- <% end %> +
+ <% end %> +
<%= t(".translations") %>
@@ -173,7 +178,9 @@ <% end %>
+
+
<%= t(".people") %>
@@ -194,7 +201,9 @@ <% end %>
+
+
<%= t(".dates") %>
@@ -210,7 +219,9 @@ <% end %>
+
+
<%= t(".links") %>
<% @@ -325,7 +336,9 @@ <% end %>
+
+
<%= t(".history") %>
@@ -343,8 +356,9 @@
+
- +
<%= t(".tags") %>
<% if @page.tag_list.any? %> @@ -357,7 +371,9 @@ <%= t(".no_tags") %> <% end %>
+
+
<%= t(".attachments") %>
<% if @page.assets.any? %> @@ -382,7 +398,9 @@ <%= t(".attachments_hint") %>

+
+
<%= t(".events") %>
    @@ -401,9 +419,11 @@ <% end %>

+
- <% matches = matching_node_kinds(@node) %> - <% if @node.children.any? || matches.any? %> + <% matches = matching_node_kinds(@node) %> + <% if @node.children.any? || matches.any? %> +
<%= t(".children") %>
<% if @node.children.any? %> @@ -428,13 +448,16 @@

<% end %>
- <% end %> +
+ <% end %> +
<%= t(".abstract_locale", :lang => I18n.default_locale.to_s.upcase) %>
<%= sanitize(@page.abstract) %>
+
+
<%= t(".body_locale", :lang => I18n.default_locale.to_s.upcase) %>
<%= sanitize(@page.body) %>
-
-- cgit v1.3