<% unless @post.new_record? %> <% content_for :content_title, @post.title %> <% content_for :content_subtitle, @blog.title %> <% content_for :content_title_extra do %> <%= page_header_buttons do %> <%= present(@post).label_published %> <%= link_to(icon_label(:view, 'View'), post_show_url(@blog, @post), class: "btn btn-xs btn-default", title: 'View', target: '_blank') %>
<% end %> <% end %> <% else %> <% content_for :content_title, @blog.title %> <% end %> <% submit_url = (@post.new_record? ? admin_cms_blog_cms_posts_path(@blog) : admin_cms_blog_cms_post_path(@blog, @post)) %> <%= simple_form_for @post, url: submit_url, html: { class: 'form-horizontal' }, wrapper: :bs3_horizontal_form, wrapper_mappings: DmAdmin::FormWrapperMappings do |f| %> <%= f.error_notification message: "Please review the problems below" %> <% toolbar = capture do %> <%= link_to icons(:help), '#', class: 'btn btn-link btn-icon', data: { toggle: 'modal', target: '#tag_reference' } %> <%= link_to icons(:cancel), admin_cms_blog_path(@blog), class: 'btn btn-link btn-icon' %> <% end %> <%= panel toolbar: toolbar do %> <%= f.input :published_on, as: :datetime_picker, required: false, wrapper: :bs3_horizontal_nosize, label_html: {class: 'col-sm-2'}, input_wrapper_html: {class: 'col-sm-4'}, hint: 'Leave blank for DRAFT mode' %> <%= locale_tabs do |locale| %> <%= f.input "title_#{locale}", label: 'Post Title', required: true %>
<%= f.input "summary_#{locale}", label: 'Summary', required: true, wrapper: :bs3_vertical_form, as: :code_editor, input_html: {style: "height: 100px;"} %>
<%= f.input "content_#{locale}", label: 'Content', required: true, wrapper: :bs3_vertical_form, as: :code_editor, input_html: {style: "height: 500px;"} %>
<% end %> <%= f.input :slug, label: 'Slug', hint: 'Leave blank to have auto-generated based on title.' %> <%= f.input :featured_image, label: 'Featured Image', id: 'image_error' %> <%= f.input :comments_allowed, as: :boolean, label: 'Allow Comments', hint: 'Turn on if you want commenting for this post.' %> <%= submit_or_cancel cancel_url: admin_cms_blog_path(@blog), delete_url: ([:admin, @blog, @post] unless @post.new_record?), delete_confirm: 'Are you sure you wish to delete this post? All comments will also be deleted!' %> <% end %> <% end %> <%= render partial: 'dm_cms/admin/shared/liquid_tags_ref' %>