<% locked_by_other = @node.locked? && @node.lock_owner != current_user %> <% may_change_live = current_user.may_change_live?(@node) %>

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

<%= t(".status") %>
<%= t(".head") %> <%= @node.head ? t(".head_line", :title => @node.head.title, :rev => @node.head.revision, :time => @node.head.updated_at) : t(".never_published") %>
<%= t(".draft") %> <%= @node.draft ? t(".draft_line", :title => @node.draft.title, :rev => @node.draft.revision, :time => @node.draft.updated_at) : t(".none") %>
<%= t(".autosave") %> <%= @node.autosave ? t(".autosave_line", :title => @node.autosave.title, :time => @node.autosave.updated_at) : t(".none") %>
<% edit_label = @node.autosave ? t(".continue_editing") : (@node.draft ? t(".edit_draft") : t(".lock_edit")) %>
<% if locked_by_other %> <%= edit_label %> <% else %> <%= link_to edit_node_path(@node), class: "action_button" do %> <%= icon("edit", library: "tabler", "aria-hidden": true) %> <%= edit_label %> <% end %> <% if !@node.draft && !@node.autosave %> <%= t(".fresh_draft_hint") %> <% end %> <% end %>
<% @node.available_layer_pairs.each do |pair| %>
<%= button_to t(".diff_layers", :from => t(".layer_#{pair.first}"), :to => t(".layer_#{pair.last}")), 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 && !@node.in_trash? && !@node.trash_node? %>
<% if may_change_live %> <% confirm = t(".confirm_publish") %> <% if @node.prospective_unique_name != @node.unique_name %> <% confirm += " " + t(".confirm_publish_moves", :path => @node.prospective_unique_name) %> <% end %> <%= button_to t(".publish"), publish_node_path(@node), method: :put, form: { data: { confirm: confirm }, class: 'button_to state_changing' } %> <% else %> <%= t(".publish") %> <% end %>
<% end %> <% if @node.autosave || (@node.draft && @node.head) %>
<%= button_to revert_node_path(@node), method: :put, params: { return_to: request.path }, form: { data: { confirm: t("admin.common.confirm_irreversible") }, class: 'button_to destructive' } do %> <%= icon("trash", library: "tabler", "aria-hidden": true) %> <%= @node.draft && !@node.autosave ? t(".destroy_draft") : t(".discard_autosave") %> <% end %>
<% end %> <% unless @node.trash_node? || @node.in_trash? || @node.root? %>
<% if may_change_live %> <%= button_to trash_node_path(@node), method: :put, form: { data: { confirm: t(".confirm_trash") }, class: 'button_to destructive' } do %> <%= icon("trash", library: "tabler", "aria-hidden": true) %> <%= t(".move_to_trash") %> <% end %> <% else %> <%= icon("trash", library: "tabler", "aria-hidden": true) %> <%= t(".move_to_trash") %> <% end %>
<% end %> <% end %>
<% if locked_by_other %> <%= t(".locked_hint") %> <% elsif !may_change_live %> <%= t(".restricted_hint") %> <% end %>
<% if @node.in_trash? %>
<%= t(".trash") %>
<% if (entry = @node.last_trash_entry) && entry.metadata.dig("path", "from") %>
<%= t(".was_at") %> <%= entry.metadata.dig("path", "from") %>
<% end %>
<%= t(".restore_to") %> <% suggestion = @node.draft&.parent_node || @node.suggested_restore_parent %> <%= form_tag restore_from_trash_node_path(@node), :method => :put, :class => "aligned_action_row" do %>
<%= text_field_tag :restore_search_term, suggestion && (suggestion.head&.title || suggestion.draft&.title || suggestion.slug), :placeholder => t(".restore_placeholder") %>
<%= hidden_field_tag :parent_id, suggestion&.id %> <%= submit_tag t(".restore_here"), :class => "action_button action_button" %> <% end %> <%= t(".restore_hint") %>
<% doomed_below = @node.descendants.count %> <%= button_to node_path(@node), method: :delete, form: { data: { confirm: t(".confirm_delete", :count => doomed_below) }, class: 'button_to destructive' } do %> <%= icon("trash-x", library: "tabler", "aria-hidden": true) %> <%= t(".delete_permanently") %><%= " " + t(".including_beneath", :count => doomed_below) if doomed_below > 0 %> <% end %>
<% end %>
<%= t(".translations") %>
<% @translations.each do |translation| %>
<%= translation[:locale].to_s.upcase %>
<% if translation[:exists] %> <%= link_to translation[:title], node_translation_path(@node, translation[:locale]) %> <%= t(".updated", :time => translation[:updated_at]) %> <% if translation[:outdated] %> <%= t(".may_be_outdated") %> <% end %> <% else %> <%= t(".not_yet_translated") %> <% end %> <% if locked_by_other %> <%= translation[:exists] ? t(".lock_edit") : t(".create_translation") %> <% else %> <%= link_to edit_node_translation_path(@node, translation[:locale]), class: "action_button" do %> <%= icon(translation[:exists] ? "edit" : "language", library: "tabler", "aria-hidden": true) %> <%= translation[:exists] ? t(".lock_edit") : t(".create_translation") %> <% end %> <% if translation[:exists] %> <%= button_to node_translation_path(@node, translation[:locale]), method: :delete, form: { data: { confirm: t("admin.common.confirm_irreversible") }, class: 'button_to destructive' } do %> <%= icon("trash", library: "tabler", "aria-hidden": true) %> <%= t(".destroy_translation") %> <% end %> <% end %> <% end %>
<% end %>
<%= t(".people") %>
<%= t(".author") %> <%= @page.user.try(:login) %>
<%= t(".editor") %> <%= @page.editor.try(:login) %>
<% if @node.locked? %>
<%= t("admin.columns.locked_by") %> <%= @node.lock_owner.login %> <%= unlock_link %>
<% end %>
<%= t(".dates") %>
<%= t(".last_updated") %> <%= admin_datetime(@page.updated_at) %>
<% if @page.published_at.present? %>
<%= @page.public? ? t(".published_at") : t(".will_publish_at") %> <%= admin_datetime(@page.published_at) %>
<% end %>
<%= t(".links") %>
<% # Public addresses come from the head, previews from the draft, and # those sets differ routinely -- a German head with a freshly # translated English draft has one public address and two preview # ones. Columns are the union; a kind with no address in a locale # leaves that cell empty. available = I18n.available_locales - [:root] head_locales = (@node.head&.translated_locales || []).map(&:to_sym) & available draft_locales = (@node.draft&.translated_locales || []).map(&:to_sym) & available link_locales = (head_locales | draft_locales) link_locales = [I18n.default_locale] if link_locales.empty? link_locales = [I18n.default_locale] + (link_locales - [I18n.default_locale]).sort locale_param = ->(locale) { locale unless locale == I18n.default_locale } %> <% if @node.prospective_unique_name != @node.unique_name %>

<%= icon("arrow-move-right", library: "tabler", "aria-hidden": true) %> <%= t(".pending_address", :path => @node.prospective_unique_name) %>

<% end %>
<%= t(".history") %>
<%= t(".published_revisions", :count => @node.pages.count) %>
    <% @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) %> <%= revision_lifecycle_badges(@page_actions[page.id]) %>
  • <% end %>
<%= t(".tags") %>
<% if @page.tag_list.any? %>
    <% @page.tag_list.sort.each do |tag| %>
  • <%= tag %>
  • <% end %>
<% else %> <%= t(".no_tags") %> <% end %>
<%= t(".attachments") %>
<% if @page.assets.any? %> <% headline_asset_id = @page.headline_asset&.id %>
    <% @page.assets.each do |asset| %>
  • "> <%= link_to image_tag(asset.upload.url(:thumb)), asset_path(asset) %> <% if asset.id == headline_asset_id %> <%= icon("star", library: "tabler", "aria-hidden": true) %> <% end %>
  • <% end %>
<% end %>

<%= link_to new_asset_path(:node_id => @node.id), class: 'action_button' do %> <%= icon("paperclip", library: "tabler", "aria-hidden": true) %> <%= t(".upload_attachment") %> <% end %> <%= t(".attachments_hint") %>

<%= t(".events") %>
    <% @node.events.order(:start_time).each do |event| %>
  • <%= event_schedule_text(event) %> [<%= link_to t(".show_link"), event_path(event, return_to: request.path) %> | <%= link_to t(".edit_link"), edit_event_path(event, return_to: request.path) %>]
  • <% end %>
<% mapping = default_event_tag_mapping(@page) %>

<%= link_to new_event_path(node_id: @node.id, tag_list: mapping&.last, auto_tag_source: mapping&.first, return_to: request.path), class: 'action_button' do %> <%= icon("calendar-plus", library: "tabler", "aria-hidden": true) %> <%= t(".add_event") %> <% end %>

<% matches = matching_node_kinds(@node) %> <% if @node.children.any? || matches.any? %>
<%= t(".children") %>
<% if @node.children.any? %>
<%= t(".children_count", :count => @node.children.count) %>
    <% @node.children.order(:slug).each do |child| %>
  • <%= link_to (child.head&.title || child.draft&.title || child.slug), node_path(child) %>
  • <% end %>
<% end %> <% if matches.any? %> <% 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) %>