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/assets/edit.html.erb | 18 +- app/views/assets/new.html.erb | 16 +- app/views/assets/show.html.erb | 26 ++- app/views/elevations/new.html.erb | 17 +- app/views/events/edit.html.erb | 24 +- app/views/events/new.html.erb | 24 +- app/views/events/show.html.erb | 24 +- app/views/menu_items/_title_fields.html.erb | 16 +- app/views/menu_items/edit.html.erb | 30 ++- app/views/menu_items/new.html.erb | 27 ++- app/views/nodes/edit.html.erb | 339 +++++++++++++++------------- app/views/nodes/new.html.erb | 109 +++++---- app/views/nodes/show.html.erb | 39 +++- app/views/otp_challenges/new.html.erb | 18 +- app/views/otp_enrollments/show.html.erb | 36 +-- app/views/page_translations/edit.html.erb | 59 ++--- app/views/page_translations/show.html.erb | 38 ++-- app/views/revisions/diff.html.erb | 8 +- app/views/revisions/index.html.erb | 2 +- app/views/revisions/show.html.erb | 18 +- app/views/users/edit.html.erb | 106 +++++---- app/views/users/new.html.erb | 56 +++-- app/views/users/show.html.erb | 24 +- public/stylesheets/admin.css | 62 ++--- 24 files changed, 688 insertions(+), 448 deletions(-) diff --git a/app/views/assets/edit.html.erb b/app/views/assets/edit.html.erb index 610ae20a..1e4ae8f1 100644 --- a/app/views/assets/edit.html.erb +++ b/app/views/assets/edit.html.erb @@ -4,15 +4,19 @@ <%= form_for(@asset, html: { multipart: true }) do |f| %> <%= form_error_messages(f) %> -
+
<%= f.label :name %>
<%= f.text_field :name %>
+
- <% if @asset.upload.present? %> + <% if @asset.upload.present? %> +
<%= t(".current_file") %>
<%= @asset.upload.url %> (<%= number_to_human_size(@asset.upload.size) %>)
- <% end %> +
+ <% end %> +
<%= f.label :upload, t(".replace_file") %>
@@ -20,13 +24,19 @@

<%= t("assets.form.drop_hint") %>

+
+
<%= f.label :creator %>
<%= f.text_field :creator %>
+
+
<%= f.label :source_url %>
<%= f.text_field :source_url %>
+
+
<%= f.label :license_key %>
<%= f.select :license_key, @@ -35,7 +45,9 @@ @asset.license_key ) %>
+
+
<%= t("admin.columns.actions") %>
diff --git a/app/views/assets/new.html.erb b/app/views/assets/new.html.erb index d3a66524..1260644f 100644 --- a/app/views/assets/new.html.erb +++ b/app/views/assets/new.html.erb @@ -4,10 +4,12 @@ <%= form_for(@asset, :html => { :multipart => true }) do |f| %> <%= form_error_messages(f) %> -
+
<%= f.label :name %>
<%= f.text_field :name %>
+
+
<%= f.label :upload %>
@@ -15,13 +17,19 @@

<%= t("assets.form.drop_hint") %>

+
+
<%= f.label :creator %>
<%= f.text_field :creator %>
+
+
<%= f.label :source_url %>
<%= f.text_field :source_url %>
+
+
<%= f.label :license_key %>
<%= f.select :license_key, @@ -30,7 +38,9 @@ @asset.license_key ) %>
+
+
<%= t("assets.form.attach_to_page") %>
@@ -41,13 +51,17 @@ <%= hidden_field_tag :node_id, @attach_node&.id %> <%= t("assets.form.attach_hint") %>
+
+
<%= t("assets.form.headline_hint") %>
+
+
<%= t("admin.columns.actions") %>
diff --git a/app/views/assets/show.html.erb b/app/views/assets/show.html.erb index c261e032..5c111c7b 100644 --- a/app/views/assets/show.html.erb +++ b/app/views/assets/show.html.erb @@ -1,7 +1,7 @@

<%= @asset.name %>

-
+
<%= t("admin.columns.actions") %>
@@ -35,12 +35,16 @@
+
- <% if @asset.has_variant?(:medium) %> + <% if @asset.has_variant?(:medium) %> +
<%= t(".thumbnail") %>
<%= image_tag @asset.upload.url(:medium), style: "max-width: 300px; max-height: 300px;" %>
- <% end %> +
+ <% end %> +
<%= t(".attached_to") %>
<% nodes = @asset.attached_nodes %> @@ -62,7 +66,9 @@ <%= t(".not_attached") %> <% end %>
+
+
<%= t("assets.form.attach_to_page") %>
<%= form_tag attach_to_node_asset_path(@asset), :class => "asset_attach_form" do %> @@ -78,14 +84,18 @@ <%= 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 %>
+
+
<%= t(".public_path") %>
<% public_path = @asset.upload.url.sub(/\?\d+$/, "") %> @@ -96,10 +106,14 @@ <%= t(".copy_url") %>
+
+
<%= t(".creator") %>
<%= @asset.creator.presence || "—" %>
+
+
<%= t(".source") %>
<% if @asset.source_url.present? %> @@ -108,7 +122,9 @@ — <% end %>
+
+
<%= t(".license") %>
<% if (license = AssetLicense.find(@asset.license_key)) %> @@ -117,10 +133,14 @@ — <% end %>
+
+
<%= t(".content_type") %>
<%= @asset.upload.content_type %>
+
+
<%= t(".size") %>
<%= "#{@asset.upload.size/1024} KB" %>
diff --git a/app/views/elevations/new.html.erb b/app/views/elevations/new.html.erb index 1091ff36..084fb9e4 100644 --- a/app/views/elevations/new.html.erb +++ b/app/views/elevations/new.html.erb @@ -6,13 +6,18 @@ <%= t(".hint", :minutes => AuthenticatedSystem::ELEVATION_MAX_AGE.in_minutes.to_i) %>

<%= form_tag elevation_path do %> -
<%= t(".code") %>
-
- <%= text_field_tag :code, nil, :autocomplete => "one-time-code", - :inputmode => "numeric", :autofocus => true %> +
+
<%= t(".code") %>
+
+ <%= text_field_tag :code, nil, :autocomplete => "one-time-code", + :inputmode => "numeric", :autofocus => true %> +
+
+ +
+
+
<%= submit_tag t(".elevate") %>
-
-
<%= submit_tag t(".elevate") %>
<% end %> <% else %> <%# An admin without an enrolled factor cannot elevate at all. Say so and diff --git a/app/views/events/edit.html.erb b/app/views/events/edit.html.erb index f3bf5339..7c855760 100644 --- a/app/views/events/edit.html.erb +++ b/app/views/events/edit.html.erb @@ -1,6 +1,6 @@

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

-
+
<%= link_to t("admin.common.back"), safe_return_to(params[:return_to] || events_path) %> <%= button_to event_path(@event), method: :delete, form: { data: { confirm: t("events.confirm_delete") }, class: 'button_to destructive' } do %> @@ -13,7 +13,7 @@ <%= form_error_messages(f) %>
-
+
<%= Event.human_attribute_name(:node) %>
<% if @event.node %> @@ -31,39 +31,59 @@ <% end %> <%= f.hidden_field :node_id %>
+
+
<%= Event.human_attribute_name(:start_time) %>
<%= f.datetime_select :start_time %>
+
+
<%= Event.human_attribute_name(:end_time) %>
<%= f.datetime_select :end_time %>
+
+
<%= t("events.form.recurrence") %>
<%= render "rrule_builder", f: f %>
+
+
<%= Event.human_attribute_name(:title) %>
<%= f.text_field :title %> <%= t("events.form.title_hint") %>
+
+
<%= Event.human_attribute_name(:tags) %>
<%= f.text_field :tag_list %>
+
+
<%= Event.human_attribute_name(:allday) %>
<%= f.check_box :allday %>
+
+
<%= Event.human_attribute_name(:url) %>
<%= f.text_field :url %>
+
+
<%= Event.human_attribute_name(:latitude) %>
<%= f.text_field :latitude %>
+
+
<%= Event.human_attribute_name(:longitude) %>
<%= f.text_field :longitude %>
+
+
<%= f.submit t("admin.common.update") %>
diff --git a/app/views/events/new.html.erb b/app/views/events/new.html.erb index 3eaf7e7d..5cc47b69 100644 --- a/app/views/events/new.html.erb +++ b/app/views/events/new.html.erb @@ -6,7 +6,7 @@ <%= form_error_messages(f) %>
-
+
<%= Event.human_attribute_name(:node) %>
<%= text_field_tag :event_node_search_term %> @@ -14,40 +14,62 @@ <%= f.hidden_field :node_id %> <%= t("events.form.node_hint") %>
+
+
<%= Event.human_attribute_name(:start_time) %>
<%= f.datetime_select :start_time %>
+
+
<%= Event.human_attribute_name(:end_time) %>
<%= f.datetime_select :end_time %>
+
+
<%= t("events.form.recurrence") %>
<%= render "rrule_builder", f: f %>
+
+
<%= Event.human_attribute_name(:title) %>
<%= f.text_field :title %> <%= t("events.form.title_hint") %>
+
+
<%= Event.human_attribute_name(:tag_list) %>
<%= f.text_field :tag_list %>
+
+
<%= Event.human_attribute_name(:allday) %>
<%= f.check_box :allday %>
+
+
<%= Event.human_attribute_name(:url) %>
<%= f.text_field :url %>
+
+
<%= Event.human_attribute_name(:latitude) %>
<%= f.text_field :latitude %>
+
+
<%= Event.human_attribute_name(:longitude) %>
<%= f.text_field :longitude %>
+
+
<%= hidden_field_tag :return_to, params[:return_to] %>
+
+
<%= f.submit t("admin.common.create") %>
diff --git a/app/views/events/show.html.erb b/app/views/events/show.html.erb index d77f770e..2f3d315d 100644 --- a/app/views/events/show.html.erb +++ b/app/views/events/show.html.erb @@ -1,7 +1,7 @@

<%= @event.node ? t(".title_for_node", :path => @event.node.unique_name) : t(".title") %>

-
+
<%= t("admin.columns.actions") %>
@@ -22,33 +22,51 @@
+
+
<%= Event.human_attribute_name(:start_time) %>
<%= admin_datetime(@event.start_time) %>
+
+
<%= Event.human_attribute_name(:end_time) %>
<%= admin_datetime(@event.end_time) %>
+
+
<%= Event.human_attribute_name(:rrule) %>
<%=h @event.rrule %>
+
- <% if (human = @event.humanize_rrule(I18n.locale)) %> + <% if (human = @event.humanize_rrule(I18n.locale)) %> +
<%= t(".recurrence") %>
<%= human %>
- <% end %> +
+ <% end %> +
<%= Event.human_attribute_name(:tag_list) %>
<%=h @event.tag_list %>
+
+
<%= Event.human_attribute_name(:allday) %>
<%= @event.allday ? t("admin.common.yes") : t("admin.common.no") %>
+
+
<%= Event.human_attribute_name(:url) %>
<%=h @event.url %>
+
+
<%= Event.human_attribute_name(:latitude) %>
<%=h @event.latitude %>
+
+
<%= Event.human_attribute_name(:longitude) %>
<%=h @event.longitude %>
diff --git a/app/views/menu_items/_title_fields.html.erb b/app/views/menu_items/_title_fields.html.erb index 81ec4ad6..daf449cf 100644 --- a/app/views/menu_items/_title_fields.html.erb +++ b/app/views/menu_items/_title_fields.html.erb @@ -1,10 +1,12 @@ <% (I18n.available_locales - [:root]).each do |locale| %> -
- <%= MenuItem.human_attribute_name(:title) %> <%= locale.to_s.upcase %> -
-
- <%= text_field_tag "menu_item[titles][#{locale}]", - menu_item.translations.find_by(:locale => locale)&.title, - :placeholder => (locale == I18n.default_locale ? nil : t(".falls_back")) %> +
+
+ <%= MenuItem.human_attribute_name(:title) %> <%= locale.to_s.upcase %> +
+
+ <%= text_field_tag "menu_item[titles][#{locale}]", + menu_item.translations.find_by(:locale => locale)&.title, + :placeholder => (locale == I18n.default_locale ? nil : t(".falls_back")) %> +
<% end %> diff --git a/app/views/menu_items/edit.html.erb b/app/views/menu_items/edit.html.erb index 2bd65575..92e358d6 100644 --- a/app/views/menu_items/edit.html.erb +++ b/app/views/menu_items/edit.html.erb @@ -2,23 +2,29 @@
<%= form_for @menu_item do |f| %> -
-
<%= t("admin.common.search") %>
-
- <%= text_field_tag :menu_search_term %> - +
+
<%= t("admin.common.search") %>
+
+ <%= text_field_tag :menu_search_term %> + +
-
<%= MenuItem.human_attribute_name(:node_id) %>
-
<%= f.text_field :node_id %>
+
+
<%= MenuItem.human_attribute_name(:node_id) %>
+
<%= f.text_field :node_id %>
+
-
<%= MenuItem.human_attribute_name(:path) %>
-
<%= f.text_field :path %>
+
+
<%= MenuItem.human_attribute_name(:path) %>
+
<%= f.text_field :path %>
+
<%= render "title_fields", :menu_item => @menu_item %> -
-
<%= f.submit t("admin.common.update") %>
+
+
+
<%= f.submit t("admin.common.update") %>
+
<% end %> -
diff --git a/app/views/menu_items/new.html.erb b/app/views/menu_items/new.html.erb index 08872ec0..047a5a25 100644 --- a/app/views/menu_items/new.html.erb +++ b/app/views/menu_items/new.html.erb @@ -1,19 +1,28 @@

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

<%= form_for @menu_item do |f| %> -
<%= t("admin.common.search") %>
-
- <%= text_field_tag :menu_search_term %> - +
+
<%= t("admin.common.search") %>
+
+ <%= text_field_tag :menu_search_term %> + +
-
<%= MenuItem.human_attribute_name(:node_id) %>
-
<%= f.text_field :node_id %>
+
+
<%= MenuItem.human_attribute_name(:node_id) %>
+
<%= f.text_field :node_id %>
+
-
<%= MenuItem.human_attribute_name(:path) %>
-
<%= f.text_field :path %>
+
+
<%= MenuItem.human_attribute_name(:path) %>
+
<%= f.text_field :path %>
+
<%= render "title_fields", :menu_item => @menu_item %> -
<%= f.submit t("admin.common.create") %>
+
+
+
<%= f.submit t("admin.common.create") %>
+
<% end %> 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) %>
-
diff --git a/app/views/otp_challenges/new.html.erb b/app/views/otp_challenges/new.html.erb index 677244c7..798fc024 100644 --- a/app/views/otp_challenges/new.html.erb +++ b/app/views/otp_challenges/new.html.erb @@ -1,13 +1,15 @@

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

-
<%= t(".code") %>
-
- <%= form_tag otp_challenge_path, :method => :post, :class => "otp_form" do %> - <%= text_field_tag :code, nil, :autofocus => true, - :autocomplete => "one-time-code", :inputmode => "numeric" %> - <%= submit_tag t(".log_in") %> - <% end %> - <%= t(".hint") %> +
+
<%= t(".code") %>
+
+ <%= form_tag otp_challenge_path, :method => :post, :class => "otp_form" do %> + <%= text_field_tag :code, nil, :autofocus => true, + :autocomplete => "one-time-code", :inputmode => "numeric" %> + <%= submit_tag t(".log_in") %> + <% end %> + <%= t(".hint") %> +
diff --git a/app/views/otp_enrollments/show.html.erb b/app/views/otp_enrollments/show.html.erb index 894885b0..03405d5f 100644 --- a/app/views/otp_enrollments/show.html.erb +++ b/app/views/otp_enrollments/show.html.erb @@ -1,25 +1,29 @@

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

-
<%= t(".scan") %>
-
-
- <%= raw RQRCode::QRCode.new(current_user.pending_otp_provisioning_uri) - .as_svg(:module_size => 4, :viewbox => true, - :color => "000", :fill => "fff") %> +
+
<%= t(".scan") %>
+
+
+ <%= raw RQRCode::QRCode.new(current_user.pending_otp_provisioning_uri) + .as_svg(:module_size => 4, :viewbox => true, + :color => "000", :fill => "fff") %> +
+ <%= t(".manual_hint") %> <%= current_user.otp_pending_secret %>
- <%= t(".manual_hint") %> <%= current_user.otp_pending_secret %>
-
<%= t(".confirm") %>
-
- <%= form_tag otp_enrollment_path, :method => :put, :class => "otp_form" do %> - <%= text_field_tag :code, nil, :autofocus => true, - :autocomplete => "one-time-code", :inputmode => "numeric" %> - <%= button_tag :type => "submit", :class => "action_button" do %> - <%= icon("shield-check", library: "tabler", "aria-hidden": true) %> <%= t(".confirm") %> +
+
<%= t(".confirm") %>
+
+ <%= form_tag otp_enrollment_path, :method => :put, :class => "otp_form" do %> + <%= text_field_tag :code, nil, :autofocus => true, + :autocomplete => "one-time-code", :inputmode => "numeric" %> + <%= button_tag :type => "submit", :class => "action_button" do %> + <%= icon("shield-check", library: "tabler", "aria-hidden": true) %> <%= t(".confirm") %> + <% end %> <% end %> - <% end %> - <%= t(".app_hint", :issuer => OTP_ISSUER) %> + <%= t(".app_hint", :issuer => OTP_ISSUER) %> +
diff --git a/app/views/page_translations/edit.html.erb b/app/views/page_translations/edit.html.erb index 20ec1c9a..3a4c8659 100644 --- a/app/views/page_translations/edit.html.erb +++ b/app/views/page_translations/edit.html.erb @@ -2,7 +2,7 @@ <%= t(".editing_prefix") %> <%= @locale.to_s.upcase %> <%= t(".translation_of") %> <%= title_for_node(@node) %>.
-

<%= link_to t("page_translations.revision_history_link"), node_revisions_path(@node, :translation_locale => @locale) %>

+

<%= link_to t("page_translations.revision_history_link"), node_revisions_path(@node, :translation_locale => @locale) %>

<%= t(".metadata_hint_prefix") %> <%= link_to t(".metadata_hint_link"), edit_node_path(@node) %>. @@ -27,38 +27,45 @@ <% end %> + <%= form_with url: node_translation_path(@node, @locale), method: :patch, local: true, id: "translation_edit_form", data: { autosave_url: autosave_node_translation_path(@node, @locale), show_url: node_path(@node) } do |f| %> -

-
-
<%= Page.human_attribute_name(:title) %>
-
- <%= text_field_tag "page[title]", @translation&.title %> -
+
+
<%= Page.human_attribute_name(:title) %>
+
+ <%= text_field_tag "page[title]", @translation&.title %> +
+
-
<%= Page.human_attribute_name(:abstract) %>
-
- <%= text_area_tag "page[abstract]", @translation&.abstract %> -
+
+
<%= Page.human_attribute_name(:abstract) %>
+
+ <%= text_area_tag "page[abstract]", @translation&.abstract %> +
+
+
+
<%= Page.human_attribute_name(:body) %>
-
- - -
+
+
+ + +
-
-
-
- <%= text_area_tag "page[body]", @translation&.body, :class => 'with_editor' %> +
+
+
+ <%= text_area_tag "page[body]", @translation&.body, :class => 'with_editor' %> +
+
+ -
-
diff --git a/app/views/page_translations/show.html.erb b/app/views/page_translations/show.html.erb index 5f94ac38..b230c35e 100644 --- a/app/views/page_translations/show.html.erb +++ b/app/views/page_translations/show.html.erb @@ -1,29 +1,41 @@

<%= t(".title") %> — <%= title_for_node(@node) %>

-

<%= link_to t("page_translations.revision_history_link"), node_revisions_path(@node, :translation_locale => @locale) %>

+

<%= link_to t("page_translations.revision_history_link"), node_revisions_path(@node, :translation_locale => @locale) %>

<%= @locale.to_s.upcase %>

-
<%= Page.human_attribute_name(:title) %>
-
<%= @translation&.title %>
+
+
<%= Page.human_attribute_name(:title) %>
+
<%= @translation&.title %>
+
-
<%= Page.human_attribute_name(:abstract) %>
-
<%= sanitize(@translation&.abstract.to_s) %>
+
+
<%= Page.human_attribute_name(:abstract) %>
+
<%= sanitize(@translation&.abstract.to_s) %>
+
-
<%= Page.human_attribute_name(:body) %>
-
<%= sanitize(@translation&.body.to_s) %>
+
+
<%= Page.human_attribute_name(:body) %>
+
<%= sanitize(@translation&.body.to_s) %>
+

<%= I18n.default_locale.to_s.upcase %> (<%= t(".default_marker") %>)

-
<%= Page.human_attribute_name(:title) %>
-
<%= @default_translation&.title %>
+
+
<%= Page.human_attribute_name(:title) %>
+
<%= @default_translation&.title %>
+
-
<%= Page.human_attribute_name(:abstract) %>
-
<%= sanitize(@default_translation&.abstract.to_s) %>
+
+
<%= Page.human_attribute_name(:abstract) %>
+
<%= sanitize(@default_translation&.abstract.to_s) %>
+
-
<%= Page.human_attribute_name(:body) %>
-
<%= sanitize(@default_translation&.body.to_s) %>
+
+
<%= Page.human_attribute_name(:body) %>
+
<%= sanitize(@default_translation&.body.to_s) %>
+
diff --git a/app/views/revisions/diff.html.erb b/app/views/revisions/diff.html.erb index 25f5ad04..17146615 100644 --- a/app/views/revisions/diff.html.erb +++ b/app/views/revisions/diff.html.erb @@ -1,6 +1,6 @@

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

-

+

<%= link_to t(".revisions_link"), node_revisions_path(@node) %>

@@ -23,7 +23,7 @@ <%= t(".comparing_html", :start => start_control, :end => end_control, :lang => locale_control, :view => view_control) %>

-

+

<% if earlier %> <%= link_to t(".pair_link", :from => earlier.first, :to => earlier.last), diff_node_revisions_path(@node, start_revision: earlier.first, end_revision: earlier.last, @@ -43,13 +43,13 @@ <% end %> <% unless numeric_comparison %> -

+

<%= link_to t(".compare_numbered"), node_revisions_path(@node) %>

<% end %> <% if @available_layer_pairs.present? %> -
+
<% @available_layer_pairs.each do |pair| %> <% next if [params[:start_revision].to_s, params[:end_revision].to_s].sort == pair.map(&:to_s).sort %> <%= button_to t("nodes.show.diff_layers", :from => t("nodes.show.layer_#{pair.first}"), :to => t("nodes.show.layer_#{pair.last}")), diff --git a/app/views/revisions/index.html.erb b/app/views/revisions/index.html.erb index 09eac565..c913b2a9 100644 --- a/app/views/revisions/index.html.erb +++ b/app/views/revisions/index.html.erb @@ -1,6 +1,6 @@

<%= t(".title", :path => @node.unique_name) %>

-

+

<%= link_to t(".back_to_node"), node_path(@node) %>

diff --git a/app/views/revisions/show.html.erb b/app/views/revisions/show.html.erb index 1456a051..a898b7e6 100644 --- a/app/views/revisions/show.html.erb +++ b/app/views/revisions/show.html.erb @@ -2,7 +2,7 @@

<%= t(".title", :rev => @page.revision) %>: <%= translation&.title %> (<%= @translation_locale.to_s.upcase %>)

-
+
<%= t("admin.columns.actions") %>
@@ -11,28 +11,44 @@
+
+
<%= t("admin.columns.path") %>
<%= @page.public_link %>
+
+
<%= t("admin.columns.author") %>
<%= @page.user.try(:login) %>
+
+
<%= t("admin.columns.editor") %>
<%= @page.editor.try(:login) %>
+
+
<%= t("nodes.show.last_updated") %>
<%= admin_datetime(@page.updated_at) %>
+
+
<%= t("nodes.show.published_at") %>
<%= admin_datetime(@page.published_at) %>
+
+
<%= Page.human_attribute_name(:title) %>
<%= translation&.title %>
+
+
<%= Page.human_attribute_name(:abstract) %>
<%= translation&.abstract %>
+
+
<%= Page.human_attribute_name(:body) %>
<%= raw translation&.body %>
diff --git a/app/views/users/edit.html.erb b/app/views/users/edit.html.erb index 1763394d..8a5900ce 100644 --- a/app/views/users/edit.html.erb +++ b/app/views/users/edit.html.erb @@ -8,67 +8,83 @@ <% end %> <%= form_for @user do |f| %> -
<%= t("users.labels.login") %>
-
<%= f.text_field :login, :autocomplete => "username" %>
+
+
<%= t("users.labels.login") %>
+
<%= f.text_field :login, :autocomplete => "username" %>
+
-
<%= t("users.labels.email") %>
-
<%= f.text_field :email %>
+
+
<%= t("users.labels.email") %>
+
<%= f.text_field :email %>
+
-
<%= t("users.labels.password") %>
-
<%= f.password_field :password, :autocomplete => "new-password" %>
+
+
<%= t("users.labels.password") %>
+
<%= f.password_field :password, :autocomplete => "new-password" %>
+
-
<%= t("users.labels.confirm") %>
-
<%= f.password_field :password_confirmation, :autocomplete => "new-password" %>
+
+
<%= t("users.labels.confirm") %>
+
<%= f.password_field :password_confirmation, :autocomplete => "new-password" %>
+
<% if current_user.is_admin? %> -
<%= t("users.labels.roles") %>
-
- <% User::ROLES.each do |role| %> - - <% end %> - <%= hidden_field_tag "user[roles][]", "" %> +
+
<%= t("users.labels.roles") %>
+
+ <% User::ROLES.each do |role| %> + + <% end %> + <%= hidden_field_tag "user[roles][]", "" %> +
<% end %> -
-
<%= submit_tag t(".update") %>
+
+
+
<%= submit_tag t(".update") %>
+
<% end %> <% if @user == current_user %> -
<%= t(".second_factor") %>
-
- <% if current_user.otp_enrolled? %> -

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

- <%= form_tag otp_enrollment_path, :method => :delete, :class => "otp_form" do %> - <%= password_field_tag :current_password, nil, :placeholder => t(".current_password"), :autocomplete => "current-password" %> - <%= text_field_tag :code, nil, :placeholder => t(".current_code"), - :autocomplete => "one-time-code", :inputmode => "numeric" %> - <%= button_tag :type => "submit", :class => "action_button" do %> - <%= icon("shield-off", library: "tabler", "aria-hidden": true) %> <%= t(".disable_second_factor") %> +
+
<%= t(".second_factor") %>
+
+ <% if current_user.otp_enrolled? %> +

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

+ <%= form_tag otp_enrollment_path, :method => :delete, :class => "otp_form" do %> + <%= password_field_tag :current_password, nil, :placeholder => t(".current_password"), :autocomplete => "current-password" %> + <%= text_field_tag :code, nil, :placeholder => t(".current_code"), + :autocomplete => "one-time-code", :inputmode => "numeric" %> + <%= button_tag :type => "submit", :class => "action_button" do %> + <%= icon("shield-off", library: "tabler", "aria-hidden": true) %> <%= t(".disable_second_factor") %> + <% end %> <% end %> - <% end %> - <% else %> -

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

- <%= form_tag otp_enrollment_path, :method => :post, :class => "otp_form" do %> - <%= password_field_tag :current_password, nil, :placeholder => t(".current_password"), :autocomplete => "current-password"%> - <%= button_tag :type => "submit", :class => "action_button" do %> - <%= icon("shield-lock", library: "tabler", "aria-hidden": true) %> <%= t(".enable_second_factor") %> + <% else %> +

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

+ <%= form_tag otp_enrollment_path, :method => :post, :class => "otp_form" do %> + <%= password_field_tag :current_password, nil, :placeholder => t(".current_password"), :autocomplete => "current-password"%> + <%= button_tag :type => "submit", :class => "action_button" do %> + <%= icon("shield-lock", library: "tabler", "aria-hidden": true) %> <%= t(".enable_second_factor") %> + <% end %> <% end %> <% end %> - <% end %> +
<% elsif current_user.is_admin? && @user.otp_enrolled? %> -
<%= t(".second_factor") %>
-
- <%= t(".enabled") %> - <%= button_to t(".reset_second_factor"), reset_otp_user_path(@user), :method => :put, - :form_class => "button_to destructive", - :form => { :data => { :confirm => t(".reset_confirm", :login => @user.login) } } %> +
+
<%= t(".second_factor") %>
+
+ <%= t(".enabled") %> + <%= button_to t(".reset_second_factor"), reset_otp_user_path(@user), :method => :put, + :form_class => "button_to destructive", + :form => { :data => { :confirm => t(".reset_confirm", :login => @user.login) } } %> +
<% end %>
diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb index 8d99fd92..13a238b5 100644 --- a/app/views/users/new.html.erb +++ b/app/views/users/new.html.erb @@ -8,34 +8,44 @@
<%= form_for @user do |f| %> -
-
<%= t("users.labels.login") %>
-
<%= f.text_field :login %>
+
+
<%= t("users.labels.login") %>
+
<%= f.text_field :login %>
+
-
<%= t("users.labels.email") %>
-
<%= f.text_field :email %>
+
+
<%= t("users.labels.email") %>
+
<%= f.text_field :email %>
+
-
<%= t("users.labels.password") %>
-
<%= f.password_field :password %>
+
+
<%= t("users.labels.password") %>
+
<%= f.password_field :password %>
+
-
<%= t("users.labels.confirm") %>
-
<%= f.password_field :password_confirmation %>
+
+
<%= t("users.labels.confirm") %>
+
<%= f.password_field :password_confirmation %>
+
-
<%= t("users.labels.roles") %>
-
- <% User::ROLES.each do |role| %> - - <% end %> - <%= hidden_field_tag "user[roles][]", "" %> +
+
<%= t("users.labels.roles") %>
+
+ <% User::ROLES.each do |role| %> + + <% end %> + <%= hidden_field_tag "user[roles][]", "" %> +
-
-
<%= f.submit t("admin.common.create") %>
+
+
+
<%= f.submit t("admin.common.create") %>
+
<% end %> -
diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 2685a15b..9879e171 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -1,7 +1,7 @@

<%= @user.login %>

-
+
<%= t("admin.columns.actions") %>
@@ -12,25 +12,33 @@
+
+
<%= t("users.labels.login") %>
<%= @user.login %>
+
+
<%= t("users.labels.email") %>
<%= @user.email %>
+
+
<%= t("users.labels.roles") %>
<%= @user.roles.any? ? @user.role_labels.join(", ") : t("users.no_roles") %>
-
<%= t("users.labels.last_login") %>
-
- <% if @user.last_login_at %> - <%= admin_date(@user.last_login_at) %> - <% else %> - <%= t("users.never_signed_in") %> - <% end %> +
+
<%= t("users.labels.last_login") %>
+
+ <% if @user.last_login_at %> + <%= admin_date(@user.last_login_at) %> + <% else %> + <%= t("users.never_signed_in") %> + <% end %> +
diff --git a/public/stylesheets/admin.css b/public/stylesheets/admin.css index 7e0be004..a36ece5b 100644 --- a/public/stylesheets/admin.css +++ b/public/stylesheets/admin.css @@ -143,16 +143,6 @@ input[type=radio] { #wrapper { margin: 0 125px; } - - .standalone_action_bar { - margin-left: -125px; - } -} - -#metadata, -#content, -#main_fields { - margin-left: 5px; } #metadata_details summary { @@ -230,7 +220,6 @@ input[type=radio] { border-left: 3px solid var(--text-muted); background-color: var(--surface-tint); margin-bottom: 20px; - margin-left: 5px; } #flash span { @@ -857,7 +846,7 @@ form.button_to svg { .events_table .title_with_flags { grid-area: title; } .assets_table .asset_thumb_link { grid-area: thumb; } .assets_table .asset_type { grid-area: type; align-self: end; } - .events_table .when_body { grid-area: when; margin-top: 0.4rem; padding-left: 2rem; } + .events_table .when_body { grid-area: when; margin-top: 0.4rem; padding-left: 2rem; } .assets_table .asset_name { grid-area: name; margin-top: 0.4rem; } .assets_table .asset_file { grid-area: file; } @@ -1009,31 +998,33 @@ form.button_to svg { Node display (nodes#show / nodes#new) ============================================================ */ -div.layout_row_label { +.layout_row { + margin-bottom: 1rem; +} + +.layout_row_label { min-height: 2rem; text-transform: lowercase; - vertical-align: top; } -div.layout_row_content { +.layout_row_content { min-height: 2rem; - margin-bottom: 1rem; } @media(min-width:1016px) { - div.layout_row_label { - float: left; - width: 110px; - text-align: right; + .layout_row { + display: grid; + grid-template-columns: 115px 1fr; + column-gap: 10px; + margin-left: -125px; } - div.layout_row_content { - margin-left: 120px; - display: block; + #edit_grid .layout_row { + margin-left: 0; } - .body_toolbar_row { - margin-left: 120px; + .layout_row_label { + text-align: right; } } @@ -1239,7 +1230,7 @@ div.layout_row_content { } .link_matrix_locale { - font-size: var(--text-xs); + font-size: var(--text-sm); font-variant: all-small-caps; letter-spacing: 0.06em; color: var(--text); @@ -1460,17 +1451,13 @@ div.layout_row_content { align-items: start; margin-left: -125px; } - #main_fields { grid-area: main; } - #metadata_details { grid-area: meta; } - #admin_layout #content { grid-area: body; } + #main_fields { grid-area: main; } + #metadata_details { grid-area: meta; } + #edit_grid #body_field { grid-area: body; } /* Details is force-opened by JS on desktop; hide the summary only once open, so a JS failure still leaves a working toggle. */ #metadata_details[open] > summary { display: none; } - - #new_node { - margin-left: -118px; - } } input[type=text]#tag_list, @@ -1480,8 +1467,7 @@ input#move_to_search_term { } div#admin_layout { - margin-top: 0px; - margin-left: 10px; + margin-top: 0; } #admin_layout a.action_button, @@ -1545,12 +1531,6 @@ input[type=text]#page_title { height: 60vh; } -#admin_layout #content, -#admin_layout #metadata, -#admin_layout #main_fields { - padding-right: 5px; -} - input#tag_list, input#page_slug, input#move_to_search_term { -- cgit v1.3