From 50ca5e40f461290a2db7452b95f80dd3188dba1d Mon Sep 17 00:00:00 2001 From: erdgeist Date: Fri, 24 Jul 2026 18:04:56 +0200 Subject: Rename layout classes to what they actually do --- app/views/nodes/show.html.erb | 138 +++++++++++++++++++++--------------------- 1 file changed, 69 insertions(+), 69 deletions(-) (limited to 'app/views/nodes/show.html.erb') diff --git a/app/views/nodes/show.html.erb b/app/views/nodes/show.html.erb index b3987c6e..e37f5034 100644 --- a/app/views/nodes/show.html.erb +++ b/app/views/nodes/show.html.erb @@ -1,27 +1,27 @@ <% locked_by_other = @node.locked? && @node.lock_owner != current_user %> -
+

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

-
Status
-
-
-
- Head +
Status
+
+
+
+ Head <%= @node.head ? "#{@node.head.title} (rev #{@node.head.revision}, #{@node.head.updated_at})" : "none — never published" %>
-
- Draft +
+ Draft <%= @node.draft ? "#{@node.draft.title} (rev #{@node.draft.revision}, saved #{@node.draft.updated_at})" : "none" %>
-
- Autosave +
+ Autosave <%= @node.autosave ? "#{@node.autosave.title} (unsaved, #{@node.autosave.updated_at})" : "none" %>
<% edit_label = @node.autosave ? "Continue Editing" : (@node.draft ? "Edit Draft" : "Edit") %> -
-
+
+
<% if locked_by_other %> <%= edit_label %> <% else %> @@ -36,7 +36,7 @@
<% @node.available_layer_pairs.each do |pair| %> -
+
<%= button_to "Diff #{pair.first.to_s.capitalize} vs. #{pair.last.to_s.capitalize}", diff_node_revisions_path(@node), method: :get, @@ -47,13 +47,13 @@ <% unless locked_by_other %> <% if @node.draft && !@node.autosave && !@node.in_trash? && !@node.trash_node? %> -
+
<%= button_to 'Publish', publish_node_path(@node), method: :put, form: { data: { confirm: "Publish this draft?" }, class: 'button_to state_changing' } %>
<% end %> <% if @node.autosave || (@node.draft && @node.head) %> -
+
<%= button_to revert_node_path(@node), method: :put, params: { return_to: request.path }, form: { data: { confirm: "This cannot be undone. Continue?" }, class: 'button_to destructive' } do %> @@ -63,7 +63,7 @@
<% end %> <% unless @node.trash_node? || @node.in_trash? || @node.root? %> -
+
<%= button_to trash_node_path(@node), method: :put, form: { data: { confirm: "Move this page and everything beneath it to the Trash? All published content in it will go offline." }, class: 'button_to destructive' } do %> <%= icon("trash", library: "tabler", "aria-hidden": true) %> @@ -80,17 +80,17 @@
<% if @node.in_trash? %> -
Trash
-
-
+
Trash
+
+
<% if (entry = @node.last_trash_entry) && entry.metadata.dig("path", "from") %> -
- Was at +
+ Was at <%= entry.metadata.dig("path", "from") %>
<% end %> -
- Restore to +
+ Restore to <% suggestion = @node.suggested_restore_parent %> <%= form_tag restore_from_trash_node_path(@node), :method => :put, :class => "aligned_action_row" do %>
@@ -105,8 +105,8 @@ Restored pages come back unpublished. Republish each page deliberately.
-
-
+
+
<% doomed_below = @node.descendants.count %> <%= button_to node_path(@node), method: :delete, form: { data: { confirm: doomed_below > 0 ? @@ -121,12 +121,12 @@
<% end %> -
Translations
-
-
+
Translations
+
+
<% @translations.each do |t| %> -
- <%= t[:locale].to_s.upcase %> +
+ <%= t[:locale].to_s.upcase %>
<% if t[:exists] %> <%= link_to t[:title], node_translation_path(@node, t[:locale]) %> — updated <%= t[:updated_at] %> @@ -157,20 +157,20 @@
-
People
-
-
-
- Author +
People
+
+
+
+ Author <%= @page.user.try(:login) %>
-
- Editor +
+ Editor <%= @page.editor.try(:login) %>
<% if @node.locked? %> -
- Locked by +
+ Locked by <%= @node.lock_owner.login %> <%= unlock_link %>
@@ -178,36 +178,36 @@
-
Dates
-
-
-
- Last updated +
Dates
+
+
+
+ Last updated <%= @page.updated_at %>
<% if @page.published_at.present? %> -
- <%= @page.public? ? 'Published at' : 'Will publish at' %> +
+ <%= @page.public? ? 'Published at' : 'Will publish at' %> <%= @page.published_at %>
<% end %>
-
Links
-
-
-
- Public +
Links
+
+
+
+ Public <%= link_to @page.public_link, content_url(@node.unique_path) %>
<% if @node.draft %> -
- Admin Preview +
+ Admin Preview <%= link_to preview_page_path(@node.draft), preview_page_path(@node.draft) %>
-
- Public Preview +
+ Public Preview <% if @node.draft.preview_token.present? %>
<%= link_to shared_preview_path(token: @node.draft.preview_token), shared_preview_url(token: @node.draft.preview_token), target: "_blank", rel: "noopener" %> @@ -221,8 +221,8 @@
-
History
-
+
History
+
<%= pluralize(@node.pages.count, 'published revision', 'published revisions') %> @@ -240,8 +240,8 @@
-
Tags
-
+
Tags
+
<% if @page.tag_list.any? %>
    <% @page.tag_list.sort.each do |tag| %> @@ -253,8 +253,8 @@ <% end %>
-
Attachments
-
+
Attachments
+
<% if @page.assets.any? %> <% headline_asset_id = @page.headline_asset&.id %>
    @@ -278,8 +278,8 @@

-
Events
-
+
Events
+
    <% @node.events.order(:start_time).each do |event| %>
  • @@ -299,8 +299,8 @@ <% matches = matching_node_kinds(@node) %> <% if @node.children.any? || matches.any? %> -
    Children
    -
    +
    Children
    +
    <% if @node.children.any? %>
    <%= pluralize(@node.children.count, 'child', 'children') %> @@ -325,11 +325,11 @@
    <% end %> -
    Abstract (<%= I18n.default_locale.to_s.upcase %>)
    -
    <%= sanitize(@page.abstract) %>
    +
    Abstract (<%= I18n.default_locale.to_s.upcase %>)
    +
    <%= sanitize(@page.abstract) %>
    -
    Body (<%= I18n.default_locale.to_s.upcase %>)
    -
    <%= sanitize(@page.body) %>
    +
    Body (<%= I18n.default_locale.to_s.upcase %>)
    +
    <%= sanitize(@page.body) %>
-- cgit v1.3