<%= button_to t(".unlock_back"), unlock_node_path(@node), method: :put,
form: { class: 'button_to state_changing' },
disabled: @node.autosave.present? %>
<% if @node.autosave || (@node.draft && @node.head) %>
<%= button_to revert_node_path(@node), method: :put,
form: { data: { confirm: t(".confirm_discard") }, class: 'button_to destructive' } do %>
<%= icon("trash", library: "tabler", "aria-hidden": true) %>
<%= @node.draft && !@node.autosave ? t(".destroy_draft") : t(".discard_autosave") %>
<% end %>
<% if pair = @node.available_layer_pairs.find { |p| p.include?(:autosave) } %>
<%= button_to t(".what_changed"),
diff_node_revisions_path(@node),
method: :get,
params: { start_revision: pair.first, end_revision: pair.last },
form: { class: 'button_to computation' } %>
<% end %>
<% end %>
<%= submit_tag t(".save_draft"), form: dom_id(@node, :edit) %>
<%= submit_tag t(".save_unlock_exit"), name: "unlock_exit", form: dom_id(@node, :edit) %>
<%= link_to t(".preview"), preview_page_path(@page), target: "_blank", rel: "noopener", class: "preview_link" %>
<%= form_for(@node, html: { data: { autosave_url: autosave_node_path(@node), show_url: node_path(@node) } }) do |f| %>
<% if @node.errors.any? %>
<% @node.errors.full_messages.each do |msg| %>- <%= msg %>
<% end %>
<% end %>
<%= fields_for @page do |d| %>
<%= t("admin.columns.title") %>
<%= d.text_field :title %>
<%= t(".abstract") %>
<%= d.text_area :abstract %>
<%= icon("grip-vertical", library: "tabler", "aria-hidden": true) %>
<%= t(".metadata_summary") %>
<%= t(".body") %>
<%= d.text_area :body, :class => 'with_editor' %>
<% end %>
<%= f.submit t(".save_draft") %>
<%= f.submit t(".save_unlock_exit"), name: "unlock_exit"%>
<% end %>