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 (@node.autosave ? "Continue Editing" : (@node.draft ? "Edit Draft" : "Lock + Edit")), edit_node_path(@node), class: "action_button" %>
<% if !@node.draft && !@node.autosave %>
Nothing pending — this will start a fresh draft.
<% end %>
<% 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.draft || @node.autosave %>
<%= button_to (@node.draft && !@node.autosave ? 'Destroy Draft' : 'Discard changes'),
revert_node_path(@node), method: :put,
form: { data: { confirm: "This cannot be undone. Continue?" }, class: 'button_to destructive' } %>
<% 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? %>
<%= 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 %>
<% end %>
Revisions
<%= pluralize(@node.pages.count, 'revision', 'revisions') %> · <%= link_to 'full history (diff / restore)', node_revisions_path(@node) %>
-
<% @node.pages.order(:revision).each do |page| %>
- <%= link_to "##{page.revision} — #{page.title} (#{page.user.try(:login)}, #{page.updated_at})", node_revision_path(@node, page) %> <% end %>
Tags
<%= @page.tag_list %>
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
<%= sanitize(@page.abstract) %>
Body
<%= sanitize(@page.body) %>
<%# Assets not yet addressed - no confirmed model/association seen for this page's attached assets %>