<%= 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 %>