<%= form_for @post, as: 'post', remote: true, html: {as: 'Posts.Title', class: %w(post title settings autosave)} do |f| %> <%= hidden_field_tag :context, :title %> <%= f.text_field :title, class: %w(title), autocomplete: :off %> <% end %>
<%= content_tag :div, class: %w(publish state), href: admin_post_path(@post.id), as: 'Post.Sticky' do %> <% if @post.published? %> <%= form_for @post, method: :put, html: { class: %w(hide button destroy) } do |f| %> <%= f.button 'Retract', value: 'unpublish'%> <% end %> <% else %> <%= form_for @post, method: :put, html: { id: 'PublishPost', class: %w(button publish) } do |f| %> <%= f.button 'Publish', value: 'publish'%> <% end %> <%= form_for @post, method: :delete, html: { id: 'DeletePost', class: %w(destroy button), as: 'Post.Delete' } do |f| %> <%= f.button disabled: true do %> <%= check_box_tag 'delete' %> Delete this post <% end %> <% end %> <% end %> <% end %>
<%= content_tag :header, as: "Post.Header" do |header| %> <% if @post.header? %> <% header[:style] = "background-image: url(#{@post.header.url});" %> <% end %> <%= render 'admin/images/form', post: @post %> <% end %> <%= post_edit_content(@post) %>
<%= form_for @post, method: :put, remote: true, html: {as: 'Editor.Save', class: %w(save button)} do |f| %> <%= f.button '', dirty: 'Update', persisted: 'Up to date', disabled: true %> <%= content_tag :div, class: %w(update) do %> Last updated <%= content_tag :p, nil, time: @post.updated_at.iso8601 %> <% end %> <% end %> <%= link_to 'Syntax', help_admin_posts_path, remote: true, class: %w(help) %> <% unless Rails.application.secrets.has_key?(:s3) %>
<%= link_to 'Configure S3 to upload images.', admin_configurations_images_path %>
<% end %>