<% @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', placeholder: 'dashboard' %> <%= t('camaleon_cms.admin.post_type.icons_url_desc', default: 'Please enter any icon name from here: ') %> https://fortawesome.github.io/Font-Awesome/icons/
<%= args={html: '', post_type: @post_type}; hooks_run('post_type_settings_form', args); raw(args[:html]) %>

<%= 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_to_support_parent_structure', default: "Permit to posts indicate the parent page")}", 'right') %>
<%= raw cama_html_tooltip("#{t('camaleon_cms.admin.post_type.tooltip.permission_add_image_presentation')}", 'right') %>
<%= raw cama_html_tooltip("#{cama_t('camaleon_cms.admin.custom_field.fields.image_dimension_descr')}", 'right') %> <%= text_field_tag 'meta[posts_image_dimension]', @post_type.get_option('posts_image_dimension'), class: 'form-control' %>
<%= raw cama_html_tooltip("#{cama_t('camaleon_cms.admin.custom_field.fields.image_versions_descr')}", 'right') %> <%= text_field_tag 'meta[posts_thumb_versions]', @post_type.get_option('posts_thumb_versions'), class: 'form-control' %>
<%= raw cama_html_tooltip("#{cama_t('camaleon_cms.admin.custom_field.fields.image_thumb_descr', d: current_site.get_option('filesystem_thumb_size', '100x100'))}", 'right') %> <%= text_field_tag 'meta[posts_thumb_size]', @post_type.get_option('posts_thumb_size'), class: 'form-control' %>
<%= args={html: '', post_type: @post_type}; hooks_run('post_type_settings_admin', args); raw(args[:html]) %>
<% @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 %> <%= args={html: '', post_type: @post_type}; hooks_run('post_type_settings_front', args); raw(args[:html]) %>
<% end %>