<% if @post.draft? && !@post.parent.present? %>
<%= f.submit "#{ (@post.new_record?) ? t('camaleon_cms.admin.page_title.create') : t('camaleon_cms.admin.button.update')}", class: "btn btn-success btn-lg btn-block" %>
<% elsif @post.draft? && @post.parent.present? %>
<%= f.submit "#{ t('camaleon_cms.admin.button.recover') }", class: "btn btn-success btn-lg btn-block", onclick: "$('#post_status').val('#{@post.get_option('draft_status')}')" %>
<% else %>
<%= f.submit "#{ (@post.new_record?) ? t('camaleon_cms.admin.page_title.create') : t('camaleon_cms.admin.page_title.update')}", class: "btn btn-success btn-lg btn-block" %>
<% end %>

<%= t('camaleon_cms.admin.post_type.configuration')%>

<% if @post.manage_template?(@post_type) && (template_files = cama_get_list_template_files(@post_type)).present? %>
<%= select("meta", "template", template_files, { include_blank: true, selected: (params[:meta][:template] rescue false || @post.get_template(@post_type) ) }, {class: 'form-control'}) %>
<% end %> <% if @post.manage_layout? && (layout_files = cama_get_list_layouts_files(@post_type)).present? %>
<%= select("meta", "layout", layout_files, { include_blank: true, selected: (params[:meta][:layout] rescue false || @post.get_layout(@post_type) ) }, {class: 'form-control'}) %>
<% end %> <% if @post_type.manage_hierarchy? %>
<%= f.select :post_parent, cama_hierarchy_post_list(@post_type.posts.published.decorate.to_a).map{|p| [p.the_hierarchy_title, p.id] }, { include_blank: true, selected: (params[:post][:post_parent] rescue false || @post.post_parent ), disabled: (@post.full_children.cama_pluck(:id) << @post.id) }, {class: 'form-control'} %>
<% end %> <% if @post.manage_comments?(@post_type) %>
<% end %> <% if @post_type.get_option('has_featured', false) %>
<% end %> <%= raw @post_form_extra_settings.join("") if @post_form_extra_settings.present? %>
<% if @post_type.manage_categories? %>

<%= t('camaleon_cms.admin.post_type.categories')%> *

<%= raw post_type_html_inputs(@post_type, "categories", "categories" , "checkbox" ,params[:categories] || (@post.new_record? ? [] : @post.categories.pluck("#{CamaleonCms::TermTaxonomy.table_name}.id")), "categorychecklist", true )%>
<% end %> <% if @post_type.manage_tags? %>

<%= t('camaleon_cms.admin.post_type.tags')%>

"/>
<% end %> <% if @post.manage_picture?(@post_type) %>

<%= t(@post_type.get_option('posts_feature_image_label', 'camaleon_cms.admin.post_type.featured_image'), default: @post_type.get_option('posts_feature_image_label_default', 'Featured Image'))%> <%= "(#{@post_type.get_option('posts_image_dimension')})" if @post_type.get_option('posts_image_dimension').present? %>

<% end %> <%= _hook_args = {html: "", f: f, post: @post, post_type: @post_type}; hooks_run("post_form_sidebar_custom_html", _hook_args); raw(_hook_args[:html]); %>