Status
Head
<%= @node.head ? "#{@node.head.title} (rev #{@node.head.revision}, #{@node.head.updated_at})" : "none — never published" %>
Draft
<%= @node.draft ? "#{@node.draft.title} (rev #{@node.draft.revision}, saved #{@node.draft.updated_at})" : "none" %>
Autosave
<%= @node.autosave ? "#{@node.autosave.title} (unsaved, #{@node.autosave.updated_at})" : "none" %>
<% if locked_by_other %>
<%= edit_label %>
<% else %>
<%= link_to edit_node_path(@node), class: "action_button" do %>
<%= icon("edit", library: "tabler", "aria-hidden": true) %>
<%= @node.autosave ? "Continue Editing" : (@node.draft ? "Edit Draft" : "Lock + Edit") %>
<% end %>
<% if !@node.draft && !@node.autosave %>
Nothing pending — this will start a fresh draft.
<% end %>
<% end %>
<% @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,
params: { start_revision: pair.first, end_revision: pair.last },
form: { class: 'button_to computation' } %>
<% end %>
<% unless locked_by_other %>
<% if @node.draft && !@node.autosave %>
<%= 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 %>
<%= icon("trash", library: "tabler", "aria-hidden": true) %>
<%= @node.draft && !@node.autosave ? "Destroy Draft" : "Discard Autosave" %>
<% end %>
<% end %>
<% end %>
Translations
<% @translations.each do |t| %>
<%= t[:locale].to_s.upcase %>
<% end %>
<% if t[:exists] %>
<%= link_to t[:title], node_translation_path(@node, t[:locale]) %> — updated <%= t[:updated_at] %>
<% if t[:outdated] %>
may be outdated
<% end %>
<% else %>
Not yet translated.
<% end %>
<% if locked_by_other %>
<%= t[:exists] ? "Lock + Edit" : "Create translation + Lock" %>
<% else %>
<%= link_to edit_node_translation_path(@node, t[:locale]), class: "action_button" do %>
<%= icon(t[:exists] ? "edit" : "language", library: "tabler", "aria-hidden": true) %>
<%= t[:exists] ? "Lock + Edit" : "Create translation + Lock" %>
<% end %>
<% if t[:exists] %>
<%= button_to node_translation_path(@node, t[:locale]), method: :delete,
form: { data: { confirm: "This cannot be undone. Continue?" }, class: 'button_to destructive' } do %>
<%= icon("trash", library: "tabler", "aria-hidden": true) %>
Destroy Translation
<% end %>
<% end %>
<% end %>
People
Author
<%= @page.user.try(:login) %>
Editor
<%= @page.editor.try(:login) %>
<% if @node.locked? %>
Locked by
<%= @node.lock_owner.login %>
<%= unlock_link %>
<% end %>
Dates
Last updated
<%= @page.updated_at %>
<% if @page.published_at.present? %>
<%= @page.public? ? 'Published at' : 'Will publish at' %>
<%= @page.published_at %>
<% end %>
Links
Public
<%= link_to @page.public_link, content_url(@node.unique_path) %>
<% if @node.draft %>
Admin Preview
<%= link_to preview_page_path(@node.draft), preview_page_path(@node.draft) %>
Public Preview
<% if @node.draft.preview_token.present? %>
<% end %>
<%= link_to shared_preview_path(token: @node.draft.preview_token), shared_preview_url(token: @node.draft.preview_token), target: "_blank", rel: "noopener" %>
<%= button_to 'Revoke', revoke_shared_preview_node_path(@node), method: :put, form: { data: { confirm: "Revoke this preview link? Anyone currently using it will immediately lose access." }, class: 'button_to state_changing' } %>
<% else %>
<%= button_to 'Create public preview link', generate_shared_preview_node_path(@node), method: :put, form: { class: 'button_to state_changing' } %>
<% end %>
Revisions
<%= pluralize(@node.pages.count, 'revision', 'revisions') %>
-
<% @node.pages.order(:revision).each do |page| %>
- <%= link_to "##{page.revision} — #{page.title} (#{page.editor.try(:login)}, #{page.updated_at})", node_revision_path(@node, page) %> <% end %>
<%= link_to 'Full history (diff / restore)', node_revisions_path(@node) %>
Tags
<% if @page.tag_list.any? %>
<% if @page.assets.images.any? %>
-
<% @page.tag_list.sort.each do |tag| %>
- <%= tag %> <% end %>
Images
-
<% @page.assets.images.each do |asset| %>
- <%= link_to image_tag(asset.upload.url(:thumb)), asset_path(asset) %> <% end %>
Events
-
<% @node.events.order(:start_time).each do |event| %>
- <%= event_schedule_text(event) %> [<%= link_to 'show', event_path(event, return_to: request.path) %> | <%= link_to 'edit', edit_event_path(event, return_to: request.path) %>] <% end %>
Children
<% if @node.children.any? %>
<% end %>
<% if matches.any? %>
<% end %>
<%= pluralize(@node.children.count, 'child', 'children') %>
-
<% @node.children.order(:slug).each do |child| %>
- <%= link_to (child.head&.title || child.draft&.title || child.slug), node_path(child) %> <% end %>
<% matches.each_with_index do |(kind, config), index| %> <%= " · ".html_safe if index > 0 %> <% link_params = { kind: kind } %> <% link_params[:parent_id] = @node.id if kind == "generic" %> <%= link_to "add '#{resolve_kind_text(config[:label])}' child", new_node_path(link_params) %> <% end %>
<% end %>Abstract (<%= I18n.default_locale.to_s.upcase %>)
<%= sanitize(@page.abstract) %>
Body (<%= I18n.default_locale.to_s.upcase %>)
<%= sanitize(@page.body) %>