<%= 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 %>
<%= title_for_node(@node) %>
<%= button_to '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 (@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 %>
<%= link_to 'Preview', preview_page_path(@page) %>
<%= f.submit 'Save Draft' %>
<%= f.submit 'Save + Unlock + Exit' %>
Metadata (slug, parent, tags, template, author, images)
Title
<%= d.text_field :title %>
Abstract
<%= d.text_area :abstract %>
Body
<%= d.text_area :body, :class => 'with_editor' %>
<% end %>
<%= f.submit 'Save Draft' %>
<%= f.submit 'Save + Unlock + Exit' %>
<% end %>