<% @post_type = current_site.post_types.new if @post_type.nil? groups = @post_type.get_field_groups({kind: "post_type"}) %> <%= form_for @post_type, as: "post_type", url:{action: @post_type.new_record? ? :create : :update} , html:{class: 'validate-post-type cama_ajax_request', id: "post_type_form"} do |f| %> <%= f.hidden_field :parent_id %> <%= f.hidden_field :taxonomy %>
<%= render partial: 'layouts/camaleon_cms/admin/form_error', locals: {data: @post_type} %>
<%= f.label t('camaleon_cms.admin.table.name') %>
<%= f.text_field :name, :class => "form-control required translatable" %>
<%= f.label t('camaleon_cms.admin.table.slug') %>
<%= f.text_field :slug, :class => "form-control slug no_translate required", "data-parent" => "post_type_name" %>
<%= f.label t('camaleon_cms.admin.table.description') %>
<%= f.text_area :description, :class => "form-control translatable", :rows => 4 %>
<%= text_field_tag "meta[icon]", @post_type.get_option("icon", ''), class: 'form-control' %> Please enter any icon name from this site

<%= t('camaleon_cms.admin.table.settings') %>

<%= raw cama_html_tooltip("#{t('camaleon_cms.admin.post_type.tooltip.permission_manage_layout')}", 'right') %>
<%= select("meta", "default_layout", cama_get_list_layouts_files(@post_type), { include_blank: true, selected: @post_type.get_option("default_layout") }, {class: 'form-control'}) %>
<%= raw cama_html_tooltip("#{t('camaleon_cms.admin.post_type.tooltip.permission_manage_template')}", 'right') %>
<%= select("meta", "default_template", cama_get_list_template_files(@post_type), { include_blank: true, selected: @post_type.get_option("default_template") }, {class: 'form-control'}) %>
<%= raw cama_html_tooltip("#{t('camaleon_cms.admin.post_type.tooltip.permission_asing_categories')}", 'right') %>
<%= raw cama_html_tooltip("#{t('camaleon_cms.admin.post_type.tooltip.permission_add_tags')}", 'right') %>
<%= raw cama_html_tooltip("#{t('camaleon_cms.admin.post_type.tooltip.permission_add_content')}", 'right') %>
<%= raw cama_html_tooltip("#{t('camaleon_cms.admin.post_type.tooltip.permission_add_content_summary')}", 'right') %>
<%= raw cama_html_tooltip("#{t('camaleon_cms.admin.post_type.tooltip.permission_reviews')}", 'right') %>
<%= raw cama_html_tooltip("#{t('camaleon_cms.admin.post_type.tooltip.permission_add_image_presentation')}", 'right') %>
<%= raw cama_html_tooltip("#{t('camaleon_cms.admin.post_type.tooltip.permission_add_keywords')}", 'right') %>
<%= raw cama_html_tooltip("#{t('camaleon_cms.admin.post_type.tooltip.permission_to_support_parent_structure', default: "Permit to posts indicate the parent page")}", 'right') %>
<% @post_type.contents_route_formats.each do |key, descr| %>
<% end %>

<%= hidden_field :meta, :default_thumb, :class => "form-control unput_upload", :value => @post_type.get_option('default_thumb') %>
<% if groups.present? %>
<%= render partial: "camaleon_cms/admin/settings/custom_fields/render", locals: {record: @post_type, field_groups: groups} %>
<% end %>
<% end %>